//
// GameLevelManager::submitUserInfo from 0x72c98c to 0x72cf70 (1508 bytes)
//
// 2 xrefs:
// > GameLevelManager::onUpdateUserScoreCompleted @ 0x72d178
// > ??> @ 0x3ebe0
//
// 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::submitUserInfo(GameLevelManager *a1)
{
GameLevelManager *v1; // x0
cocos2d::CCArray *CompletedLevels; // x21
unsigned int i; // w20
cocos2d::CCString *v4; // x0
size_t v5; // x0
_DWORD *v6; // x19
const char *v7; // x28
int v8; // w8
unsigned int *v9; // x1
int v10; // w2
const char *v11; // x20
GJAccountManager *v12; // x0
unsigned int v13; // w19
cocos2d::CCString *v14; // x0
const char *v15; // x0
cocos2d::CCString *v16; // x0
char *v17; // x0
size_t v18; // x0
char *v19; // x21
int *p_m_unknown2; // x0
char *v21; // x0
char *v22; // x0
char *v23; // x0
char *v24; // x0
char *v25; // x0
unsigned int *p_timeoutForConnect; // x1
int timeoutForConnect; // w2
unsigned int *v28; // x1
int v29; // w2
unsigned int *v30; // x1
int v31; // w2
unsigned int *v32; // x1
int v33; // w2
unsigned int *v34; // x1
int v35; // w2
unsigned int *v36; // x19
int v37; // w1
__int64 v38; // [xsp+0h] [xbp-10h]
const char *CString; // [xsp+78h] [xbp+68h]
int v41; // [xsp+78h] [xbp+68h]
char *v42; // [xsp+78h] [xbp+68h]
char *v43; // [xsp+A0h] [xbp+90h] BYREF
const char *v44; // [xsp+A8h] [xbp+98h] BYREF
const char *v45; // [xsp+B0h] [xbp+A0h] BYREF
char *v46; // [xsp+B8h] [xbp+A8h] BYREF
const char *v47; // [xsp+C0h] [xbp+B0h] BYREF
const char *v48; // [xsp+C8h] [xbp+B8h] BYREF
cocos2d::extension::CCHttpClient *v49; // [xsp+D0h] [xbp+C0h] BYREF
sub_D153B8((int)&v43, &byte_F288A0);
v1 = GameLevelManager::sharedState();
CompletedLevels = GameLevelManager::getCompletedLevels(v1, 0);
for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(CompletedLevels); ++i )
{
v6 = (_DWORD *)cocos2d::CCArray::objectAtIndex(CompletedLevels, i);
if ( i )
sub_D15FD4(&v43, ";", 1);
sub_D18D28(&v44);
v7 = v44;
v8 = strlen(v44);
if ( v7 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v9 = (unsigned int *)(v7 - 8);
do
v10 = __ldaxr(v9);
while ( __stlxr(v10 - 1, v9) );
}
else
{
v10 = *((_DWORD *)v7 - 2);
*((_DWORD *)v7 - 2) = v10 - 1;
}
if ( v10 <= 0 )
{
v41 = v8;
operator delete((void *)(v7 - 24));
v8 = v41;
}
}
LODWORD(v38) = v8;
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s,%i,%s,%i,%s,%i,%s,%i",
"1",
(unsigned int)(v6[82] - v6[83]),
&byte_F78BA8,
(unsigned int)(v6[134] - v6[135]),
"3",
(unsigned int)(v6[137] - v6[138]),
&byte_F2CA20,
v38);
CString = cocos2d::CCString::getCString(v4);
v5 = strlen(CString);
sub_D15FD4(&v43, CString, v5);
}
GameManager::sharedState();
sub_D18D28(&v45);
v11 = v45;
v12 = GJAccountManager::sharedState();
v13 = v12->m_accountID - v12->m_unkInt1;
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
v15 = cocos2d::CCString::getCString(v14);
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"udid=%s&accountID=%i&secret=%s",
v11,
v13,
v15);
v17 = (char *)cocos2d::CCString::getCString(v16);
sub_D153B8((int)&v46, v17);
sub_D15FD4(&v46, "&levelsInfo=", 12);
v42 = v43;
v18 = strlen(v43);
sub_D15FD4(&v46, v42, v18);
v19 = v46;
sub_D153B8((int)&v47, "https://www.boomlings.com/database/submitGJUserInfo.php");
sub_D153B8((int)&v48, v19);
sub_D153B8((int)&v49, &byte_F288A0);
GameLevelManager::ProcessHttpRequest(a1, &v47, &v48, &v49, 17);
p_m_unknown2 = &v49[-1].m_unknown2;
if ( &v49[-1].m_unknown2 != (int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_timeoutForConnect = (unsigned int *)&v49[-1]._timeoutForConnect;
do
timeoutForConnect = __ldaxr(p_timeoutForConnect);
while ( __stlxr(timeoutForConnect - 1, p_timeoutForConnect) );
}
else
{
timeoutForConnect = v49[-1]._timeoutForConnect;
v49[-1]._timeoutForConnect = timeoutForConnect - 1;
}
if ( timeoutForConnect <= 0 )
operator delete(p_m_unknown2);
}
v21 = (char *)(v48 - 24);
if ( v48 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v28 = (unsigned int *)(v48 - 8);
do
v29 = __ldaxr(v28);
while ( __stlxr(v29 - 1, v28) );
}
else
{
v29 = *((_DWORD *)v48 - 2);
*((_DWORD *)v48 - 2) = v29 - 1;
}
if ( v29 <= 0 )
operator delete(v21);
}
v22 = (char *)(v47 - 24);
if ( v47 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v30 = (unsigned int *)(v47 - 8);
do
v31 = __ldaxr(v30);
while ( __stlxr(v31 - 1, v30) );
}
else
{
v31 = *((_DWORD *)v47 - 2);
*((_DWORD *)v47 - 2) = v31 - 1;
}
if ( v31 <= 0 )
operator delete(v22);
}
v23 = v46 - 24;
if ( v46 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v32 = (unsigned int *)(v46 - 8);
do
v33 = __ldaxr(v32);
while ( __stlxr(v33 - 1, v32) );
}
else
{
v33 = *((_DWORD *)v46 - 2);
*((_DWORD *)v46 - 2) = v33 - 1;
}
if ( v33 <= 0 )
operator delete(v23);
}
v24 = (char *)(v45 - 24);
if ( v45 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v34 = (unsigned int *)(v45 - 8);
do
v35 = __ldaxr(v34);
while ( __stlxr(v35 - 1, v34) );
}
else
{
v35 = *((_DWORD *)v45 - 2);
*((_DWORD *)v45 - 2) = v35 - 1;
}
if ( v35 <= 0 )
operator delete(v24);
}
v25 = v43 - 24;
if ( v43 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)(v43 - 8);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *((_DWORD *)v43 - 2);
*((_DWORD *)v43 - 2) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v25);
}
}