//
// sub_1000A4A5C from 0x1000a4a5c to 0x1000a4fb0 (1364 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x1000926d8
//
// 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 10:58:33 +0000
//
__int64 __fastcall sub_1000A4A5C(__int64 a1, __int64 *a2, char *__s)
{
__int64 v5; // x20
_BOOL8 v6; // x0
_BOOL4 v7; // w20
__int64 result; // x0
__int64 v9; // x20
_QWORD *v10; // x0
__int64 v11; // x21
__int64 v12; // x22
__int64 v13; // x0
char *CString; // x0
_QWORD *v15; // x0
__int64 v16; // x24
__int64 v17; // x25
__int64 v18; // x0
__int64 v19; // x0
__int64 v20; // x0
char *v21; // x0
__int64 v22; // x0
char *v23; // x0
__int64 v24; // x0
__int64 v25; // x0
const std::string::value_type *v26; // x0
__int64 v27; // x0
const std::string::value_type *v28; // x0
__int64 v29; // x0
char *v30; // x0
__int64 v31; // x0
char *v32; // x0
__int64 v33; // x0
__int64 v34; // x0
__int64 v35; // x0
__int64 v36; // x0
__int64 v37; // x0
__int64 v38; // x0
__int64 v39; // x0
__int64 v40; // x0
__int64 v41; // x0
const std::string::value_type *v42; // x0
__int64 v43; // x0
const char *v44; // x0
__int64 v45; // x21
int v46; // w22
void *v47[2]; // [xsp+8h] [xbp-B8h] BYREF
char v48; // [xsp+1Fh] [xbp-A1h]
void *v49[2]; // [xsp+20h] [xbp-A0h] BYREF
char v50; // [xsp+37h] [xbp-89h]
void *v51[2]; // [xsp+38h] [xbp-88h] BYREF
char v52; // [xsp+4Fh] [xbp-71h]
void *__p[2]; // [xsp+50h] [xbp-70h] BYREF
char v54; // [xsp+67h] [xbp-59h]
char __sa[16]; // [xsp+68h] [xbp-58h] BYREF
__int64 v56; // [xsp+78h] [xbp-48h]
v5 = *(_QWORD *)(a1 + 1088);
if ( __s[23] < 0 )
__s = *(char **)__s;
sub_100009900(__sa, __s);
cocos2d::CCDictionary::removeObjectForKey(v5, __sa);
if ( SHIBYTE(v56) < 0 )
operator delete(*(void **)__sa);
sub_100009900(__sa, "-1");
v6 = sub_1000045BC(a2, __sa);
v7 = v6;
if ( SHIBYTE(v56) < 0 )
{
operator delete(*(void **)__sa);
if ( v7 )
{
LABEL_7:
result = *(_QWORD *)(a1 + 1264);
if ( result )
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)result + 104LL))(result);
return result;
}
}
else if ( v6 )
{
goto LABEL_7;
}
v9 = sub_1002E736C(v6);
if ( (*((char *)a2 + 23) & 0x80000000) == 0 )
{
if ( !*((_BYTE *)a2 + 23) )
goto LABEL_52;
LABEL_15:
v10 = sub_100009900(__sa, (char *)a2);
v11 = sub_1000A72B8(v10, "|");
if ( SHIBYTE(v56) < 0 )
operator delete(*(void **)__sa);
if ( (unsigned int)sub_1002E757C(v11) )
{
v12 = 0;
do
{
v13 = cocos2d::CCArray::stringAtIndex(v11, v12);
CString = (char *)cocos2d::CCString::getCString(v13);
v15 = sub_100009900(__sa, CString);
v16 = sub_1000A72B8(v15, ":");
if ( SHIBYTE(v56) < 0 )
operator delete(*(void **)__sa);
if ( (unsigned int)sub_1002E757C(v16) >= 6 )
{
v17 = sub_1000C5868();
v18 = cocos2d::CCArray::stringAtIndex(v16, 0);
*(_DWORD *)(v17 + 56) = cocos2d::CCString::intValue(v18);
v19 = cocos2d::CCArray::stringAtIndex(v16, 1);
*(_DWORD *)(v17 + 60) = cocos2d::CCString::intValue(v19);
v20 = cocos2d::CCArray::stringAtIndex(v16, 2);
v21 = (char *)cocos2d::CCString::getCString(v20);
sub_100009900(__p, v21);
LevelTools::base64DecodeString(__sa, __p);
if ( *(char *)(v17 + 87) < 0 )
operator delete(*(void **)(v17 + 64));
*(_OWORD *)(v17 + 64) = *(_OWORD *)__sa;
*(_QWORD *)(v17 + 80) = v56;
HIBYTE(v56) = 0;
__sa[0] = 0;
if ( v54 < 0 )
operator delete(__p[0]);
v22 = cocos2d::CCArray::stringAtIndex(v16, 3);
v23 = (char *)cocos2d::CCString::getCString(v22);
sub_100009900(v51, v23);
LevelTools::base64DecodeString(__sa, v51);
if ( *(char *)(v17 + 111) < 0 )
operator delete(*(void **)(v17 + 88));
*(_OWORD *)(v17 + 88) = *(_OWORD *)__sa;
*(_QWORD *)(v17 + 104) = v56;
HIBYTE(v56) = 0;
__sa[0] = 0;
if ( v52 < 0 )
operator delete(v51[0]);
v24 = cocos2d::CCArray::stringAtIndex(v16, 4);
*(_DWORD *)(v17 + 168) = cocos2d::CCString::intValue(v24);
v25 = cocos2d::CCArray::stringAtIndex(v16, 5);
v26 = (const std::string::value_type *)cocos2d::CCString::getCString(v25);
std::string::assign((std::string *)(v17 + 144), v26);
if ( (unsigned int)sub_1002E757C(v16) >= 7 )
{
v27 = cocos2d::CCArray::stringAtIndex(v16, 6);
v28 = (const std::string::value_type *)cocos2d::CCString::getCString(v27);
std::string::assign((std::string *)(v17 + 176), v28);
}
if ( (unsigned int)sub_1002E757C(v16) >= 8 )
{
v29 = cocos2d::CCArray::stringAtIndex(v16, 7);
v30 = (char *)cocos2d::CCString::getCString(v29);
sub_100009900(v49, v30);
LevelTools::base64DecodeString(__sa, v49);
if ( *(char *)(v17 + 143) < 0 )
operator delete(*(void **)(v17 + 120));
*(_OWORD *)(v17 + 120) = *(_OWORD *)__sa;
*(_QWORD *)(v17 + 136) = v56;
HIBYTE(v56) = 0;
__sa[0] = 0;
if ( v50 < 0 )
operator delete(v49[0]);
}
if ( (unsigned int)sub_1002E757C(v16) >= 9 )
{
v31 = cocos2d::CCArray::stringAtIndex(v16, 8);
v32 = (char *)cocos2d::CCString::getCString(v31);
sub_100009900(v47, v32);
LevelTools::base64DecodeString(__sa, v47);
if ( *(char *)(v17 + 239) < 0 )
operator delete(*(void **)(v17 + 216));
*(_OWORD *)(v17 + 216) = *(_OWORD *)__sa;
*(_QWORD *)(v17 + 232) = v56;
HIBYTE(v56) = 0;
__sa[0] = 0;
if ( v48 < 0 )
operator delete(v47[0]);
}
if ( (unsigned int)sub_1002E757C(v16) >= 0xB )
{
v33 = cocos2d::CCArray::stringAtIndex(v16, 9);
*(_BYTE *)(v17 + 264) = (unsigned int)cocos2d::CCString::intValue(v33) != 0;
v34 = cocos2d::CCArray::stringAtIndex(v16, 10);
*(_BYTE *)(v17 + 273) = (unsigned int)cocos2d::CCString::intValue(v34) != 0;
}
if ( (unsigned int)sub_1002E757C(v16) >= 0x11 )
{
*(_BYTE *)(v17 + 305) = 1;
v35 = cocos2d::CCArray::stringAtIndex(v16, 11);
*(_DWORD *)(v17 + 308) = cocos2d::CCString::intValue(v35);
v36 = cocos2d::CCArray::stringAtIndex(v16, 12);
*(_DWORD *)(v17 + 312) = cocos2d::CCString::intValue(v36);
v37 = cocos2d::CCArray::stringAtIndex(v16, 13);
*(_DWORD *)(v17 + 316) = cocos2d::CCString::intValue(v37);
v38 = cocos2d::CCArray::stringAtIndex(v16, 14);
*(_DWORD *)(v17 + 320) = cocos2d::CCString::intValue(v38);
v39 = cocos2d::CCArray::stringAtIndex(v16, 15);
*(_DWORD *)(v17 + 324) = cocos2d::CCString::intValue(v39);
v40 = cocos2d::CCArray::stringAtIndex(v16, 16);
*(_DWORD *)(v17 + 328) = cocos2d::CCString::intValue(v40);
}
if ( (unsigned int)sub_1002E757C(v16) >= 0x12 )
{
v41 = cocos2d::CCArray::stringAtIndex(v16, 17);
v42 = (const std::string::value_type *)cocos2d::CCString::getCString(v41);
std::string::assign((std::string *)(v17 + 240), v42);
}
if ( (unsigned int)sub_1002E757C(v16) >= 0x13 )
{
v43 = cocos2d::CCArray::stringAtIndex(v16, 18);
v44 = (const char *)cocos2d::CCString::getCString(v43);
*(_QWORD *)(v17 + 296) = atoll(v44);
}
sub_1002E74E0(v9, v17);
}
v12 = (unsigned int)(v12 + 1);
}
while ( (unsigned int)v12 < (unsigned int)sub_1002E757C(v11) );
}
goto LABEL_52;
}
if ( a2[1] )
{
a2 = (__int64 *)*a2;
goto LABEL_15;
}
LABEL_52:
if ( (unsigned int)sub_1002E757C(v9) )
{
v45 = 0;
v46 = 0;
do
{
v46 += *(unsigned __int8 *)(sub_1002E75A0(v9, v45) + 273) ^ 1;
v45 = (unsigned int)(v45 + 1);
}
while ( (unsigned int)v45 < (unsigned int)sub_1002E757C(v9) );
}
else
{
v46 = 0;
}
*(_DWORD *)(a1 + 476) = v46;
result = *(_QWORD *)(a1 + 1264);
if ( result )
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)result + 96LL))(result, v9);
return result;
}