//
// GameLevelManager::getAccountComments from 0x723d50 to 0x7240bc (876 bytes)
//
// 2 xrefs:
// > ProfilePage::loadPage @ 0x8fedf8
// > ??> @ 0x70218
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GameLevelManager::getAccountComments(GameLevelManager *a1, int a2, int a3, int a4)
{
char *AccountCommentKey; // x21
cocos2d::CCString *v9; // x0
const char *CString; // x0
cocos2d::CCString *v11; // x0
size_t v12; // x0
int *p_m_unknown2; // x0
char *v14; // x0
char *v15; // x0
char *v16; // x0
unsigned int *v17; // x1
int v18; // w2
unsigned int *p_timeoutForConnect; // x1
int timeoutForConnect; // w2
unsigned int *v21; // x1
int v22; // w2
unsigned int *v23; // x1
int v24; // w2
const char *v25; // [xsp+58h] [xbp+58h]
char *v26; // [xsp+88h] [xbp+88h] BYREF
const char *v27; // [xsp+90h] [xbp+90h] BYREF
const char *v28; // [xsp+98h] [xbp+98h] BYREF
cocos2d::extension::CCHttpClient *v29; // [xsp+A0h] [xbp+A0h] BYREF
AccountCommentKey = (char *)GameLevelManager::getAccountCommentKey(a1, a2, a3);
if ( !GameLevelManager::isDLActive(a1, AccountCommentKey) )
{
GameLevelManager::addDLToActive(a1, AccountCommentKey);
GameLevelManager::getBasePostString(a1, (__int64)&v26);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
CString = cocos2d::CCString::getCString(v9);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&accountID=%i&page=%i&total=%i&secret=%s",
(const char *)(unsigned int)a2,
(unsigned int)a3,
(unsigned int)a4,
CString);
v25 = cocos2d::CCString::getCString(v11);
v12 = strlen(v25);
sub_D15FD4(&v26, v25, v12);
sub_D153B8((int)&v27, "https://www.boomlings.com/database/getGJAccountComments20.php");
sub_D153B8((int)&v28, v26);
sub_D153B8((int)&v29, AccountCommentKey);
GameLevelManager::ProcessHttpRequest(a1, &v27, &v28, &v29, 25);
p_m_unknown2 = &v29[-1].m_unknown2;
if ( &v29[-1].m_unknown2 != (int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_timeoutForConnect = (unsigned int *)&v29[-1]._timeoutForConnect;
do
timeoutForConnect = __ldaxr(p_timeoutForConnect);
while ( __stlxr(timeoutForConnect - 1, p_timeoutForConnect) );
}
else
{
timeoutForConnect = v29[-1]._timeoutForConnect;
v29[-1]._timeoutForConnect = timeoutForConnect - 1;
}
if ( timeoutForConnect <= 0 )
operator delete(p_m_unknown2);
}
v14 = (char *)(v28 - 24);
if ( v28 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(v28 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *((_DWORD *)v28 - 2);
*((_DWORD *)v28 - 2) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v14);
}
v15 = (char *)(v27 - 24);
if ( v27 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(v27 - 8);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *((_DWORD *)v27 - 2);
*((_DWORD *)v27 - 2) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v15);
}
v16 = v26 - 24;
if ( v26 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(v26 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *((_DWORD *)v26 - 2);
*((_DWORD *)v26 - 2) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v16);
}
}
}