//
// FMODAudioEngine::channelUnlinkSound from 0x3ed794 to 0x3ed85e (202 bytes)
//
// 1 xrefs:
// > FMODAudioEngine::unregisterChannel @ 0x3ed948
//
// 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::channelUnlinkSound(unsigned int this, unsigned int a2)
{
unsigned int v2; // r4
unsigned int v3; // r6
unsigned int v5; // r8
unsigned int v6; // r11
_DWORD *v7; // r3
_DWORD *i; // r7
int v9; // r1
int *v10; // r8
_DWORD *v11; // r4
_DWORD *v12; // r0
int *v13; // r0
unsigned int v14; // [sp+4h] [bp-18h] BYREF
int v15[3]; // [sp+8h] [bp-14h] BYREF
v2 = this;
v3 = *(_DWORD *)(this + 856);
v14 = a2;
if ( v3 )
{
v5 = v3 - 1;
if ( ((v3 - 1) & v3) != 0 )
{
this = a2 / v3;
v6 = a2 % v3;
}
else
{
v6 = v5 & a2;
}
v7 = *(_DWORD **)(*(_DWORD *)(v2 + 852) + 4 * v6);
if ( v7 )
{
for ( i = (_DWORD *)*v7; i; i = (_DWORD *)*i )
{
this = i[1];
if ( ((v3 - 1) & v3) != 0 )
{
v9 = this % v3;
this /= v3;
}
else
{
v9 = v5 & this;
}
if ( v9 != v6 )
break;
if ( i[2] == a2 )
{
v10 = (int *)(v2 + 852);
v11 = (_DWORD *)(v2 + 284);
v12 = std::unordered_map::operator[]((int)v10, &v14);
std::string::basic_string(v15, (int)v12);
if ( std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::find(
v11,
(unsigned __int8 *)v15) )
{
v13 = std::unordered_map::operator[]((int)v11, (unsigned __int8 *)v15);
--v13[5];
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::__erase_unique(
v10,
&v14);
}
return std::string::~string((int)v15);
}
}
}
}
return this;
}