//
// FMODAudioEngine::unregisterChannel from 0x3ed864 to 0x3ed9ec (392 bytes)
//
// 1 xrefs:
// > FMODAudioEngine::channelStopped @ 0x3edaba
//
// 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:47:10 +0000
//
unsigned int __fastcall FMODAudioEngine::unregisterChannel(FMODAudioEngine *this, unsigned int a2)
{
unsigned int v3; // r4
unsigned int v5; // r6
unsigned int v6; // r11
int v7; // r9
_DWORD **v8; // r3
_DWORD *i; // r7
unsigned int v10; // r0
int v11; // r1
unsigned int v12; // r0
int v13; // r1
int v15; // r8
unsigned int v16; // r0
int v17; // r11
_DWORD *j; // r10
unsigned int v19; // r0
int v20; // r1
unsigned int v21; // r0
int v22; // r1
_DWORD *v23; // [sp+0h] [bp-1Ch]
int v24; // [sp+Ch] [bp-10h] BYREF
unsigned int v25; // [sp+10h] [bp-Ch] BYREF
v3 = *((_DWORD *)this + 193);
v24 = a2;
if ( v3 )
{
v5 = v3 - 1;
v6 = ((v3 - 1) & v3) != 0 ? a2 % v3 : v5 & a2;
v7 = *((_DWORD *)this + 192);
v8 = *(_DWORD ***)(v7 + 4 * v6);
if ( v8 )
{
for ( i = *v8; i; i = (_DWORD *)*i )
{
v10 = i[1];
v11 = ((v3 - 1) & v3) != 0 ? v10 % v3 : v5 & v10;
if ( v11 != v6 )
break;
if ( i[2] == a2 )
{
v15 = v5 & v3;
v16 = i[1];
v23 = (_DWORD *)*i;
if ( (v5 & v3) != 0 )
v17 = v16 % v3;
else
v17 = v5 & v16;
for ( j = *(_DWORD **)(v7 + 4 * v17); (_DWORD *)*j != i; j = (_DWORD *)*j )
;
if ( j == (_DWORD *)((char *)this + 776)
|| ((v12 = j[1], v15) ? (v13 = v12 % v3) : (v13 = v5 & v12), v13 != v17) )
{
if ( !v23 || ((v21 = v23[1], v15) ? (v22 = v21 % v3) : (v22 = v5 & v21), v22 != v17) )
*(_DWORD *)(v7 + 4 * v17) = 0;
}
if ( *i )
{
v19 = *(_DWORD *)(*i + 4);
v20 = v15 ? v19 % v3 : v5 & v19;
if ( v20 != v17 )
*(_DWORD *)(*((_DWORD *)this + 192) + 4 * v20) = j;
}
*j = *i;
*i = 0;
--*((_DWORD *)this + 195);
operator delete(i);
break;
}
}
}
}
std::__hash_table,std::equal_to,std::allocator>::__erase_unique(
(int *)this + 197,
(unsigned int *)&v24);
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::__erase_unique(
(int *)this + 177,
(unsigned int *)&v24);
if ( std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::find(
(_DWORD *)this + 203,
(unsigned int *)&v24) )
{
v25 = *std::unordered_map::operator[]((int)this + 812, (unsigned int *)&v24);
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::__erase_unique(
(int *)this + 203,
(unsigned int *)&v24);
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::__erase_unique(
(int *)this + 208,
&v25);
}
return FMODAudioEngine::channelUnlinkSound((unsigned int)this, v24);
}