//
// FMODAudioEngine::stopAllMusic from 0x6d3528 to 0x6d36a8 (384 bytes)
//
// 32 xrefs:
// > FMODAudioEngine::clearAllAudio @ 0x6d36cc
// > GJSongBrowser::exitLayer @ 0x6e6df0
// > CreateGuidelinesLayer::onStop @ 0x6e8114
// > PlayLayer::resetLevelFromStart @ 0x6f6bf4
// > PlayLayer::playPracticeMusic @ 0x6f7010
// > PlayLayer::resumeAndRestart @ 0x6f745c
// > GameManager::playMenuMusic @ 0x71e194
// > GameManager::fadeInMenuMusic @ 0x71e310
// > CustomSongCell::onDelete @ 0x7359ec
// > LevelEditorLayer::stopPlayback @ 0x78d068
// > LevelEditorLayer::onStopPlaytest @ 0x78e088
// > LevelEditorLayer::init @ 0x7ae9c4
// > LevelInfoLayer::onPlay @ 0x7e7c6c
// > EditLevelLayer::onPlay @ 0x7eeeb0
// > CustomSongWidget::onPlayback @ 0x8692e4
// > CustomSongWidget::onPlayback @ 0x869344
// > CustomSongWidget::deleteSong @ 0x86adf8
// > LevelPage::onPlay @ 0x8c8374
// > OptionsLayer::onMenuMusic @ 0x8ee090
// > EndLevelLayer::onEdit @ 0x8f97fc
// > SongInfoLayer::onBPM @ 0x9033a8
// > CustomSongLayer::onClose @ 0x97e0d4
// > CustomSongLayer::onCreateLines @ 0x97e328
// > CustomSongLayer::onSearch @ 0x97f414
// > SongOptionsLayer::onPlayback @ 0x97f664
// > GauntletSelectLayer::playUnlockAnimation @ 0xa73c4c
// > GJShopLayer::dialogClosed @ 0xa7d018
// > GJWorldNode::playStep1 @ 0xaa709c
// > SetupSongTriggerPopup::onPlayback @ 0xaea218
// > SetupSongTriggerPopup::onClose @ 0xaea4c0
// > SetupSongTriggerPopup::valueDidChange @ 0xaea5cc
// > ??> @ 0xc68e0
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:51:28 +0000
//
__int64 __fastcall FMODAudioEngine::stopAllMusic(FMODAudioEngine *this, char a2)
{
FMOD::ChannelControl *v3; // x0
__int64 *v5; // x19
_DWORD *v6; // x20
_BYTE *v7; // x0
int *v8; // x19
FMOD::ChannelControl *v9; // x0
void *v10; // [xsp+40h] [xbp+40h] BYREF
_DWORD *v11; // [xsp+48h] [xbp+48h]
_DWORD *v12; // [xsp+50h] [xbp+50h]
if ( a2 )
{
v3 = *((FMOD::ChannelControl **)this + 60);
if ( v3 )
FMOD::ChannelControl::stop(v3);
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::clear((_QWORD *)this + 113);
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::clear((_QWORD *)this + 118);
std::__hash_table,std::__unordered_map_hasher,std::hash,true>,std::__unordered_map_equal,std::equal_to,true>,std::allocator>>::clear((_QWORD *)this + 123);
}
else
{
v5 = *((__int64 **)this + 42);
v10 = nullptr;
v11 = nullptr;
v12 = nullptr;
if ( v5 )
{
v6 = nullptr;
do
{
if ( !*((_BYTE *)v5 + 65) )
{
if ( v12 == v6 )
{
std::vector::__push_back_slow_path((__int64)&v10, (_DWORD *)v5 + 6);
v6 = v11;
}
else
{
if ( v6 )
{
*v6 = *((_DWORD *)v5 + 6);
v6 = v11;
}
v11 = ++v6;
}
}
v5 = (__int64 *)*v5;
}
while ( v5 );
v7 = v10;
if ( v6 != v10 )
{
v8 = (int *)v10;
do
{
v9 = (FMOD::ChannelControl *)FMODAudioEngine::channelForChannelID(this, *v8);
if ( v9 )
FMOD::ChannelControl::stop(v9);
++v8;
}
while ( v6 != v8 );
v7 = v10;
}
if ( v7 )
{
if ( v7 != (_BYTE *)v11 )
v11 += ~((unsigned __int64)((char *)(v11 - 1) - v7) >> 2);
operator delete(v7);
}
}
}
return _stack_chk_guard;
}