//
// sub_1005F6ABC from 0x1005f6abc to 0x1005f6bdc (288 bytes)
//
// 1 xrefs:
// > sub_1005F623C @ 0x1005f64cc
//
// 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_1005F6ABC(int a1, void **a2, __int64 a3, int a4, __int64 a5)
{
__int64 v6; // x25
unsigned int v9; // w0
__int64 v10; // x19
_BOOL4 v12; // w26
__int64 v13; // x24
unsigned int v15; // [xsp+Ch] [xbp-44h]
LODWORD(v6) = a4;
v15 = *(_QWORD *)(a3 + 8);
v9 = sub_1005F6BDC(a1, nullptr);
v10 = 0;
v12 = v15 + 3 > 0x14 || ((1 << (v15 + 3)) & 0x180001) == 0;
if ( v9 != -1 )
{
if ( v9 == -2 )
v10 = 0;
else
v10 = v9;
if ( v9 == -2 )
v13 = 2;
else
v13 = 0;
if ( (_DWORD)v6 == -1 )
v6 = v15;
else
v6 = (unsigned int)v6;
if ( a2 )
{
if ( v12 )
sub_1005FB508(a2, v13, v10, v6, a5);
sub_1005F6BDC(a1, *a2);
if ( (_DWORD)v13 )
sub_1005FB634(a2);
else
*a2 = (char *)*a2 + (int)v10;
}
if ( v12 )
return sub_1005FB650(v13, v10, v6);
}
return v10;
}