//
// sub_10009A878 from 0x10009a878 to 0x10009acc0 (1096 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x100094164
//
// 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:28 +0000
//
__int64 __fastcall sub_10009A878(__int64 a1, char *a2, char *__s)
{
char *v3; // x20
bool v6; // w21
int v7; // w28
_BOOL4 v8; // w21
int v9; // w24
bool v10; // w21
_BOOL4 v11; // w0
_BOOL4 v12; // w22
__int64 result; // x0
__int64 (*v14)(void); // x8
const char *v15; // x0
__int64 v16; // x0
__int64 v17; // x22
__int64 v18; // x23
__int64 v19; // x24
__int64 v20; // x0
char *CString; // x0
__int64 v22; // x0
__int64 v23; // x25
int v24; // w8
int v25; // w26
int v26; // w27
__int64 v27; // x23
unsigned int v28; // [xsp+8h] [xbp-C8h]
int v29; // [xsp+Ch] [xbp-C4h]
void *v30[2]; // [xsp+10h] [xbp-C0h] BYREF
__int64 v31; // [xsp+20h] [xbp-B0h]
void *__dst[2]; // [xsp+30h] [xbp-A0h] BYREF
__int64 v33; // [xsp+40h] [xbp-90h]
void *__p[2]; // [xsp+50h] [xbp-80h] BYREF
char v35; // [xsp+67h] [xbp-69h]
void *v36[2]; // [xsp+68h] [xbp-68h] BYREF
__int64 v37; // [xsp+78h] [xbp-58h]
v3 = __s;
if ( __s[23] < 0 )
v3 = *(char **)__s;
sub_100009900(v36, v3);
sub_100009900(__p, "get_friends");
v6 = sub_1000045BC(v36, __p);
if ( v35 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v37) < 0 )
{
operator delete(v36[0]);
if ( v6 )
goto LABEL_7;
}
else if ( v6 )
{
LABEL_7:
v7 = 0;
v8 = 0;
v29 = 0;
v9 = 0;
goto LABEL_22;
}
sub_100009900(v36, v3);
sub_100009900(__p, "get_following");
v10 = sub_1000045BC(v36, __p);
if ( v35 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v37) < 0 )
{
operator delete(v36[0]);
if ( v10 )
goto LABEL_13;
}
else if ( v10 )
{
LABEL_13:
v7 = 0;
v29 = 0;
v9 = 3;
v8 = 1;
goto LABEL_22;
}
sub_100009900(v36, v3);
sub_100009900(__p, "get_muted");
v8 = sub_1000045BC(v36, __p);
if ( v35 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v37) < 0 )
{
operator delete(v36[0]);
if ( v8 )
goto LABEL_19;
}
else if ( v8 )
{
LABEL_19:
v7 = 0;
v8 = 0;
v9 = 4;
v29 = 1;
goto LABEL_22;
}
v29 = 0;
v7 = 1;
v9 = 1;
LABEL_22:
sub_1000ADC9C(a1, v3);
sub_100009900(v36, "-1");
v11 = sub_1000045BC(a2, v36);
v12 = v11;
if ( SHIBYTE(v37) < 0 )
{
operator delete(v36[0]);
if ( v12 )
goto LABEL_24;
}
else if ( v11 )
{
LABEL_24:
result = *(_QWORD *)(a1 + 1368);
if ( !result )
return result;
v14 = *(__int64 (**)(void))(*(_QWORD *)result + 8LL);
return v14();
}
v15 = a2;
if ( a2[23] < 0 )
v15 = *(const char **)a2;
v16 = atoi(v15);
if ( (v16 & 0x80000000) != 0 )
{
result = *(_QWORD *)(a1 + 1368);
if ( !result )
return result;
v14 = *(__int64 (**)(void))(*(_QWORD *)result + 8LL);
return v14();
}
v17 = sub_1002E736C(v16);
if ( a2[23] < 0 )
a2 = *(char **)a2;
v28 = v9;
sub_100009900(v36, a2);
v18 = sub_1000A72B8(v36, "|");
if ( SHIBYTE(v37) < 0 )
operator delete(v36[0]);
if ( (unsigned int)sub_1002E757C(v18) )
{
v19 = 0;
do
{
v20 = sub_1002E75A0(v18, v19);
CString = (char *)cocos2d::CCString::getCString(v20);
sub_100009900(v36, CString);
if ( SHIBYTE(v37) < 0 )
{
sub_1000097D0(__dst, v36[0], (unsigned __int64)v36[1]);
}
else
{
*(_OWORD *)__dst = *(_OWORD *)v36;
v33 = v37;
}
v22 = sub_1000A8FB4(__dst, 0);
v23 = GJUserScore::create(v22);
if ( SHIBYTE(v33) < 0 )
{
operator delete(__dst[0]);
if ( v7 )
{
LABEL_41:
v24 = 2;
goto LABEL_42;
}
}
else if ( v7 )
{
goto LABEL_41;
}
if ( v8 )
{
*(_BYTE *)(v23 + 720) = 1;
goto LABEL_48;
}
if ( v29 )
{
*(_BYTE *)(v23 + 723) = 1;
goto LABEL_48;
}
v24 = 1;
LABEL_42:
*(_DWORD *)(v23 + 688) = v24;
LABEL_48:
if ( *(int *)(v23 + 376) >= 1 && *(int *)(v23 + 372) >= 1 )
{
sub_1002E74E0(v17, v23);
v25 = *(_DWORD *)(v23 + 372);
v26 = *(_DWORD *)(v23 + 376);
if ( *(char *)(v23 + 343) < 0 )
{
sub_1000097D0(v30, *(void **)(v23 + 320), *(_QWORD *)(v23 + 328));
}
else
{
*(_OWORD *)v30 = *(_OWORD *)(v23 + 320);
v31 = *(_QWORD *)(v23 + 336);
}
GameLevelManager::storeUserName(a1, v25, v26, (char *)v30);
if ( SHIBYTE(v31) < 0 )
operator delete(v30[0]);
}
if ( SHIBYTE(v37) < 0 )
operator delete(v36[0]);
v19 = (unsigned int)(v19 + 1);
}
while ( (unsigned int)v19 < (unsigned int)sub_1002E757C(v18) );
}
if ( (unsigned int)sub_1002E757C(v17) )
{
v27 = *(_QWORD *)(a1 + 1040);
sub_100009900(v36, v3);
cocos2d::CCDictionary::setObject(v27, v17, v36);
if ( SHIBYTE(v37) < 0 )
operator delete(v36[0]);
result = *(_QWORD *)(a1 + 1368);
if ( result )
return (**(__int64 (__fastcall ***)(__int64, __int64, _QWORD))result)(result, v17, v28);
}
else
{
result = *(_QWORD *)(a1 + 1368);
if ( result )
{
v14 = *(__int64 (**)(void))(*(_QWORD *)result + 8LL);
return v14();
}
}
return result;
}