//
// GameManager::playMenuMusic from 0x100360390 to 0x1003604e1 (337 bytes)
//
// 1 xrefs:
// > OptionsLayer::musicSliderChanged @ 0x10087bdf5
//
// This function is hookable on this platform (idp: pc, 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:28:55 +0000
//
void __fastcall GameManager::playMenuMusic(__int64 a1, double a2)
{
__int64 v2; // rax
void *v3; // r14
__int64 v4; // rbx
char v5; // r14
char isMusicPlaying; // bl
__int64 v7; // rbx
__int128 v8; // [rsp+0h] [rbp-60h] BYREF
void *__p; // [rsp+10h] [rbp-50h]
__int128 v10; // [rsp+20h] [rbp-40h] BYREF
void *v11; // [rsp+30h] [rbp-30h]
__int128 v12; // [rsp+38h] [rbp-28h] BYREF
void *v13; // [rsp+48h] [rbp-18h]
if ( qword_100BE3098 )
{
if ( (unsigned __int8)GameManager::getGameVariable(qword_100BE3098, "0122") )
{
LABEL_3:
v2 = FMODAudioEngine::sharedEngine(a2);
FMODAudioEngine::stopAllMusic(v2, 1);
return;
}
}
else
{
v3 = operator new(0x6B8u);
sub_100377960(v3);
qword_100BE3098 = (__int64)v3;
(*(void (__fastcall **)(void *))(*(_QWORD *)v3 + 80LL))(v3);
if ( (unsigned __int8)GameManager::getGameVariable(qword_100BE3098, "0122") )
goto LABEL_3;
}
GameManager::getMenuMusicFile((__int64)&v12, a1, a2);
v4 = FMODAudioEngine::sharedEngine(a2);
v5 = v12 & 1;
if ( (v12 & 1) != 0 )
{
sub_10001AD30(&v8, v13, *((unsigned __int64 *)&v12 + 1));
}
else
{
__p = v13;
a2 = *(double *)&v12;
v8 = v12;
}
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v4, &v8, 0);
if ( (v8 & 1) != 0 )
operator delete(__p);
if ( !isMusicPlaying )
{
v7 = FMODAudioEngine::sharedEngine(a2);
if ( v5 )
{
sub_10001AD30(&v10, v13, *((unsigned __int64 *)&v12 + 1));
}
else
{
v11 = v13;
v10 = v12;
}
FMODAudioEngine::playMusic(v7, &v10, 1, 0, 0.0);
if ( (v10 & 1) != 0 )
operator delete(v11);
}
if ( v5 )
operator delete(v13);
}