//
// sub_100007020 from 0x100007020 to 0x1000070e8 (200 bytes)
//
// 3 xrefs:
// > sub_10000608C @ 0x100006164
// > sub_10007B234 @ 0x10007b444
// > sub_10007C0E4 @ 0x10007c140
//
// 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:11 +0000
//
__int64 __fastcall sub_100007020(__int64 a1, __int64 a2)
{
__int64 v3; // x0
__int64 v4; // x19
__int64 result; // x0
unsigned int *v6; // x8
__int64 v7; // x9
unsigned __int64 v8; // x8
unsigned __int64 v9; // x9
void *__p[2]; // [xsp+0h] [xbp-30h] BYREF
__int64 v11; // [xsp+10h] [xbp-20h]
if ( *(char *)(a2 + 23) < 0 )
{
sub_1000097D0(__p, *(void **)a2);
}
else
{
*(_OWORD *)__p = *(_OWORD *)a2;
v11 = *(_QWORD *)(a2 + 16);
}
v3 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 56), __p);
v4 = v3;
if ( SHIBYTE(v11) < 0 )
{
operator delete(__p[0]);
if ( !v4 )
return 0;
}
else if ( !v3 )
{
return 0;
}
result = sub_1002E757C(v4);
if ( !(_DWORD)result )
return result;
v6 = *(unsigned int **)(v4 + 56);
v7 = *v6;
if ( !(_DWORD)v7 )
return 0;
result = 0;
v8 = *((_QWORD *)v6 + 2);
v9 = v8 + 8 * v7 - 8;
do
{
if ( !*(_QWORD *)v8 )
break;
result = (unsigned int)(*(_DWORD *)(*(_QWORD *)v8 + 108LL) + result);
v8 += 8LL;
}
while ( v8 <= v9 );
return result;
}