//
// FMODAudioEngine::stopAllMusic from 0x301b7e to 0x301c5e (224 bytes)
//
// 31 xrefs:
// > FMODAudioEngine::clearAllAudio @ 0x301c6a
// > GJSongBrowser::exitLayer @ 0x307c8e
// > CreateGuidelinesLayer::onStop @ 0x308d92
// > PlayLayer::resetLevelFromStart @ 0x312f74
// > PlayLayer::togglePracticeMode @ 0x31434c
// > PlayLayer::resumeAndRestart @ 0x314596
// > GameManager::playMenuMusic @ 0x323f18
// > GameManager::fadeInMenuMusic @ 0x323fca
// > CustomSongCell::onDelete @ 0x32f4b8
// > LevelEditorLayer::stopPlayback @ 0x368710
// > LevelEditorLayer::onStopPlaytest @ 0x369440
// > LevelEditorLayer::init @ 0x3764f0
// > LevelInfoLayer::onPlay @ 0x3b23a6
// > LevelInfoLayer::onPlayReplay @ 0x3b27e6
// > EditLevelLayer::onPlay @ 0x3b7db8
// > CustomSongWidget::onPlayback @ 0x3dd692
// > CustomSongWidget::onPlayback @ 0x3dd6a0
// > CustomSongWidget::deleteSong @ 0x3dfaae
// > LevelPage::onPlay @ 0x408eb8
// > OptionsLayer::onMenuMusic @ 0x42240a
// > EndLevelLayer::onEdit @ 0x427896
// > SongInfoLayer::onBPM @ 0x42d788
// > CustomSongLayer::onClose @ 0x45df44
// > CustomSongLayer::onCreateLines @ 0x45e132
// > CustomSongLayer::onSearch @ 0x45f628
// > SongOptionsLayer::onPlayback @ 0x45feea
// > GJShopLayer::dialogClosed @ 0x4e1dae
// > GJWorldNode::playStep1 @ 0x4fd3d8
// > SetupSongTriggerPopup::onPlayback @ 0x524d4e
// > SetupSongTriggerPopup::onClose @ 0x524fa8
// > SetupSongTriggerPopup::valueDidChange @ 0x5250be
//
// 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
//
void FMODAudioEngine::stopAllMusic(FMODAudioEngine *a1, bool a2)
{
FMOD::ChannelGroup *m_backgroundMusicChannel; // r0
std::__detail::_Hash_node_base *M_nxt; // r7
int *v5; // r5
_BYTE *v6; // r6
signed int v7; // r5
int v8; // r9
int v9; // r4
bool v10; // cf
unsigned int v11; // r4
char *v12; // r10
int *i; // r4
int v14; // r1
FMOD::Channel *v15; // r0
if ( a2 )
{
m_backgroundMusicChannel = a1->m_backgroundMusicChannel;
if ( m_backgroundMusicChannel )
FMOD::ChannelControl::stop(m_backgroundMusicChannel);
std::_Hashtable,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::clear((int)&a1->m_audioState.m_volumeForMusicChannels);
std::_Hashtable,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::clear((int)&a1->m_audioState.m_volumeModForMusicChannels);
std::_Hashtable,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::clear((int)&a1->m_audioState.m_pitchForMusicChannels);
return;
}
M_nxt = a1->m_fmodMusic._M_h._M_before_begin._M_nxt;
v5 = nullptr;
v6 = nullptr;
while ( M_nxt )
{
if ( BYTE1(M_nxt[5]._M_nxt) )
goto LABEL_26;
if ( v5 != (int *)a2 )
{
if ( v5 )
*v5 = (int)M_nxt[2]._M_nxt;
++v5;
goto LABEL_26;
}
v7 = (char *)v5 - v6;
v8 = v7 >> 2;
if ( v7 >> 2 )
v9 = v7 >> 2;
else
v9 = 1;
v10 = __CFADD__(v9, v8);
v11 = v9 + v8;
if ( v10 || v11 >= 0x40000000 )
{
v11 = 0x3FFFFFFF;
}
else if ( !v11 )
{
v12 = nullptr;
goto LABEL_19;
}
v12 = (char *)operator new(4 * v11);
LABEL_19:
if ( &v12[v7] )
*(std::__detail::_Hash_node_base *)&v12[v7] = M_nxt[2];
if ( v8 )
memmove(v12, v6, v7);
v5 = (int *)&v12[v7 + 4];
if ( v6 )
operator delete(v6);
*(_DWORD *)&a2 = &v12[4 * v11];
v6 = v12;
LABEL_26:
M_nxt = M_nxt->_M_nxt;
}
for ( i = (int *)v6; i != v5; ++i )
{
v14 = *i;
v15 = FMODAudioEngine::channelForChannelID(a1, v14);
if ( v15 )
FMOD::ChannelControl::stop(v15);
}
if ( v6 )
operator delete(v6);
}