//
// GameManager::fadeInMusic from 0x14017bba0 to 0x14017bcb6 (278 bytes)
//
// 11 xrefs:
// > GameManager::fadeInMenuMusic @ 0x14017bb8f
// > GJShopLayer::onBack @ 0x1402acf31
// > LevelAreaLayer::init @ 0x1402c44c5
// > LevelAreaInnerLayer::tryResumeTowerMusic @ 0x1402c81ba
// > SecretRewardsLayer::init @ 0x1403d289e
// > SecretLayer::init @ 0x1403dcb30
// > SecretLayer2::init @ 0x1403e23e3
// > SecretLayer3::init @ 0x1403e9fa1
// > SecretLayer4::init @ 0x1403efc23
// > SecretLayer5::init @ 0x1403f4182
// > ??> @ 0x1406cb370
//
// 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
//
// Hidden C++ exception states: #wind=5
void __fastcall GameManager::fadeInMusic(__int64 a1, __int64 a2)
{
_QWORD *v3; // rdi
FMODAudioEngine *v4; // rcx
__int64 v5; // rdi
FMODAudioEngine *v6; // rcx
FMODAudioEngine *v7; // [rsp+30h] [rbp-48h]
FMODAudioEngine *v8; // [rsp+38h] [rbp-40h]
_BYTE v9[32]; // [rsp+40h] [rbp-38h] BYREF
__int64 v10; // [rsp+60h] [rbp-18h]
v10 = a2;
if ( *(_QWORD *)(a2 + 16) )
{
v3 = (_QWORD *)sub_14003BDB0((__int64)v9, a2);
v4 = (FMODAudioEngine *)qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v8 = (FMODAudioEngine *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v4 = (FMODAudioEngine *)qword_1406C2E88;
}
if ( !FMODAudioEngine::isMusicPlaying(v4, v3) )
{
v5 = sub_14003BDB0((__int64)v9, a2);
v6 = (FMODAudioEngine *)qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v7 = (FMODAudioEngine *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v6 = (FMODAudioEngine *)qword_1406C2E88;
}
FMODAudioEngine::playMusic(v6, v5, 1, 1.0);
}
}
sub_14003A830(a2);
}