//
// sub_1004C5D60 from 0x1004c5d60 to 0x1004c5df0 (144 bytes)
//
// 4 xrefs:
// > ??> @ 0x100828690
// > ??> @ 0x100828838
// > ??> @ 0x1008289e0
// > ??> @ 0x100828b70
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_1004C5D60(__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;
}