//
// GameLevelManager::onGetThreadMessagesCompleted from 0x4d4140 to 0x4d4876 (1846 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x4db764
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:50:50 +0000
//
int __fastcall GameLevelManager::onGetThreadMessagesCompleted(int a1, int a2, _DWORD *a3)
{
const char *v3; // r8
cocos2d::CCDictionary *v6; // r9
char v8; // r2
size_t v9; // r0
cocos2d::CCArray *v10; // r0
cocos2d::CCArray *v11; // r7
const char *v12; // r8
__int64 v13; // kr00_8
cocos2d::CCString *v14; // r0
const char *v15; // r0
cocos2d::CCString *v16; // r0
int v17; // r0
__int64 v18; // r2
bool v19; // r0
_BOOL4 v20; // r7
int result; // r0
bool v22; // nf
size_t v23; // r0
cocos2d::CCArray *v24; // r6
cocos2d::CCString *v25; // r0
const char *v26; // r7
size_t v27; // r0
cocos2d::CCString *v28; // r0
const char *v29; // r7
size_t v30; // r0
cocos2d::CCString *v31; // r0
const char *v32; // r7
size_t v33; // r0
int v34; // r3
int v35; // r3
cocos2d::CCString *v36; // r0
char *v37; // r0
int *v38; // r0
int v39; // r1
int v40; // r2
int *v41; // r0
int v42; // r1
int v43; // r2
cocos2d::CCString *v44; // r0
char *v45; // r0
int *v46; // r0
int v47; // r1
int v48; // r2
cocos2d::CCString *v49; // r0
const char *v50; // r5
size_t v51; // r0
cocos2d::CCArray *v52; // r5
cocos2d::CCString *v53; // r0
cocos2d::CCString *v54; // r0
cocos2d::CCString *v55; // r0
cocos2d::CCString *v56; // r0
size_t v57; // r0
int v58; // r1
int v59; // r2
cocos2d::CCString *v60; // r0
cocos2d::CCString *v61; // r0
cocos2d::CCString *v62; // r0
cocos2d::CCString *v63; // r0
const char *v64; // r0
cocos2d::CCString *v65; // r0
const char *v66; // r9
size_t v67; // r0
int v68; // r1
int v69; // r2
cocos2d::CCString *v70; // r0
cocos2d::CCString *v71; // r0
cocos2d::CCString *v72; // r0
char *v73; // r0
cocos2d::CCString *v74; // r0
const char *v75; // r5
size_t v76; // r0
cocos2d::CCArray *v77; // r5
cocos2d::CCString *v78; // r0
cocos2d::CCString *v79; // r0
cocos2d::CCString *v80; // r0
int v81; // r0
int v82; // r6
cocos2d::CCString *v83; // r0
cocos2d::CCString *v84; // r0
int v85; // r0
cocos2d::CCString *v86; // r0
cocos2d::CCString *v87; // r0
int v88; // r0
cocos2d::CCArray *v89; // r2
int v90; // r0
cocos2d::CCString *v91; // r0
cocos2d::CCString *v92; // r0
const char *CString; // r0
cocos2d::CCString *v94; // r0
const char *v95; // r0
__int64 v96; // [sp+0h] [bp-84h]
__int64 v97; // [sp+10h] [bp-74h]
const char *v98; // [sp+10h] [bp-74h]
int v99[3]; // [sp+1Ch] [bp-68h] BYREF
unsigned int v100[3]; // [sp+28h] [bp-5Ch] BYREF
int v101[3]; // [sp+34h] [bp-50h] BYREF
int v102; // [sp+40h] [bp-44h] BYREF
int v103; // [sp+44h] [bp-40h]
int v104; // [sp+48h] [bp-3Ch]
int v105; // [sp+4Ch] [bp-38h] BYREF
int v106; // [sp+50h] [bp-34h]
int v107; // [sp+54h] [bp-30h]
int v108; // [sp+58h] [bp-2Ch] BYREF
int v109; // [sp+5Ch] [bp-28h]
int v110; // [sp+60h] [bp-24h]
int v111; // [sp+64h] [bp-20h] BYREF
int v112; // [sp+68h] [bp-1Ch]
int v113; // [sp+6Ch] [bp-18h]
int v114; // [sp+70h] [bp-14h] BYREF
int v115; // [sp+74h] [bp-10h]
int v116; // [sp+78h] [bp-Ch]
v6 = *(cocos2d::CCDictionary **)(a1 + 748);
v8 = *(_BYTE *)a3;
v114 = 0;
v115 = 0;
if ( (v8 & 1) == 0 )
v3 = (char *)a3 + 1;
v116 = 0;
if ( (v8 & 1) != 0 )
v3 = (const char *)a3[2];
v9 = strlen(v3);
std::string::__init(&v114, v3, v9);
cocos2d::CCDictionary::removeObjectForKey(v6);
std::string::~string((int)&v114);
v10 = sub_4C1A88(a3, "_");
v11 = v10;
if ( v10 )
{
if ( cocos2d::CCArray::count(v10) > 3u )
{
v91 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v11, 1u);
v12 = (const char *)cocos2d::CCString::intValue(v91);
v92 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v11, 2u);
CString = (const char *)cocos2d::CCString::getCString(v92);
v13 = atoll(CString);
v94 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v11, 3u);
v95 = (const char *)cocos2d::CCString::getCString(v94);
v96 = atoll(v95);
}
else
{
v96 = 0;
v12 = nullptr;
v13 = 0;
}
if ( cocos2d::CCArray::count(v11) > 5u )
{
v14 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v11, 4u);
v15 = (const char *)cocos2d::CCString::getCString(v14);
v97 = atoll(v15);
v16 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v11, 5u);
v17 = cocos2d::CCString::intValue(v16);
v18 = v97;
v19 = v17 != 0;
goto LABEL_10;
}
}
else
{
v96 = 0;
v12 = nullptr;
v13 = 0;
}
v19 = 0;
v18 = 0;
LABEL_10:
*(_QWORD *)(a1 + 432) = v13;
*(_QWORD *)(a1 + 440) = v96;
*(_QWORD *)(a1 + 384) = v18;
*(_BYTE *)(a1 + 400) = v19;
v114 = 0;
v115 = 0;
v116 = 0;
std::string::__init(&v114, "-1", 2u);
v20 = sub_4A9CC4((unsigned __int8 *)a2, (unsigned __int8 *)&v114);
std::string::~string((int)&v114);
if ( v20 )
{
result = *(_DWORD *)(a1 + 840);
if ( result )
return (*(int (__fastcall **)(int, const char *))(*(_DWORD *)result + 12))(result, v12);
}
else
{
v22 = (*(_BYTE *)a2 & 1) != 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
++a2;
v114 = 0;
if ( v22 )
a2 = *(_DWORD *)(a2 + 8);
v115 = 0;
v116 = 0;
v23 = strlen((const char *)a2);
std::string::__init(&v114, (const void *)a2, v23);
v24 = sub_4C1A88(&v114, "#");
std::string::~string((int)&v114);
if ( cocos2d::CCArray::count(v24) )
{
v25 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 0);
v26 = (const char *)cocos2d::CCString::getCString(v25);
}
else
{
v26 = (const char *)&unk_B6B226;
}
memset(v99, 0, sizeof(v99));
v27 = strlen(v26);
std::string::__init(v99, v26, v27);
if ( cocos2d::CCArray::count(v24) > 3u )
{
v28 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 1u);
v29 = (const char *)cocos2d::CCString::getCString(v28);
v102 = 0;
v103 = 0;
v104 = 0;
v30 = strlen(v29);
std::string::__init(&v102, v29, v30);
v31 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 2u);
v32 = (const char *)cocos2d::CCString::getCString(v31);
v105 = 0;
v106 = 0;
v107 = 0;
v33 = strlen(v32);
std::string::__init(&v105, v32, v33);
if ( (v102 & 1) != 0 )
v34 = v103;
else
v34 = (int)(unsigned __int8)v102 >> 1;
if ( v34 || ((v105 & 1) != 0 ? (v35 = v106) : (v35 = (int)(unsigned __int8)v105 >> 1), v35) )
{
std::operator+(v100, (unsigned __int8 *)&v102, "#");
v36 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 2u);
v37 = (char *)cocos2d::CCString::getCString(v36);
v38 = std::string::append(v100, v37);
v39 = v38[1];
v40 = v38[2];
v111 = *v38;
v112 = v39;
v113 = v40;
*v38 = 0;
v38[1] = 0;
v38[2] = 0;
v41 = std::string::append(&v111, "#");
v42 = v41[1];
v43 = v41[2];
v114 = *v41;
v115 = v42;
v116 = v43;
*v41 = 0;
v41[1] = 0;
v41[2] = 0;
v44 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 3u);
v45 = (char *)cocos2d::CCString::getCString(v44);
v46 = std::string::append(&v114, v45);
v47 = v46[1];
v48 = v46[2];
v108 = *v46;
v109 = v47;
v110 = v48;
*v46 = 0;
v46[1] = 0;
v46[2] = 0;
std::string::~string((int)&v114);
std::string::~string((int)&v111);
std::string::~string((int)v100);
GameLevelManager::storeThreadManifest(a1, v12, (unsigned __int8 *)&v108);
std::string::~string((int)&v108);
}
std::string::~string((int)&v105);
std::string::~string((int)&v102);
}
*(_DWORD *)(a1 + 356) = 0;
*(_DWORD *)(a1 + 360) = 0;
*(_DWORD *)(a1 + 364) = 0;
*(_DWORD *)(a1 + 368) = -1;
std::string::assign((int *)(a1 + 460), (char *)&unk_B6B226);
std::string::assign((int *)(a1 + 472), (char *)&unk_B6B226);
*(_BYTE *)(a1 + 484) = 0;
*(_DWORD *)(a1 + 488) = -1;
std::string::assign((int *)(a1 + 492), (char *)&unk_B6B226);
*(_DWORD *)(a1 + 376) = -1;
*(_DWORD *)(a1 + 380) = 0;
*(_QWORD *)(a1 + 392) = 0;
if ( cocos2d::CCArray::count(v24) > 4u )
{
v49 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 4u);
v50 = (const char *)cocos2d::CCString::getCString(v49);
memset(v101, 0, sizeof(v101));
v51 = strlen(v50);
std::string::__init(v101, v50, v51);
v52 = sub_4C1A88(v101, ":");
std::string::~string((int)v101);
if ( cocos2d::CCArray::count(v52) > 2u )
{
v53 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 0);
*(_DWORD *)(a1 + 356) = cocos2d::CCString::intValue(v53);
v54 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 1u);
*(_DWORD *)(a1 + 360) = cocos2d::CCString::intValue(v54);
v55 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 2u);
*(_DWORD *)(a1 + 364) = cocos2d::CCString::intValue(v55);
}
if ( cocos2d::CCArray::count(v52) > 3u )
{
v56 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 3u);
v98 = (const char *)cocos2d::CCString::getCString(v56);
v102 = 0;
v103 = 0;
v104 = 0;
v57 = strlen(v98);
std::string::__init(&v102, v98, v57);
LevelTools::base64DecodeString(&v105, &v102);
if ( (*(_BYTE *)(a1 + 460) & 1) != 0 )
{
**(_BYTE **)(a1 + 468) = 0;
*(_DWORD *)(a1 + 464) = 0;
}
else
{
*(_BYTE *)(a1 + 461) = 0;
*(_BYTE *)(a1 + 460) = 0;
}
std::string::reserve((int *)(a1 + 460), 0);
v58 = v106;
v59 = v107;
*(_DWORD *)(a1 + 460) = v105;
*(_DWORD *)(a1 + 464) = v58;
*(_DWORD *)(a1 + 468) = v59;
v105 = 0;
v106 = 0;
v107 = 0;
std::string::~string((int)&v105);
std::string::~string((int)&v102);
}
if ( cocos2d::CCArray::count(v52) > 4u )
{
v60 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 4u);
*(_DWORD *)(a1 + 368) = cocos2d::CCString::intValue(v60);
}
if ( cocos2d::CCArray::count(v52) > 5u )
{
v61 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 5u);
*(_DWORD *)(a1 + 376) = cocos2d::CCString::intValue(v61) != 0;
}
if ( cocos2d::CCArray::count(v52) > 6u )
{
v62 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 6u);
*(_DWORD *)(a1 + 380) = cocos2d::CCString::intValue(v62) != 0;
}
if ( cocos2d::CCArray::count(v52) > 7u )
{
v63 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 7u);
v64 = (const char *)cocos2d::CCString::getCString(v63);
*(_QWORD *)(a1 + 392) = atoll(v64);
}
if ( cocos2d::CCArray::count(v52) > 8u )
{
v65 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 8u);
v66 = (const char *)cocos2d::CCString::getCString(v65);
v108 = 0;
v109 = 0;
v110 = 0;
v67 = strlen(v66);
std::string::__init(&v108, v66, v67);
LevelTools::base64DecodeString(&v111, &v108);
if ( (*(_BYTE *)(a1 + 472) & 1) != 0 )
{
**(_BYTE **)(a1 + 480) = 0;
*(_DWORD *)(a1 + 476) = 0;
}
else
{
*(_BYTE *)(a1 + 473) = 0;
*(_BYTE *)(a1 + 472) = 0;
}
std::string::reserve((int *)(a1 + 472), 0);
v68 = v112;
v69 = v113;
*(_DWORD *)(a1 + 472) = v111;
*(_DWORD *)(a1 + 476) = v68;
*(_DWORD *)(a1 + 480) = v69;
v111 = 0;
v112 = 0;
v113 = 0;
std::string::~string((int)&v111);
std::string::~string((int)&v108);
}
if ( cocos2d::CCArray::count(v52) > 9u )
{
v70 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 9u);
*(_BYTE *)(a1 + 484) = cocos2d::CCString::intValue(v70) != 0;
}
if ( cocos2d::CCArray::count(v52) > 0xAu )
{
v71 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v52, 0xAu);
*(_DWORD *)(a1 + 488) = cocos2d::CCString::intValue(v71);
}
}
if ( cocos2d::CCArray::count(v24) > 5u )
{
v72 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 5u);
v73 = (char *)cocos2d::CCString::getCString(v72);
std::string::assign((int *)(a1 + 492), v73);
}
*(_DWORD *)(a1 + 448) = 5;
*(_DWORD *)(a1 + 452) = 5;
*(_DWORD *)(a1 + 456) = 30;
*(_DWORD *)(a1 + 372) = 50;
if ( cocos2d::CCArray::count(v24) > 6u )
{
v74 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v24, 6u);
v75 = (const char *)cocos2d::CCString::getCString(v74);
v114 = 0;
v115 = 0;
v116 = 0;
v76 = strlen(v75);
std::string::__init(&v114, v75, v76);
v77 = sub_4C1A88(&v114, ",");
std::string::~string((int)&v114);
if ( cocos2d::CCArray::count(v77) > 2u )
{
v78 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v77, 0);
*(_DWORD *)(a1 + 448) = cocos2d::CCString::intValue(v78);
v79 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v77, 1u);
if ( (int)cocos2d::CCString::intValue(v79) <= 1 )
{
v81 = 1;
}
else
{
v80 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v77, 1u);
v81 = cocos2d::CCString::intValue(v80);
}
*(_DWORD *)(a1 + 452) = v81;
v82 = *(_DWORD *)(a1 + 448);
v83 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v77, 2u);
if ( v82 >= cocos2d::CCString::intValue(v83) )
{
v85 = *(_DWORD *)(a1 + 448);
}
else
{
v84 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v77, 2u);
v85 = cocos2d::CCString::intValue(v84);
}
*(_DWORD *)(a1 + 456) = v85;
}
if ( cocos2d::CCArray::count(v77) > 3u )
{
v86 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v77, 3u);
if ( (int)cocos2d::CCString::intValue(v86) <= 1 )
{
v88 = 1;
}
else
{
v87 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v77, 3u);
v88 = cocos2d::CCString::intValue(v87);
}
*(_DWORD *)(a1 + 372) = v88;
}
}
v89 = sub_4C81AC((char *)v99);
v90 = *(_DWORD *)(a1 + 840);
if ( v90 )
(*(void (__fastcall **)(int, const char *, cocos2d::CCArray *, bool))(*(_DWORD *)v90 + 8))(
v90,
v12,
v89,
v96 >= 1);
return std::string::~string((int)v99);
}
return result;
}