//
// sub_1005F4A40 from 0x1005f4a40 to 0x1005f4b88 (328 bytes)
//
// 1 xrefs:
// > sub_10060425C @ 0x10060426c
//
// 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
//
_BYTE *__fastcall sub_1005F4A40(_BYTE **a1, __int64 *a2, __int64 a3)
{
unsigned int *v6; // x22
int v7; // w23
__int64 v8; // x23
_BYTE *v9; // x21
__int64 v11; // [xsp+8h] [xbp-38h] BYREF
v11 = *a2;
v6 = (unsigned int *)sub_1005F8F98(0, &v11, a3);
v11 = *a2;
if ( (unsigned int)sub_1005DEA4C(v6) == 6 )
{
v7 = 116;
LABEL_11:
sub_1005DE9D0(v6, (void (*)(void))sub_1005F8F8C);
return sub_1005F48CC(v7, a1, a2, a3);
}
if ( (unsigned int)sub_1005DEA4C(v6) == 4 )
{
v7 = 408;
goto LABEL_11;
}
if ( (unsigned int)sub_1005DEA4C(v6) != 3 )
{
v7 = 6;
goto LABEL_11;
}
v8 = sub_1005FC4A4(0, &v11, a3);
sub_1005DE9D0(v6, (void (*)(void))sub_1005F8F8C);
if ( v8 )
{
v9 = sub_1005EB334(v8);
sub_1005FC4B0(v8);
if ( v9 )
{
*a2 = v11;
if ( a1 )
*a1 = v9;
}
else
{
return nullptr;
}
}
else
{
sub_1005E0E48(13, 207, 167, (__int64)"d2i_pr.c", 159);
return nullptr;
}
return v9;
}