//
// sub_B04EC from 0xb04ec to 0xb0616 (298 bytes)
//
// 5 xrefs:
// > sub_55578 @ 0x55838
// > sub_62360 @ 0x62430
// > sub_62B54 @ 0x62e8e
// > sub_642BA @ 0x642bc
// > sub_B04EC @ 0xb0530
//
// 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:41:40 +0000
//
int __fastcall sub_B04EC(_DWORD *a1, int a2)
{
int v3; // r0
void (__fastcall *v5)(int, _DWORD); // r2
void (__fastcall *v6)(_DWORD *); // r1
int v7; // r0
int v8; // r1
int v9; // r1
int v10; // r1
_DWORD **v11; // r0
v3 = a1[42];
if ( v3 )
{
if ( a1[55] == *(_DWORD *)(v3 + 220) )
*(_DWORD *)(v3 + 220) = 0;
v5 = *(void (__fastcall **)(int, _DWORD))(v3 + 148);
if ( v5 && (*(_BYTE *)(v3 + 25) & 2) != 0 )
{
v5(v3, 0);
v3 = a1[42];
*(_DWORD *)(v3 + 24) &= ~0x200u;
}
sub_B04EC(v3, 1);
a1[42] = 0;
}
v6 = (void (__fastcall *)(_DWORD *))a1[13];
if ( v6 )
v6(a1);
v7 = a1[55];
if ( v7 )
{
sub_BB368(v7);
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), a1[55], "../../src/fmod_codec.cpp", 63, 1);
a1[55] = 0;
}
v8 = a1[47];
if ( v8 )
{
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), v8, "../../src/fmod_codec.cpp", 71, 1);
a1[46] = 0;
a1[47] = 0;
}
a1[48] = 0;
v9 = a1[45];
if ( v9 )
{
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), v9, "../../src/fmod_codec.cpp", 78, 1);
a1[45] = 0;
}
v10 = a1[44];
if ( v10 )
{
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), v10, "../../src/fmod_codec.cpp", 84, 1);
a1[44] = 0;
}
a1[43] = 0;
v11 = (_DWORD **)a1[54];
if ( v11 )
{
sub_4EF7C(v11);
a1[54] = 0;
}
if ( a2 )
sub_BD7AC(*(int *)((char *)&dword_14C + (_DWORD)off_E8000), a1, "../../src/fmod_codec.cpp", 99, 1);
return 0;
}