//
// GameLevelManager::onUploadLevelCompleted from 0x835e2c to 0x8360c4 (664 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x85cb94
// > ??> @ 0xe6a88
//
// This function is hookable on this platform (idp: arm, 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:55:11 +0000
//
__int64 __fastcall GameLevelManager::onUploadLevelCompleted(GameLevelManager *a1, __int64 a2, char *a3)
{
char *v5; // x19
size_t v6; // x0
__int64 v7; // x24
int v8; // w24
_BOOL4 v9; // w19
__int64 v10; // x19
void (__fastcall *v11)(__int64, __int64); // x20
__int64 LocalLevel; // x0
const char *v14; // x0
unsigned int v15; // w23
__int64 v16; // x0
__int64 v17; // x19
int v18; // w1
void (__fastcall ***v19)(_QWORD, __int64); // x0
__int64 v20; // [xsp+48h] [xbp+48h] BYREF
size_t v21; // [xsp+50h] [xbp+50h]
void *v22; // [xsp+58h] [xbp+58h]
__int64 v23; // [xsp+60h] [xbp+60h] BYREF
size_t v24; // [xsp+68h] [xbp+68h]
void *v25; // [xsp+70h] [xbp+70h]
v5 = a3 + 1;
if ( (*a3 & 1) != 0 )
v5 = *((char **)a3 + 2);
v23 = 0;
v24 = 0;
v25 = nullptr;
v6 = strlen(v5);
v7 = *((_QWORD *)a1 + 136);
std::string::__init(&v23, v5, v6);
cocos2d::CCDictionary::removeObjectForKey(v7, &v23);
if ( (v23 & 1) != 0 )
operator delete(v25);
v8 = atoi(v5);
v23 = 0;
v24 = 0;
v25 = nullptr;
std::string::__init(&v23, &word_117CE08, 2u);
v9 = sub_7FEA60(a2, (__int64)&v23);
if ( (v23 & 1) != 0 )
operator delete(v25);
if ( v9 )
{
v10 = *((_QWORD *)a1 + 159);
if ( v10 )
{
v11 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v10 + 8LL);
LocalLevel = GameLevelManager::getLocalLevel(a1, v8);
v11(v10, LocalLevel);
}
return _stack_chk_guard;
}
v14 = (const char *)(a2 + 1);
if ( (*(_BYTE *)a2 & 1) != 0 )
v14 = *(const char **)(a2 + 16);
v15 = atoi(v14);
v16 = GameLevelManager::getLocalLevel(a1, v8);
v17 = v16;
if ( v16 )
{
*(_DWORD *)(v16 + 336) = v15;
v18 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
*(_DWORD *)(v17 + 332) = v18;
*(_DWORD *)(v17 + 328) = v15 + v18;
GJGameLevel::levelWasSubmitted(v17);
if ( GJGameLevel::isPlatformer((GJGameLevel *)v17) )
{
if ( *(_BYTE *)(v17 + 1000) )
{
GJGameLevel::shippedControls((GJGameLevel *)v17, &v20);
if ( (v20 & 1) != 0 )
{
if ( !v21 )
{
LABEL_24:
operator delete(v22);
goto LABEL_25;
}
v23 = 0;
v24 = 0;
v25 = nullptr;
std::string::__init(&v23, v22, v21);
}
else
{
if ( !((int)(unsigned __int8)v20 >> 1) )
goto LABEL_25;
v25 = v22;
v23 = v20;
v24 = v21;
}
GameLevelManager::uploadLevelControls(a1, v15, (__int64)&v23);
if ( (v23 & 1) != 0 )
operator delete(v25);
if ( (v20 & 1) == 0 )
goto LABEL_25;
goto LABEL_24;
}
}
}
LABEL_25:
v19 = *((void (__fastcall ****)(_QWORD, __int64))a1 + 159);
if ( v19 )
(**v19)(v19, v17);
return _stack_chk_guard;
}