//
// sub_1005B2FF8 from 0x1005b2ff8 to 0x1005b30bc (196 bytes)
//
// 5 xrefs:
// > sub_1005A9D24 @ 0x1005a9f20
// > sub_1005A9D24 @ 0x1005a9f6c
// > sub_1005A9D24 @ 0x1005aa00c
// > sub_1005A9D24 @ 0x1005aa0bc
// > sub_1005A9D24 @ 0x1005aa0ec
//
// 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_1005B2FF8(__int64 a1, __int64 *a2, __int64 *a3, __int64 a4, __int64 *a5)
{
__int64 *v10; // x0
__int64 *v11; // x22
__int64 v12; // x20
sub_1005ABC90((__int64)a5);
v10 = sub_1005ABDFC(a5);
v11 = v10;
if ( !v10 )
goto LABEL_9;
if ( a3 )
{
if ( a2 == a3 )
{
if ( !(unsigned int)sub_1005B12FC((__int64)v10, a3, a5) )
{
LABEL_9:
v12 = 0;
goto LABEL_10;
}
}
else if ( !(unsigned int)sub_1005ACD2C((__int64)v10, a2, a3, a5) )
{
goto LABEL_9;
}
}
else
{
v11 = a2;
}
v12 = sub_1005B30BC(0, a1, v11, a4, a5);
LABEL_10:
sub_1005ABD78((__int64)a5);
return v12;
}