//
// GameLevelManager::getLevelComments from 0x100569f80 to 0x10056a3c2 (1090 bytes)
//
// 2 xrefs:
// > InfoLayer::loadPage @ 0x100894a6d
// > InfoLayer::updateUserScoreFinished @ 0x100896940
//
// 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:32:12 +0000
//
void __fastcall GameLevelManager::getLevelComments(__int64 a1, int a2, __int64 a3, int a4, int a5, __int64 a6)
{
__int64 v6; // rax
const char *CString; // r14
size_t v8; // rax
size_t v9; // r13
char *v10; // r15
size_t v11; // r12
char v12; // r13
char v13; // r12
const char *v14; // r14
__int64 v15; // rax
__int64 v16; // rax
const std::string::value_type *v17; // rax
const std::string::value_type *v18; // rsi
__int64 v19; // rax
const std::string::value_type *v20; // rax
__int64 v21; // rax
const std::string::value_type *v22; // rax
__int64 v23; // rax
int v24; // ebx
__int64 v25; // rax
__int64 v26; // rax
const std::string::value_type *v27; // rax
int v28; // r14d
size_t v29; // rbx
void *v30; // r15
const char *v31; // rsi
const char *data; // rbx
size_t v33; // rax
size_t v34; // r14
char *v35; // r12
size_t v36; // r13
char v37; // [rsp+0h] [rbp-D0h]
char v38; // [rsp+0h] [rbp-D0h]
char v39; // [rsp+0h] [rbp-D0h]
char v40; // [rsp+0h] [rbp-D0h]
std::string v41; // [rsp+8h] [rbp-C8h] BYREF
__int128 v42; // [rsp+20h] [rbp-B0h] BYREF
void *v43; // [rsp+30h] [rbp-A0h]
_QWORD v44[2]; // [rsp+40h] [rbp-90h] BYREF
void *v45; // [rsp+50h] [rbp-80h]
int v46; // [rsp+5Ch] [rbp-74h]
int v47; // [rsp+60h] [rbp-70h]
int v48; // [rsp+64h] [rbp-6Ch]
__int64 v49; // [rsp+68h] [rbp-68h]
std::string v50; // [rsp+70h] [rbp-60h] BYREF
__int128 __dst; // [rsp+88h] [rbp-48h] BYREF
void *__p; // [rsp+98h] [rbp-38h]
__int64 v53; // [rsp+A0h] [rbp-30h]
v47 = a4;
v48 = a2;
v46 = a5;
v53 = a6;
v6 = sub_10088E820("comment_%i_%i_%i_%i", v37);
CString = (const char *)cocos2d::CCString::getCString(v6);
v8 = strlen(CString);
if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v9 = v8;
v49 = a1;
if ( v8 >= 0x17 )
{
v11 = 26;
if ( (v8 | 7) != 0x17 )
v11 = (v8 | 7) + 1;
v10 = (char *)operator new(v11);
__p = v10;
*(_QWORD *)&__dst = v11 + 1;
*((_QWORD *)&__dst + 1) = v9;
goto LABEL_8;
}
LOBYTE(__dst) = 2 * v8;
v10 = (char *)&__dst + 1;
if ( v8 )
LABEL_8:
memmove(v10, CString, v9);
v10[v9] = 0;
v12 = __dst;
v13 = __dst & 1;
if ( (__dst & 1) != 0 )
v14 = (const char *)__p;
else
v14 = (char *)&__dst + 1;
if ( GameLevelManager::isDLActive(v49, v14) )
goto LABEL_42;
GameLevelManager::addDLToActive(v49, v14);
GameLevelManager::getBasePostString(&v50);
v15 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v15);
v16 = sub_10088E820("&page=%i&total=%i&secret=%s&mode=%i", v38);
v17 = (const std::string::value_type *)cocos2d::CCString::getCString(v16);
std::string::append(&v50, v17);
v18 = "&levelID=";
if ( (_DWORD)v53 == 1 )
v18 = "&userID=";
std::string::append(&v50, v18);
v19 = sub_10088E820("%i", v39);
v20 = (const std::string::value_type *)cocos2d::CCString::getCString(v19);
std::string::append(&v50, v20);
if ( (unsigned int)(v53 - 3) <= 2 )
{
v21 = sub_10088E820("&cType=%i", v40);
v22 = (const std::string::value_type *)cocos2d::CCString::getCString(v21);
std::string::append(&v50, v22);
}
v23 = GameManager::sharedState();
v24 = 10;
if ( (unsigned __int8)GameManager::getGameVariable(v23, "0088") )
v24 = 20;
v25 = GameManager::sharedState();
if ( (unsigned int)(v24 << GameManager::getGameVariable(v25, "0094")) >= 0xB )
{
v26 = sub_10088E820("&count=%i", v40);
v27 = (const std::string::value_type *)cocos2d::CCString::getCString(v26);
std::string::append(&v50, v27);
}
v28 = v53;
v29 = 4LL * ((_DWORD)v53 == 1) + 54;
v30 = operator new((v29 | 7) + 1);
v31 = "https://www.boomlings.com/database/getGJComments21.php";
if ( v28 == 1 )
v31 = "https://www.boomlings.com/database/getGJCommentHistory.php";
memcpy(v30, v31, v29);
*((_BYTE *)v30 + v29) = 0;
sub_10001AD30(&v41, v30, v29);
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) != 0 )
data = v50.__r_.__value_.__l.__data_;
else
data = v50.__r_.__value_.__s.__data_;
v33 = strlen(data);
if ( v33 >= 0xFFFFFFFFFFFFFFF8LL )
{
LOBYTE(v53) = v12;
sub_100003630();
}
v34 = v33;
if ( v33 >= 0x17 )
{
LOBYTE(v53) = v12;
v36 = 26;
if ( (v33 | 7) != 0x17 )
v36 = (v33 | 7) + 1;
v35 = (char *)operator new(v36);
v45 = v35;
v44[0] = v36 | 1;
v44[1] = v34;
goto LABEL_33;
}
LOBYTE(v44[0]) = 2 * v33;
v35 = (char *)v44 + 1;
if ( v33 )
LABEL_33:
memmove(v35, data, v34);
v35[v34] = 0;
v13 = __dst & 1;
if ( (__dst & 1) != 0 )
{
sub_10001AD30(&v42, __p, *((unsigned __int64 *)&__dst + 1));
}
else
{
v43 = __p;
v42 = __dst;
}
GameLevelManager::ProcessHttpRequest(v49, &v41, (__int64)v44, &v42, 0xCu);
if ( (v42 & 1) == 0 )
{
if ( (v44[0] & 1) == 0 )
goto LABEL_39;
LABEL_46:
operator delete(v45);
if ( (*(_BYTE *)&v41.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_40:
operator delete(v30);
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_42;
goto LABEL_41;
}
goto LABEL_47;
}
operator delete(v43);
if ( (v44[0] & 1) != 0 )
goto LABEL_46;
LABEL_39:
if ( (*(_BYTE *)&v41.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_40;
LABEL_47:
operator delete(v41.__r_.__value_.__l.__data_);
operator delete(v30);
if ( (*(_BYTE *)&v50.__r_.__value_.__s.0 & 1) != 0 )
LABEL_41:
operator delete(v50.__r_.__value_.__l.__data_);
LABEL_42:
if ( v13 )
operator delete(__p);
}