//
// GameLevelManager::getGJUserInfo from 0x7220f8 to 0x72244c (852 bytes)
//
// 5 xrefs:
// > ProfilePage::onUpdate @ 0x8fdc2c
// > ProfilePage::onUpdate @ 0x8fdde8
// > ProfilePage::updateUserScoreFinished @ 0x8fde8c
// > ProfilePage::init @ 0x8fe900
// > ??> @ 0xad550
//
// 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::getGJUserInfo(GameLevelManager *a1, int a2)
{
char *UserInfoKey; // x21
cocos2d::CCString *v5; // x0
const char *CString; // x0
cocos2d::CCString *v7; // x0
size_t v8; // x0
int *p_m_unknown2; // x0
char *v10; // x0
char *v11; // x0
char *v12; // x0
unsigned int *v13; // x1
int v14; // w2
unsigned int *p_timeoutForConnect; // x1
int timeoutForConnect; // w2
unsigned int *v17; // x1
int v18; // w2
unsigned int *v19; // x1
int v20; // w2
const char *v21; // [xsp+48h] [xbp+48h]
char *v22; // [xsp+78h] [xbp+78h] BYREF
const char *v23; // [xsp+80h] [xbp+80h] BYREF
const char *v24; // [xsp+88h] [xbp+88h] BYREF
cocos2d::extension::CCHttpClient *v25; // [xsp+90h] [xbp+90h] BYREF
UserInfoKey = (char *)GameLevelManager::getUserInfoKey(a1, a2);
if ( !GameLevelManager::isDLActive(a1, UserInfoKey) )
{
GameLevelManager::addDLToActive(a1, UserInfoKey);
GameLevelManager::getBasePostString(a1, (__int64)&v22);
v5 = (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(v5);
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&targetAccountID=%i&secret=%s",
(const char *)(unsigned int)a2,
CString);
v21 = cocos2d::CCString::getCString(v7);
v8 = strlen(v21);
sub_D15FD4(&v22, v21, v8);
sub_D153B8((int)&v23, "https://www.boomlings.com/database/getGJUserInfo20.php");
sub_D153B8((int)&v24, v22);
sub_D153B8((int)&v25, UserInfoKey);
GameLevelManager::ProcessHttpRequest(a1, &v23, &v24, &v25, 27);
p_m_unknown2 = &v25[-1].m_unknown2;
if ( &v25[-1].m_unknown2 != (int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_timeoutForConnect = (unsigned int *)&v25[-1]._timeoutForConnect;
do
timeoutForConnect = __ldaxr(p_timeoutForConnect);
while ( __stlxr(timeoutForConnect - 1, p_timeoutForConnect) );
}
else
{
timeoutForConnect = v25[-1]._timeoutForConnect;
v25[-1]._timeoutForConnect = timeoutForConnect - 1;
}
if ( timeoutForConnect <= 0 )
operator delete(p_m_unknown2);
}
v10 = (char *)(v24 - 24);
if ( v24 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(v24 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *((_DWORD *)v24 - 2);
*((_DWORD *)v24 - 2) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v10);
}
v11 = (char *)(v23 - 24);
if ( v23 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(v23 - 8);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *((_DWORD *)v23 - 2);
*((_DWORD *)v23 - 2) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v11);
}
v12 = v22 - 24;
if ( v22 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v13 = (unsigned int *)(v22 - 8);
do
v14 = __ldaxr(v13);
while ( __stlxr(v14 - 1, v13) );
}
else
{
v14 = *((_DWORD *)v22 - 2);
*((_DWORD *)v22 - 2) = v14 - 1;
}
if ( v14 <= 0 )
operator delete(v12);
}
}
}