//
// sub_6C58A from 0x6c58a to 0x6c62c (162 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_6C58A(int a1)
{
int v2; // r0
int v3; // r6
int v4; // r0
int v5; // r1
int v6; // r2
int v7; // r3
int v8; // r4
int v9; // r0
int v10; // r1
int v11; // r2
int v12; // r3
int v14[3]; // [sp+0h] [bp-28h] BYREF
int v15; // [sp+Ch] [bp-1Ch]
int v16; // [sp+10h] [bp-18h] BYREF
char v17; // [sp+14h] [bp-14h]
v16 = *(_DWORD *)(a1 + 28);
j_FMOD_OS_CriticalSection_Enter(v16);
v17 = 1;
v2 = *(_DWORD *)(a1 + 36) - 1;
*(_DWORD *)(a1 + 36) = v2;
if ( !v2 )
{
sub_6BB6C(v14, a1 + 44);
while ( v15 != -1 )
{
v4 = *(_DWORD *)(*(_DWORD *)(v14[0] + 12) + 12 * v15 + 8);
*(_DWORD *)(v4 + 16) = 1;
sub_C0668(*(_DWORD *)(v4 + 4));
sub_6BBB8(v14, v5, v6, v7);
}
v8 = a1 + 76;
sub_6BBEA(v14, v8);
while ( v15 != -1 )
{
v9 = sub_6BC10(*(_DWORD *)(*(_DWORD *)(v14[0] + 12) + 12 * v15 + 8));
if ( v9 )
{
v3 = v9;
goto LABEL_13;
}
sub_6BC38(v14, v10, v11, v12);
}
v3 = sub_6C62C(v8, 0);
if ( v3 )
goto LABEL_13;
}
v3 = 0;
LABEL_13:
sub_44984((int)&v16);
return v3;
}