//
// sub_1005DB6A0 from 0x1005db6a0 to 0x1005db7b0 (272 bytes)
//
// 3 xrefs:
// > sub_100604E2C @ 0x100604e5c
// > sub_10060F33C @ 0x10060f5a0
// > sub_100612634 @ 0x10061265c
//
// 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_1005DB6A0(const char *a1, const char *a2)
{
FILE *v2; // x21
_QWORD *v3; // x0
_QWORD *v4; // x19
int *v5; // x0
__int64 v6; // x2
__int64 v7; // x4
v2 = fopen(a1, a2);
if ( v2 )
{
v3 = sub_1005DA484((__int64)&unk_100861070);
v4 = v3;
if ( v3 )
{
sub_1005DA600((__int64)v3, 0);
sub_1005DAB78(v4, 106, 1, (__int64)v2);
}
else
{
fclose(v2);
return nullptr;
}
}
else
{
v5 = __error();
sub_1005E0E48(2, 1, (unsigned int)*v5, "bss_file.c", 175);
sub_1005E19F0(5);
if ( *__error() == 2 )
{
v6 = 128;
v7 = 178;
}
else
{
v6 = 2;
v7 = 180;
}
sub_1005E0E48(32, 109, v6, "bss_file.c", v7);
return nullptr;
}
return v4;
}