//
// sub_1005D5DC4 from 0x1005d5dc4 to 0x1005d5eb4 (240 bytes)
//
// 2 xrefs:
// > sub_1005D5DBC @ 0x1005d5dc0
// > sub_1005D5FB0 @ 0x1005d5fdc
//
// 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_1005D5DC4(__int64 a1)
{
_BYTE *v2; // x0
void *v3; // x19
void *v4; // x0
__int64 v5; // x0
unsigned int (__fastcall *v6)(void *); // x8
if ( !qword_100882D00 )
qword_100882D00 = sub_1005D63C0();
v2 = sub_100588710(72, (__int64)"dso_lib.c", 106);
v3 = v2;
if ( !v2 )
{
sub_1005E0E48(37, 113, 65, "dso_lib.c", 108);
return nullptr;
}
v4 = memset(v2, 0, 0x48u);
v5 = sub_1005DE4A4(v4);
*((_QWORD *)v3 + 1) = v5;
if ( !v5 )
{
sub_1005E0E48(37, 113, 65, "dso_lib.c", 115);
goto LABEL_12;
}
if ( !a1 )
a1 = qword_100882D00;
*(_QWORD *)v3 = a1;
*((_DWORD *)v3 + 4) = 1;
v6 = *(unsigned int (__fastcall **)(void *))(a1 + 64);
if ( v6 && !v6(v3) )
{
sub_1005DE314(*((void **)v3 + 1));
LABEL_12:
sub_100588C44(v3);
return nullptr;
}
return v3;
}