//
// sub_100548D98 from 0x100548d98 to 0x100548eb4 (284 bytes)
//
// 1 xrefs:
// > ??> @ 0x10082d8c8
//
// 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
//
__int64 __fastcall sub_100548D98(_QWORD *a1, _BYTE *a2)
{
__int64 v4; // x21
__int64 v5; // x24
const char **v6; // x23
char *v7; // x0
const char *v8; // x22
int v10; // w0
__int64 v12; // x19
int v13; // w0
size_t __n[2]; // [xsp+Ch] [xbp-34h] BYREF
v4 = *a1;
v5 = *(_QWORD *)(*a1 + 536LL);
v6 = (const char **)(*a1 + 35584LL);
v7 = (char *)sub_1005611E0(*a1, *v6, 0, __n);
v8 = v7;
if ( !v7 )
return 27;
if ( memchr(v7, 0, SLODWORD(__n[0])) )
return 3;
v10 = open(v8, 0);
*(_QWORD *)v5 = v8;
*(_QWORD *)(v5 + 8) = v8;
*(_DWORD *)(v5 + 16) = v10;
if ( v10 == -1 && *(_BYTE *)(v4 + 1313) == 0 )
{
sub_100552734(v4, "Couldn't open file %s", *v6);
v12 = *(_QWORD *)(*a1 + 536LL);
if ( v12 )
{
off_10085DEB8(*(void **)(v12 + 8));
*(_QWORD *)v12 = 0;
*(_QWORD *)(v12 + 8) = 0;
v13 = *(_DWORD *)(v12 + 16);
if ( v13 != -1 )
close(v13);
*(_DWORD *)(v12 + 16) = -1;
return 37;
}
else
{
return 37;
}
}
else
{
*a2 = 1;
return 0;
}
}