//
// sub_1005F3CAC from 0x1005f3cac to 0x1005f3d90 (228 bytes)
//
// 3 xrefs:
// > sub_1005FC89C @ 0x1005fcb9c
// > sub_1005FC89C @ 0x1005fca28
// > sub_1005FE87C @ 0x1005fe88c
//
// 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_1005F3CAC(_QWORD *a1, __int64 *a2, __int64 a3)
{
_BOOL4 v6; // w23
__int64 v7; // x0
__int64 v8; // x21
__int64 v9; // x8
__int64 v11; // [xsp+8h] [xbp-38h] BYREF
v11 = *a2;
v6 = !a1 || !*a1;
v7 = sub_1005F6E34(a1, &v11, a3, &unk_10083E988);
v8 = v7;
if ( !v7 )
return 0;
v9 = v11;
if ( *a2 - v11 + a3 < 1 )
goto LABEL_9;
if ( sub_1005F3E84(v7 + 176, &v11) )
{
v9 = v11;
LABEL_9:
*a2 = v9;
return v8;
}
if ( !v6 )
return 0;
sub_1005F5B94(v8, &unk_10083E988);
v8 = 0;
if ( a1 )
*a1 = 0;
return v8;
}