//
// InfoLayer::onComment from 0x100893a60 to 0x100893f0b (1195 bytes)
//
// 4 xrefs:
// > InfoLayer::FLAlert_Clicked @ 0x100895b80
// > sub_100895B90 @ 0x100895bb7
// > InfoLayer::init @ 0x100892388
// > InfoLayer::init @ 0x100892c25
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:37:06 +0000
//
void __fastcall InfoLayer::onComment(__int64 a1, __int64 a2, double a3, __m128d a4)
{
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // r14
__int64 v7; // rax
char *v8; // rbx
__int64 v9; // rax
char *v10; // rdi
const char *PostCommentKey; // rax
int TimeLeft; // eax
char *v13; // rax
const char *CString; // r14
size_t v15; // rax
size_t v16; // rbx
char *v17; // r15
char v18; // al
unsigned int v19; // r15d
const char *v20; // r12
int v21; // r14d
__int64 v22; // rax
size_t v23; // rax
size_t v24; // r13
char *v25; // r14
size_t v26; // r12
size_t v27; // r15
__int64 v28; // rax
unsigned int v29; // esi
unsigned int v30; // ecx
__int64 v31; // rax
__int64 v32; // rax
__int64 v33; // rax
char *v34; // r14
__int64 v35; // rax
__int128 v36; // [rsp+0h] [rbp-90h] BYREF
void *v37; // [rsp+10h] [rbp-80h]
_QWORD v38[2]; // [rsp+18h] [rbp-78h] BYREF
void *__p; // [rsp+28h] [rbp-68h]
_QWORD __dst[2]; // [rsp+30h] [rbp-60h] BYREF
void *v41; // [rsp+40h] [rbp-50h]
__int128 v42; // [rsp+48h] [rbp-48h] BYREF
void *v43; // [rsp+58h] [rbp-38h]
unsigned int v44; // [rsp+60h] [rbp-30h]
unsigned int v45; // [rsp+64h] [rbp-2Ch]
v4 = GJAccountManager::sharedState(a1, a2);
if ( *(_DWORD *)(v4 + 352) <= *(_DWORD *)(v4 + 356) )
{
GJAccountManager::sharedState(a1, a2);
sub_1000A24A0();
return;
}
v5 = GameManager::sharedState();
if ( !(unsigned __int8)GameManager::getGameVariable(v5, "0012") )
{
v7 = GameManager::sharedState();
GameManager::setGameVariable(v7, "0012");
__p = operator new(0x100u);
v38[0] = 257;
v38[1] = 253;
strcpy(
(char *)__p,
"1. Do not spam.\n"
"2. Do not harass other players.\n"
"3. Do not post inappropriate or controversial content.\n"
"4. Do not try to bypass these rules.\n"
"These rules and their enforcement are entirely at Moderators' discretion.");
v8 = FLAlertLayer::create_1((int)a1 + 680, (int)"Comment Rules", (__int64)v38, (int)"Next", 0, 380.0);
if ( (v38[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v8 + 72LL))(v8, 3);
goto LABEL_8;
}
v6 = GameLevelManager::sharedState();
GameLevelManager::sharedState();
PostCommentKey = (const char *)GameLevelManager::getPostCommentKey();
TimeLeft = GameLevelManager::getTimeLeft(v6, PostCommentKey, COERCE_DOUBLE(1097859072), a4);
if ( (unsigned int)(TimeLeft - 1) > 0xE )
{
v18 = *(_BYTE *)(a1 + 880);
v19 = 6;
if ( !*(_QWORD *)(a1 + 720) )
{
v19 = 0;
if ( (v18 & 1) != 0 )
v19 = 8 - (*(_QWORD *)(a1 + 704) == 0);
}
if ( (v18 & 1) != 0 )
{
v20 = "Add Note";
if ( !*(_QWORD *)(a1 + 704) )
v20 = "Mod Comment";
v21 = 100;
if ( v19 )
{
LABEL_25:
v23 = strlen(v20);
if ( v23 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_59:
sub_100003630();
v24 = v23;
v45 = v21;
if ( v23 >= 0x17 )
{
v44 = v19;
v27 = 26;
if ( (v23 | 7) != 0x17 )
v27 = (v23 | 7) + 1;
v25 = (char *)operator new(v27);
v43 = v25;
*(_QWORD *)&v42 = v27 + 1;
v19 = v44;
*((_QWORD *)&v42 + 1) = v24;
}
else
{
LOBYTE(v42) = 2 * v23;
v25 = (char *)&v42 + 1;
if ( !v23 )
{
LABEL_39:
v25[v24] = 0;
v28 = *(_QWORD *)(a1 + 704);
if ( v28 )
{
v29 = v45;
if ( *(_BYTE *)(a1 + 880) == 1 )
v30 = *(_DWORD *)(v28 + 376);
else
v30 = *(_DWORD *)(v28 + 372);
}
else
{
v31 = *(_QWORD *)(a1 + 712);
v29 = v45;
if ( v31 )
{
v30 = -*(_DWORD *)(v31 + 344);
}
else
{
v32 = *(_QWORD *)(a1 + 720);
if ( v32 )
{
v30 = *(_DWORD *)(v32 + 316);
}
else
{
v33 = *(_QWORD *)(a1 + 696);
if ( v33 )
v30 = *(_DWORD *)(v33 + 328) - *(_DWORD *)(v33 + 332);
else
v30 = 0;
}
}
}
LOWORD(v36) = 0;
v34 = (char *)ShareCommentLayer::create(&v42, v29, v19, v30, &v36);
if ( (v36 & 1) != 0 )
{
operator delete(v37);
if ( (v42 & 1) == 0 )
{
LABEL_52:
v35 = *(_QWORD *)(a1 + 696);
if ( !v35 )
{
LABEL_54:
v9 = *(_QWORD *)v34;
v10 = v34;
goto LABEL_55;
}
LABEL_53:
*((_DWORD *)v34 + 201) = *(_DWORD *)(v35 + 864) - *(_DWORD *)(v35 + 868);
goto LABEL_54;
}
}
else if ( (v42 & 1) == 0 )
{
goto LABEL_52;
}
operator delete(v43);
v35 = *(_QWORD *)(a1 + 696);
if ( !v35 )
goto LABEL_54;
goto LABEL_53;
}
}
memcpy(v25, v20, v24);
goto LABEL_39;
}
}
else
{
v20 = "Add Comment";
v21 = 100;
if ( v19 )
goto LABEL_25;
}
v22 = GameManager::sharedState();
if ( *(_DWORD *)(v22 + 1032) - *(_DWORD *)(v22 + 1036) == 2 )
v21 = 140;
goto LABEL_25;
}
v13 = sub_10088E820("Please wait %i seconds before posting a new comment!", TimeLeft);
CString = (const char *)cocos2d::CCString::getCString((__int64)v13);
v15 = strlen(CString);
if ( v15 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_59;
v16 = v15;
if ( v15 >= 0x17 )
{
v26 = 26;
if ( (v15 | 7) != 0x17 )
v26 = (v15 | 7) + 1;
v17 = (char *)operator new(v26);
v41 = v17;
__dst[0] = v26 + 1;
__dst[1] = v16;
goto LABEL_32;
}
LOBYTE(__dst[0]) = 2 * v15;
v17 = (char *)__dst + 1;
if ( v15 )
LABEL_32:
memmove(v17, CString, v16);
v17[v16] = 0;
v8 = FLAlertLayer::create_1(0, (int)"Too fast", (__int64)__dst, (int)"OK", 0, 300.0);
if ( (__dst[0] & 1) != 0 )
operator delete(v41);
LABEL_8:
v9 = *(_QWORD *)v8;
v10 = v8;
LABEL_55:
(*(void (__fastcall **)(char *))(v9 + 1312))(v10);
}