//
// FMODAudioEngine::stopAndRemoveMusic from 0x3ef870 to 0x3ef8ec (124 bytes)
//
// 2 xrefs:
// > FMODAudioEngine::stopMusic @ 0x3ef8ec
// > FMODAudioEngine::preloadMusic @ 0x3ef938
//
// 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:12 +0000
//
_DWORD *__fastcall FMODAudioEngine::stopAndRemoveMusic(FMODAudioEngine *this, unsigned int a2)
{
_DWORD *v2; // r6
_DWORD *result; // r0
int *v5; // r0
FMOD::ChannelControl *v6; // r0
int *v7; // r0
_DWORD *v8; // r3
unsigned int v9; // [sp+4h] [bp-4h] BYREF
v2 = (_DWORD *)((char *)this + 264);
v9 = a2;
result = std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::find(
(_DWORD *)this + 66,
&v9);
if ( result )
{
v5 = std::unordered_map::operator[]((int)v2, &v9);
v6 = (FMOD::ChannelControl *)FMODAudioEngine::channelForChannelID(this, *v5);
if ( v6 )
{
return (_DWORD *)FMOD::ChannelControl::stop(v6);
}
else
{
if ( std::unordered_map::operator[]((int)v2, &v9)[1] )
{
v7 = std::unordered_map::operator[]((int)v2, &v9);
v8 = *((_DWORD **)this + 185);
if ( v8 == *((_DWORD **)this + 186) )
{
std::vector::__push_back_slow_path((int)this + 736, v7 + 1);
}
else
{
if ( v8 )
*v8 = v7[1];
*((_DWORD *)this + 185) += 4;
}
}
return (_DWORD *)std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::__erase_unique(
v2,
&v9);
}
}
return result;
}