//
// sub_1005F2A68 from 0x1005f2a68 to 0x1005f2b0c (164 bytes)
//
// 3 xrefs:
// > sub_1005CAAB4 @ 0x1005cae34
// > sub_1005CB7FC @ 0x1005cb93c
// > sub_1005CB9A0 @ 0x1005cba08
//
// 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
//
char **__fastcall sub_1005F2A68(__int64 a1, __int64 a2)
{
__int64 v3; // x22
int v4; // w20
unsigned int v5; // w0
char **result; // x0
char **v7; // x21
__int64 v8; // x22
v3 = *(_QWORD *)(a2 + 16);
if ( (v3 & 8) != 0 )
v4 = -1;
else
v4 = 5;
v5 = sub_1005EB2A0((unsigned int *)a2);
result = sub_10058AB9C(v5);
v7 = result;
if ( a1 )
{
v8 = v3 & 8;
if ( v8 || *(_QWORD *)(a1 + 8) || (result = (char **)sub_1005F8F80(), (*(_QWORD *)(a1 + 8) = result) != 0) )
{
if ( *(_QWORD *)a1 )
sub_1005EE6D8(*(_DWORD **)a1);
*(_QWORD *)a1 = v7;
result = *(char ***)(a1 + 8);
if ( v8 )
{
if ( result )
{
result = (char **)sub_1005F8F8C(result);
*(_QWORD *)(a1 + 8) = 0;
}
}
else
{
return (char **)sub_1005F0350((__int64)result, v4, 0);
}
}
}
return result;
}