//
// sub_1005EBEC8 from 0x1005ebec8 to 0x1005ebf58 (144 bytes)
//
// 4 xrefs:
// > ??> @ 0x1009abd00
// > ??> @ 0x1009abea8
// > ??> @ 0x1009ac050
// > ??> @ 0x1009ac1e0
//
// 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 11:09:45 +0000
//
__int64 __fastcall sub_1005EBEC8(__int64 a1, _DWORD *a2)
{
__int64 v2; // x8
_DWORD *v3; // x8
__int64 **v5; // x9
__int64 *v6; // x8
__int64 *v7; // x9
int v8; // w10
if ( !a2 )
return 31;
if ( !*(_QWORD *)(a1 + 168) )
{
v3 = (_DWORD *)(a1 + 228);
goto LABEL_7;
}
v2 = *(_QWORD *)(a1 + 232);
if ( v2 )
{
v3 = (_DWORD *)(v2 + 4LL * *(int *)(a1 + 192));
LABEL_7:
*a2 = *v3;
return 0;
}
*a2 = 0;
v5 = *(__int64 ***)(a1 + 240);
if ( v5 )
{
v6 = *(__int64 **)(a1 + 248);
v7 = *v5;
if ( v7 != v6 )
{
v8 = 0;
do
{
if ( *(_DWORD *)(a1 + 192) == *((unsigned __int16 *)v7 + 24) )
*a2 = ++v8;
v7 = (__int64 *)*v7;
}
while ( v7 != v6 );
}
}
return 0;
}