//
// sub_1005BAAD4 from 0x1005baad4 to 0x1005babf8 (292 bytes)
//
// 2 xrefs:
// > ??> @ 0x1008389d0
// > ??> @ 0x100838b00
//
// 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_1005BAAD4(__int64 a1, __int64 a2, __int64 *a3)
{
__int64 v6; // x21
void **v7; // x20
if ( *(_DWORD *)(a2 + 80) )
return 1;
if ( (unsigned int)sub_1005B872C(a1, (_QWORD *)a2) )
return 1;
if ( a3 )
{
v7 = nullptr;
}
else
{
v7 = (void **)sub_1005ABAC8();
a3 = (__int64 *)v7;
if ( !v7 )
return 0;
}
sub_1005ABC90((__int64)a3);
sub_1005ABDFC(a3);
if ( sub_1005ABDFC(a3)
&& (unsigned int)sub_1005B84EC(a1, (_QWORD *)a2)
&& (unsigned int)sub_1005B8414(a1, (_QWORD *)a2) )
{
if ( *(_DWORD *)(a2 + 80) )
{
v6 = 1;
goto LABEL_16;
}
sub_1005E0E48(16, 102, 68, "ecp_smpl.c", 1236);
}
v6 = 0;
LABEL_16:
sub_1005ABD78((__int64)a3);
if ( v7 )
sub_1005ABB2C(v7);
return v6;
}