//
// sub_6C2E0 from 0x6c2e0 to 0x6c3c8 (232 bytes)
//
// 1 xrefs:
// > sub_6B8B0 @ 0x6b904
//
// 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_6C2E0(int a1, _DWORD *a2, int a3, unsigned int a4, int a5, unsigned int *a6)
{
int v6; // r4
int v11; // r0
int v12; // r0
bool v13; // zf
unsigned int v15; // r0
int v16; // [sp+4h] [bp-3Ch] BYREF
char v17; // [sp+8h] [bp-38h]
int v18; // [sp+Ch] [bp-34h] BYREF
int v19; // [sp+10h] [bp-30h]
__int16 v20; // [sp+14h] [bp-2Ch]
char v21; // [sp+16h] [bp-2Ah]
char v22; // [sp+17h] [bp-29h]
int v23; // [sp+18h] [bp-28h]
int v24; // [sp+1Ch] [bp-24h]
unsigned int v25; // [sp+20h] [bp-20h]
v6 = 28;
if ( a2 && a4 <= 0x10000 )
{
*a6 = 0;
v18 = *(_DWORD *)(a1 + 28);
j_FMOD_OS_CriticalSection_Enter(v18);
LOBYTE(v19) = 1;
if ( *(_DWORD *)(a1 + 36) )
{
a2[5] = a3;
a2[6] = a4;
a2[7] = 0;
a2[8] = 0;
sub_44984((int)&v18);
v19 = 0;
v22 = 0;
v18 = 24;
v20 = 522;
v21 = 0;
v11 = a2[2];
v25 = a4;
v23 = v11;
v24 = a5;
v6 = (***(int (__fastcall ****)(_DWORD, int *, _DWORD))(a1 + 16))(*(_DWORD *)(a1 + 16), &v18, 0);
if ( !v6 )
{
sub_C0658(a2[1]);
v16 = *(_DWORD *)(a1 + 28);
j_FMOD_OS_CriticalSection_Enter(v16);
v17 = 1;
v12 = a2[5];
v13 = v12 == a3;
if ( v12 == a3 )
v13 = a2[6] == a4;
if ( v13 && (v15 = a2[7], v15 <= a4) )
{
if ( a2[4] || a2[8] )
{
v6 = 13;
}
else
{
*a6 = v15;
v6 = 16 * (a2[7] < a4);
}
a2[5] = 0;
a2[6] = 0;
a2[7] = 0;
a2[8] = 0;
}
else
{
v6 = 28;
}
sub_44984((int)&v16);
}
}
else
{
sub_44984((int)&v18);
return 13;
}
}
return v6;
}