//
// sub_1008ED0E0 from 0x1008ed0e0 to 0x1008ed194 (180 bytes)
//
// 1 xrefs:
// > sub_1008F6E60 @ 0x1008f7038
//
// 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:37:54 +0000
//
__int64 __fastcall sub_1008ED0E0(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v4; // rdi
void *v5; // rax
unsigned int v6; // r15d
__int64 v7; // rax
if ( a2 )
{
v4 = *(_QWORD *)(a1 + 144);
if ( !v4 )
{
v5 = sub_1007FE900();
*(_QWORD *)(a1 + 144) = v5;
cocos2d::CCObject::retain((__int64)v5);
v4 = *(_QWORD *)(a1 + 144);
}
if ( (unsigned int)sub_1007FEF90(v4) )
{
v6 = 0;
while ( 1 )
{
v7 = sub_1007FEFE0(*(_QWORD *)(a1 + 144), v6);
if ( v7 )
{
if ( *(_DWORD *)(v7 + 316) == *(_DWORD *)(a2 + 316) )
break;
}
if ( ++v6 >= (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 144)) )
return sub_1007FEBF0(*(_QWORD *)(a1 + 144), a2);
}
sub_1007FF150(*(_QWORD *)(a1 + 144), v6, 1);
}
return sub_1007FEBF0(*(_QWORD *)(a1 + 144), a2);
}
return result;
}