//
// sub_1005FC318 from 0x1005fc318 to 0x1005fc3f4 (220 bytes)
//
// 3 xrefs:
// > sub_1005CAAB4 @ 0x1005caeb0
// > sub_1005CB7FC @ 0x1005cb960
// > sub_1005CB9A0 @ 0x1005cba1c
//
// 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
//
_QWORD *__fastcall sub_1005FC318(__int64 a1, __int64 a2, _QWORD *a3)
{
_QWORD *v6; // x19
_QWORD *v7; // x0
void *v8; // x0
_QWORD *v9; // x22
int v10; // w0
__int16 v11; // w2
int v12; // w4
if ( !a3 || (v6 = (_QWORD *)*a3) == nullptr )
{
v7 = sub_1005FBA1C();
v6 = v7;
if ( !v7 )
{
v11 = 65;
v12 = 172;
goto LABEL_13;
}
if ( a3 )
*a3 = v7;
}
v9 = v6 + 1;
v8 = (void *)v6[1];
if ( v8 )
{
sub_100588C44(v8);
*v9 = 0;
}
v10 = sub_1005F6170(a1, v6 + 1, a2);
*(_DWORD *)v6 = v10;
if ( !v10 )
{
v11 = 112;
v12 = 186;
goto LABEL_13;
}
if ( !*v9 )
{
v11 = 65;
v12 = 190;
LABEL_13:
sub_1005E0E48(13, 198, v11, (__int64)"asn_pack.c", v12);
return nullptr;
}
return v6;
}