//
// sub_1005B55E4 from 0x1005b55e4 to 0x1005b569c (184 bytes)
//
// 1 xrefs:
// > sub_1005C5060 @ 0x1005c51dc
//
// 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_1005B55E4(__int64 a1, __int64 *a2, int *a3, __int64 *a4)
{
_QWORD *v8; // x0
__int64 v9; // x23
__int64 v10; // x20
if ( *a3 )
{
sub_1005ABC90((__int64)a4);
v8 = sub_1005ABDFC(a4);
v9 = (__int64)v8;
if ( v8 )
{
if ( (unsigned int)sub_1005AB508((__int64)v8, *a3 - 1) )
v10 = sub_1005B5478(a1, a2, v9, a3, a4);
else
v10 = 0;
}
else
{
v10 = 0;
}
sub_1005ABD78((__int64)a4);
}
else
{
sub_1005AB128(a1, 0);
return 1;
}
return v10;
}