//
// sub_BF5F4 from 0xbf5f4 to 0xbf676 (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_BF5F4(int **a1)
{
int *v1; // r6
int v3; // r0
int v4; // r5
_DWORD *v5; // r1
v1 = *a1;
if ( !*a1 )
return 0;
v3 = v1[7];
if ( !v3 || (v4 = sub_85CA8(v3, v1[4], v1[1], *v1, v1[5])) == 0 && (v4 = j_FMOD_OS_File_Close(v1[7])) == 0 )
{
v5 = (_DWORD *)v1[6];
if ( v5 )
{
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), v5);
v1[6] = 0;
}
v4 = 0;
if ( *a1 )
{
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), *a1);
*a1 = nullptr;
}
}
return v4;
}