//
// sub_BF31C from 0xbf31c to 0xbf39e (130 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_BF31C(int **a1)
{
int *v1; // r6
int v3; // r0
int v4; // r5
_DWORD *v5; // r1
v1 = *a1;
if ( !*a1 )
return 0;
v3 = v1[11];
if ( !v3 || (v4 = sub_85CA8(v3, v1[5], v1[1], *v1, v1[9])) == 0 && (v4 = j_FMOD_OS_File_Close(v1[11])) == 0 )
{
v5 = (_DWORD *)v1[10];
if ( v5 )
{
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), v5);
v1[10] = 0;
}
v4 = 0;
if ( *a1 )
{
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), *a1);
*a1 = nullptr;
}
}
return v4;
}