//
// sub_1004BC49C from 0x1004bc49c to 0x1004bc4fc (96 bytes)
//
// 3 xrefs:
// > sub_1004BD248 @ 0x1004bd2e4
// > sub_1004D0C58 @ 0x1004d0cb0
// > sub_1004D1090 @ 0x1004d1100
//
// 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_1004BC49C(__int64 a1, int a2, _DWORD *a3)
{
_QWORD *v3; // x9
int v4; // w10
__int64 v5; // x11
if ( !a3 )
return 31;
v3 = *(_QWORD **)(a1 + 320);
if ( v3 == (_QWORD *)(a1 + 320) )
return 31;
v4 = 0;
while ( 1 )
{
v5 = v3[2];
if ( *(_DWORD *)(v5 + 24) != 1010 )
break;
LABEL_4:
v3 = (_QWORD *)*v3;
if ( v3 == (_QWORD *)(a1 + 320) )
return 31;
}
if ( v4 != a2 )
{
++v4;
goto LABEL_4;
}
*a3 = *(_DWORD *)(v5 + 20);
return 0;
}