//
// sub_1005F6078 from 0x1005f6078 to 0x1005f6170 (248 bytes)
//
// 3 xrefs:
// > sub_1005F0350 @ 0x1005f037c
// > sub_1005F5BBC @ 0x1005f5df4
// > sub_1005F6078 @ 0x1005f6104
//
// 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
//
void __fastcall sub_1005F6078(void **a1, __int64 a2)
{
void **v2; // x19
__int64 v3; // x8
void (__fastcall *v4)(void **); // x2
int v5; // w8
v2 = a1;
if ( a2 )
{
v3 = *(_QWORD *)(a2 + 32);
if ( v3 )
{
v4 = *(void (__fastcall **)(void **))(v3 + 24);
if ( v4 )
{
v4(a1);
return;
}
}
if ( *(_BYTE *)a2 == 5 )
{
if ( !*a1 )
return;
goto LABEL_21;
}
v5 = *(_DWORD *)(a2 + 8);
if ( v5 == 1 )
goto LABEL_19;
if ( !*a1 )
return;
}
else
{
v5 = *(_DWORD *)*a1;
v2 = (void **)((char *)*a1 + 8);
if ( !*v2 )
return;
}
if ( v5 > 4 )
{
if ( v5 == 5 )
goto LABEL_22;
if ( v5 == 6 )
{
sub_1005EE6D8(*v2);
goto LABEL_22;
}
goto LABEL_21;
}
if ( v5 == -4 )
{
sub_1005F6078(v2, 0);
sub_100588C44(*v2);
LABEL_22:
*v2 = nullptr;
return;
}
if ( v5 != 1 )
{
LABEL_21:
sub_1005FBA78(*v2);
*v2 = nullptr;
goto LABEL_22;
}
LABEL_19:
if ( a2 )
*(_DWORD *)v2 = *(_QWORD *)(a2 + 40);
else
*(_DWORD *)v2 = -1;
}