//
// PlayLayer::prepareMusic from 0x14051ad50 to 0x14051aec7 (375 bytes)
//
// 3 xrefs:
// > PlayLayer::setupHasCompleted @ 0x140505a76
// > PlayLayer::startMusic @ 0x14051af60
// > ??> @ 0x14092ae60
//
// 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 11:33:35 +0000
//
// Hidden C++ exception states: #wind=3
void __fastcall PlayLayer::prepareMusic(__int64 a1)
{
_QWORD *AudioFileName; // rdi
__int64 v3; // rcx
__int64 v4; // rax
float v5; // xmm6_4
__int64 v6; // rcx
_QWORD v7[4]; // [rsp+50h] [rbp-38h] BYREF
void *v8; // [rsp+90h] [rbp+8h]
void *v9; // [rsp+A0h] [rbp+18h]
if ( (!*(_BYTE *)(a1 + 13024) || *(_BYTE *)(a1 + 13025)) && !*(_BYTE *)(a1 + 13130) )
{
AudioFileName = GJGameLevel::getAudioFileName(*(_QWORD *)(a1 + 2168), v7);
v3 = qword_14090BF60;
if ( !qword_14090BF60 )
{
v9 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v3 = qword_14090BF60;
}
FMODAudioEngine::loadMusic(
v3,
(__int64)AudioFileName,
1.0,
0.0,
1065353216,
*(_BYTE *)(a1 + 12670),
0,
0,
*(_BYTE *)(*(_QWORD *)(a1 + 3528) + 350LL));
v4 = *(_QWORD *)(a1 + 3528);
v5 = (*(float *)(v4 + 344) + *(double *)(a1 + 976)) * 1000.0;
if ( !*(_BYTE *)(v4 + 350) )
{
v6 = qword_14090BF60;
if ( !qword_14090BF60 )
{
v8 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v6 = qword_14090BF60;
}
FMODAudioEngine::setMusicTimeMS(v6, (int)v5, 0, 0);
}
*(_BYTE *)(a1 + 15560) = 1;
}
}