//
// sub_BF1FC from 0xbf1fc to 0xbf308 (268 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_BF1FC(
unsigned __int64 **a1,
int a2,
int a3,
_DWORD *a4,
_DWORD *a5,
int *a6,
int *a7,
unsigned int a8,
int a9,
int a10,
const char *a11)
{
unsigned __int64 *v13; // r0
unsigned __int64 *v14; // r4
int v15; // r5
unsigned __int64 v16; // r0
int v17; // r5
const char *v18; // r0
unsigned __int64 *v20; // r0
int v21; // [sp+4h] [bp-24h] BYREF
int v22; // [sp+8h] [bp-20h] BYREF
a1[12] = (_QWORD *)(&dword_0 + 1);
if ( !*a5 )
{
*a5 = 3;
*a6 = 2;
}
*a7 = *((_DWORD *)&unk_E5E90 + 2 * a2);
v13 = sub_BD580(
*(int *)((char *)&dword_14C + (_DWORD)off_E8000),
0x30u,
"../../src/fmod_output_wavwriter.cpp",
0x69u,
0);
*a1 = v13;
if ( !v13 )
return 38;
HIDWORD(v16) = *a4;
v14 = v13;
*(_DWORD *)v13 = *a4;
*((_DWORD *)v13 + 1) = *a6;
v15 = (int)(1000 * a8) / SHIDWORD(v16);
LODWORD(v16) = v15 / 3;
if ( v15 < 3 )
LODWORD(v16) = 1;
HIDWORD(v16) = *a7;
*((_DWORD *)v14 + 2) = a8;
v14[2] = v16;
v22 = 0;
v17 = sub_4C6EA(a8, &v22, *a6, *a7);
if ( !v17 )
{
*((_DWORD *)v14 + 3) = v22;
v21 = 0;
v18 = "fmodoutput.wav";
if ( a11 )
v18 = a11;
if ( j_FMOD_OS_File_Open(v18, 1, &v21, (char *)v14 + 44) )
{
return 51;
}
else
{
v17 = sub_85CA8(
*((_DWORD *)v14 + 11),
*((_DWORD *)v14 + 5),
*((_DWORD *)v14 + 1),
*(_DWORD *)v14,
*((_DWORD *)v14 + 9));
if ( !v17 )
{
v17 = 0;
v20 = sub_BD580(
*(int *)((char *)&dword_14C + (_DWORD)off_E8000),
*((_DWORD *)v14 + 3),
"../../src/fmod_output_wavwriter.cpp",
0x8Bu,
0);
*((_DWORD *)v14 + 10) = v20;
if ( !v20 )
return 38;
}
}
}
return v17;
}