//
// sub_1005B8CAC from 0x1005b8cac to 0x1005b8de4 (312 bytes)
//
// 2 xrefs:
// > ??> @ 0x100838928
// > ??> @ 0x100838a58
//
// 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_1005B8CAC(__int64 a1, __int64 a2, __int64 a3, __int64 a4, void **a5)
{
void **v9; // x21
__int64 v10; // x19
if ( a2 && !sub_1005AAFFC(a2, a1 + 104) )
return 0;
if ( !(a3 | a4) )
goto LABEL_12;
if ( !*(_QWORD *)(*(_QWORD *)a1 + 288LL) )
{
if ( a3 && !sub_1005AAFFC(a3, a1 + 152) )
return 0;
if ( a4 && !sub_1005AAFFC(a4, a1 + 176) )
return 0;
LABEL_12:
v9 = nullptr;
goto LABEL_13;
}
if ( a5 )
{
v9 = nullptr;
}
else
{
a5 = (void **)sub_1005ABAC8();
v9 = a5;
if ( !a5 )
return 0;
}
if ( !a3
|| (*(unsigned int (__fastcall **)(__int64, __int64, __int64, void **))(*(_QWORD *)a1 + 288LL))(
a1,
a3,
a1 + 152,
a5) )
{
if ( a4
&& !(*(unsigned int (__fastcall **)(__int64, __int64, __int64, void **))(*(_QWORD *)a1 + 288LL))(
a1,
a4,
a1 + 176,
a5) )
{
v10 = 0;
goto LABEL_14;
}
LABEL_13:
v10 = 1;
goto LABEL_14;
}
v10 = 0;
LABEL_14:
if ( v9 )
sub_1005ABB2C(v9);
return v10;
}