//
// FMODAudioEngine::fadeOutMusic from 0x6d7ba4 to 0x6d7c94 (240 bytes)
//
// 4 xrefs:
// > PlayLayer::showCompleteEffect @ 0x6f8004
// > LevelAreaInnerLayer::onDoor @ 0xb5b0d4
// > GJPathPage::playUnlockAnimation @ 0xba54b8
// > ??> @ 0x4e148
//
// 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:31 +0000
//
__int64 __fastcall FMODAudioEngine::fadeOutMusic(FMODAudioEngine *this, float a2, int a3)
{
FMOD::Channel *ActiveMusicChannel; // x0
FMOD::ChannelControl *v6; // x19
float v7; // s0
float v9; // [xsp+40h] [xbp+40h]
unsigned __int64 v10; // [xsp+50h] [xbp+50h] BYREF
ActiveMusicChannel = (FMOD::Channel *)FMODAudioEngine::getActiveMusicChannel(this, a3);
v6 = ActiveMusicChannel;
if ( ActiveMusicChannel )
{
FMODAudioEngine::stopAndGetFade(this, ActiveMusicChannel);
v9 = v7;
*((_DWORD *)this + 134) = FMOD::ChannelControl::getDSPClock(v6, nullptr, &v10);
ERRCHECK_fn();
*((_DWORD *)this + 134) = FMOD::ChannelControl::addFadePoint(v6, v10, v9);
ERRCHECK_fn();
*((_DWORD *)this + 134) = FMOD::ChannelControl::addFadePoint(
v6,
(unsigned __int64)(float)((float)v10 + (float)((float)*((int *)this + 135) * a2)),
0.0);
ERRCHECK_fn();
}
return _stack_chk_guard;
}