//
// sub_10000F854 from 0x10000f854 to 0x10000fa34 (480 bytes)
//
// 3 xrefs:
// > sub_10000F6D0 @ 0x10000f6f0
// > sub_100017780 @ 0x100017bec
// > sub_10014136C @ 0x100141500
//
// 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:57:15 +0000
//
_WORD *__fastcall sub_10000F854(_QWORD *a1)
{
_WORD *result; // x0
double v3; // d0
double v4; // d1
__int64 v5; // x8
__int64 v6; // x9
__int64 v7; // x11
__int64 v8; // x9
__int64 v9; // x24
__int64 v10; // x27
int v11; // w8
__int64 v12; // x22
int v13; // w8
unsigned int v14; // w9
__int64 v15; // x20
_WORD *v16; // x21
__int64 v17; // x8
_WORD *v18; // x23
int v19; // w9
_WORD *v20; // x8
__int64 v21; // x20
__int64 v22; // x1
result = (_WORD *)cocos2d::CCDictionary::count(a1[70]);
if ( (_DWORD)result )
{
v5 = a1[71];
if ( v5 )
{
v6 = *(_QWORD *)(v5 + 56);
while ( v6 )
{
v7 = *(_QWORD *)(v6 + 264);
v6 = *(_QWORD *)(v6 + 288);
if ( (*(_BYTE *)(v7 + 81) & 1) == 0 )
{
*(_QWORD *)(v7 + 64) = 0;
*(_WORD *)(v7 + 80) = 257;
}
}
}
v8 = a1[70];
if ( v8 )
{
v9 = *(_QWORD *)(v8 + 56);
if ( v9 )
{
LABEL_9:
while ( 2 )
{
v10 = *(_QWORD *)(v9 + 264);
v9 = *(_QWORD *)(v9 + 288);
*(_BYTE *)(v10 + 124) = 0;
*(_BYTE *)(v10 + 126) = 0;
v11 = *(_DWORD *)(v10 + 120) & ~(*(int *)(v10 + 120) >> 31);
if ( v11 >= 9999 )
v12 = 9999;
else
v12 = (unsigned int)v11;
v13 = *(_DWORD *)(v10 + 92);
if ( (unsigned int)v13 >= 0x270F )
v14 = 9999;
else
v14 = *(_DWORD *)(v10 + 92);
if ( v13 <= 0 )
v15 = 0;
else
v15 = v14;
v16 = *(_WORD **)(v10 + 152);
v17 = a1[72];
if ( !v16 )
{
v16 = *(_WORD **)(v17 + 8LL * (unsigned int)v15);
if ( !v16 )
{
v16 = sub_10000D6D0(v15, 0);
result = (_WORD *)cocos2d::CCDictionary::setObject_1(a1[71], v16, v15);
*(_QWORD *)(a1[72] + 8 * v15) = v16;
v17 = a1[72];
}
}
v18 = *(_WORD **)(v17 + 8LL * (unsigned int)v12);
if ( !v18 )
{
v18 = sub_10000D6D0(v12, 0);
result = (_WORD *)cocos2d::CCDictionary::setObject_1(a1[71], v18, v12);
*(_QWORD *)(a1[72] + 8 * v12) = v18;
}
*(_QWORD *)(v10 + 152) = v16;
*((_BYTE *)v16 + 81) = 0;
*((_BYTE *)v18 + 81) = 0;
*((_QWORD *)v16 + 9) = v10;
if ( !*((_QWORD *)v18 + 9) )
{
result = sub_10000F52C((__int64)a1, v12, v3, v4);
*((_QWORD *)v18 + 9) = result;
}
v19 = *((_DWORD *)v18 + 14);
v20 = v18;
while ( 1 )
{
if ( v19 == (_DWORD)v15 )
{
LABEL_29:
*(_BYTE *)(v10 + 126) = 1;
if ( v9 )
goto LABEL_9;
goto LABEL_35;
}
v20 = *((_WORD **)v20 + 8);
if ( !v20 )
break;
v19 = *((_DWORD *)v20 + 14);
if ( v19 == (_DWORD)v15 )
goto LABEL_29;
}
if ( *((_QWORD *)v16 + 8) )
{
if ( v9 )
continue;
}
else
{
*((_QWORD *)v16 + 8) = v18;
*((_BYTE *)v18 + 80) = 0;
if ( v9 )
continue;
}
break;
}
LABEL_35:
v5 = a1[71];
}
}
if ( v5 )
{
v21 = *(_QWORD *)(v5 + 56);
while ( v21 )
{
v22 = *(_QWORD *)(v21 + 264);
v21 = *(_QWORD *)(v21 + 288);
if ( (*(_BYTE *)(v22 + 81) & 1) == 0 && *(_BYTE *)(v22 + 80) == 1 )
result = (_WORD *)sub_10000FB80(a1);
}
}
}
return result;
}