//
// sub_6BCFC from 0x6bcfc to 0x6be08 (268 bytes)
//
// 1 xrefs:
// > sub_6BCC4 @ 0x6bcd8
//
// 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_6BCFC(int a1, int a2, int a3)
{
int v5; // r2
_DWORD *v6; // r6
int v7; // r0
int v8; // r8
int v9; // r6
void (__fastcall *v11)(int, _DWORD, _DWORD); // r3
_DWORD *v12; // r0
_DWORD *v13; // r4
int v14; // r0
int v15; // r3
_DWORD *v16; // [sp+10h] [bp-48h] BYREF
int v17; // [sp+14h] [bp-44h] BYREF
char v18; // [sp+18h] [bp-40h]
int v19; // [sp+1Ch] [bp-3Ch] BYREF
int v20; // [sp+20h] [bp-38h] BYREF
_DWORD v21[2]; // [sp+24h] [bp-34h] BYREF
__int16 v22; // [sp+2Ch] [bp-2Ch]
char v23; // [sp+2Eh] [bp-2Ah]
char v24; // [sp+2Fh] [bp-29h]
int v25; // [sp+30h] [bp-28h]
int v26; // [sp+34h] [bp-24h]
int v27; // [sp+38h] [bp-20h]
v21[1] = 0;
v24 = 0;
v21[0] = 24;
v22 = 266;
v23 = 0;
v6 = (_DWORD *)(a2 + 12);
v5 = *(_DWORD *)(a2 + 12);
v27 = 0;
v25 = v5;
v26 = 0;
if ( !*(_BYTE *)(a2 + 10) )
{
v8 = a2 + 20;
if ( j_FMOD_OS_File_Open(a2 + 20, 0, &v20, &v19) )
{
v7 = 3;
goto LABEL_5;
}
v17 = *(_DWORD *)(a1 + 28);
j_FMOD_OS_CriticalSection_Enter(v17);
v18 = 1;
v11 = *(void (__fastcall **)(int, _DWORD, _DWORD))(a1 + 108);
if ( v11 )
v11(v8, 0, *(_DWORD *)(a1 + 112));
if ( sub_6C202(a1 + 76, v6) )
{
v9 = j_FMOD_OS_File_Close(v19);
if ( !v9 )
{
v26 = 3;
LABEL_15:
sub_44984((int)&v17);
return (***(int (__fastcall ****)(_DWORD, _DWORD *, int))(a1 + 16))(*(_DWORD *)(a1 + 16), v21, a3);
}
}
else
{
v27 = v20;
v12 = (_DWORD *)sub_BD410(
*(int *)((char *)&dword_14C + (_DWORD)off_E8000),
272,
"../../src/fmod_profile_remotefile.cpp",
358);
if ( v12 )
{
*v12 = 0;
v12[1] = 0;
v12[2] = 0;
v12[3] = 0;
v16 = v12;
v13 = v12;
sub_6C23C(v12, a1, *v6);
v14 = v20;
v13[2] = v19;
v13[3] = v14;
v9 = sub_6C254(a1 + 76, v6, &v16, v15, 0, 0, 1);
if ( !v9 )
goto LABEL_15;
}
else
{
v9 = 38;
}
}
sub_44984((int)&v17);
return v9;
}
v7 = 2;
LABEL_5:
v26 = v7;
return (***(int (__fastcall ****)(_DWORD, _DWORD *, int))(a1 + 16))(*(_DWORD *)(a1 + 16), v21, a3);
}