//
// sub_60F8C0 from 0x60f8c0 to 0x60f980 (192 bytes)
//
// 0 xrefs:
//
// 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
//
int __fastcall sub_60F8C0(int *a1, _BYTE *a2)
{
int v2; // r5
void **v5; // r9
int result; // r0
void *v7; // r10
int v8; // r0
int v9; // r5
int v10; // r0
void *v11; // [sp+8h] [bp-8h] BYREF
size_t v12; // [sp+Ch] [bp-4h] BYREF
v2 = *a1;
v5 = *(void ***)(*a1 + 332);
result = sub_623DF4(*a1, *(char **)(*a1 + 34676), 0, (int)&v11, (int)&v12, 0);
if ( !result )
{
v7 = v11;
if ( memchr(v11, 0, v12) )
{
off_ABAEB0(v7);
return 3;
}
else
{
v8 = open((const char *)v7, 0);
*v5 = v11;
v5[1] = v11;
v5[2] = (void *)v8;
if ( __PAIR64__(*(unsigned __int8 *)(v2 + 905), v8 + 1) )
{
*a2 = 1;
return 0;
}
else
{
sub_6180F8(v2, "Couldn't open file %s", *(const char **)(v2 + 34676));
result = 37;
v9 = *(_DWORD *)(*a1 + 332);
if ( v9 )
{
off_ABAEB0(*(void **)(v9 + 4));
v10 = *(_DWORD *)(v9 + 8);
*(_DWORD *)(v9 + 4) = 0;
*(_DWORD *)v9 = 0;
if ( v10 != -1 )
close(v10);
*(_DWORD *)(v9 + 8) = -1;
return 37;
}
}
}
}
return result;
}