//
// sub_BF684 from 0xbf684 to 0xbf6cc (72 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_BF684(_QWORD *a1)
{
__int64 v1; // kr00_8
int result; // r0
int v3; // r0
int i; // r1
int v5; // r2
v1 = *a1;
result = (*((int (__fastcall **)(_QWORD *, _DWORD, _DWORD))a1 + 1))(
a1,
*(_DWORD *)(*(_DWORD *)a1 + 24),
*(_DWORD *)(*(_DWORD *)a1 + 8));
if ( !result )
{
if ( *(_DWORD *)(v1 + 16) == 1 )
{
v3 = *(_DWORD *)(v1 + 24);
for ( i = 0; ; ++i )
{
v5 = *(_DWORD *)(v1 + 12);
if ( i >= v5 )
break;
*(_BYTE *)(v3 + i) ^= 0x80u;
}
}
else
{
v5 = *(_DWORD *)(v1 + 12);
}
result = j_FMOD_OS_File_Write(*(_DWORD *)(v1 + 28), *(_DWORD *)(v1 + 24), v5, 0);
if ( !result )
{
*(_DWORD *)(v1 + 20) += *(_DWORD *)(v1 + 12);
return 0;
}
}
return result;
}