//
// sub_1007474F0 from 0x1007474f0 to 0x100747553 (99 bytes)
//
// 1 xrefs:
// > sub_1007FF1D0 @ 0x1007ff1d9
//
// This function is hookable on this platform (idp: pc, 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 12:36:31 +0000
//
__int64 __fastcall sub_1007474F0(unsigned int *a1, __int64 a2)
{
unsigned int v2; // ecx
__int64 v3; // rdx
__int64 v4; // rbx
unsigned int v5; // ecx
__int64 result; // rax
v2 = *a1;
if ( *a1 )
{
v3 = *((_QWORD *)a1 + 2);
v4 = 0;
while ( *(_QWORD *)(v3 + 8 * v4) != a2 )
{
if ( v2 == (_DWORD)++v4 )
return result;
}
if ( (_DWORD)v4 != -1 )
{
if ( *(_QWORD *)(v3 + 8 * v4) )
{
cocos2d::CCObject::release(*(_DWORD **)(v3 + 8 * v4));
v3 = *((_QWORD *)a1 + 2);
v2 = *a1;
}
v5 = v2 - 1;
*a1 = v5;
result = *(_QWORD *)(v3 + 8LL * v5);
*(_QWORD *)(v3 + 8 * v4) = result;
}
}
return result;
}