//
// sub_6BE4E from 0x6be4e to 0x6bf0e (192 bytes)
//
// 1 xrefs:
// > sub_6BCC4 @ 0x6bce4
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:40:58 +0000
//
int __fastcall sub_6BE4E(int a1, _DWORD *a2, int a3)
{
unsigned int v4; // r0
int result; // r0
int v8; // r6
int v9; // r0
int v10; // r9
int v11; // r0
int v12; // [sp+4h] [bp-24h] BYREF
int v13; // [sp+8h] [bp-20h] BYREF
char v14; // [sp+Ch] [bp-1Ch]
v4 = a2[5];
if ( v4 > 0x8000000 )
return 28;
result = sub_6C3C8(a1, v4 + 33);
if ( !result )
{
v8 = *(_DWORD *)(a1 + 24);
*(_DWORD *)(v8 + 4) = 0;
*(_DWORD *)(v8 + 8) = 0;
*(_DWORD *)v8 = 32;
*(_WORD *)(v8 + 8) = 778;
*(_BYTE *)(v8 + 10) = 0;
*(_DWORD *)(v8 + 12) = a2[3];
*(_DWORD *)(v8 + 20) = a2[4];
*(_DWORD *)(v8 + 24) = a2[5];
*(_DWORD *)(v8 + 28) = 0;
*(_DWORD *)(v8 + 16) = 3;
v13 = *(_DWORD *)(a1 + 28);
j_FMOD_OS_CriticalSection_Enter(v13);
v14 = 1;
v9 = sub_6C43C(a1 + 76, a2 + 3);
if ( v9 )
{
v10 = v9;
if ( !j_FMOD_OS_File_Seek(*(_DWORD *)(v9 + 8), a2[4]) )
{
v12 = 0;
if ( (j_FMOD_OS_File_Read(*(_DWORD *)(v10 + 8), v8 + 32, a2[5], &v12) & 0xFFFFFFEF) == 0 )
{
v11 = v12;
*(_DWORD *)(v8 + 28) = v12;
*(_DWORD *)(v8 + 16) = 0;
*(_DWORD *)v8 += v11;
}
}
}
sub_44984((int)&v13);
return (***(int (__fastcall ****)(_DWORD, int, int))(a1 + 16))(*(_DWORD *)(a1 + 16), v8, a3);
}
return result;
}