//
// PlayLayer::startMusic from 0x14051aed0 to 0x14051b0a5 (469 bytes)
//
// 7 xrefs:
// > PauseLayer::onResume @ 0x1404dae11
// > PlayLayer::startGame @ 0x14050618d
// > PlayLayer::startGameDelayed @ 0x1405061a7
// > PlayLayer::resetLevel @ 0x1405199b6
// > UILayer::handleAction @ 0x140672871
// > UILayer::handleAction @ 0x140672ae4
// > ??> @ 0x14092ae6c
//
// 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=2
void __fastcall PlayLayer::startMusic(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rdx
__int64 v4; // rcx
double *v5; // rdi
__int64 v6; // rcx
struct cocos2d::CCObject *Checkpoint; // rax
void *v8; // [rsp+30h] [rbp+8h]
void *v9; // [rsp+30h] [rbp+8h]
if ( !*(_BYTE *)(a1 + 13130) )
{
if ( *(_BYTE *)(a1 + 13144) )
{
v2 = *(_QWORD *)(a1 + 12912);
if ( !v2
|| !cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 14896), *(unsigned int *)(v2 + 924)) )
{
if ( !qword_14090BF60 )
{
v8 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
}
if ( !*(_BYTE *)(a1 + 15560) )
PlayLayer::prepareMusic(a1);
GJBaseGameLayer::processQueuedAudioTriggers(a1);
GJBaseGameLayer::updateProximityVolumeEffects(a1);
v5 = (double *)(a1 + 976);
if ( *(double *)(a1 + 976) <= 0.0 )
{
v5 = (double *)(a1 + 976);
if ( *(_BYTE *)(*(_QWORD *)(a1 + 3528) + 348LL) )
{
if ( !*(_BYTE *)(a1 + 13024) || (v5 = (double *)(a1 + 976), *(_BYTE *)(a1 + 13025)) )
{
v6 = qword_14090BF60;
if ( !qword_14090BF60 )
{
v9 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v6 = qword_14090BF60;
}
FMODAudioEngine::fadeInMusic(v6, 2.0);
v5 = (double *)(a1 + 976);
}
}
}
if ( !*(_QWORD *)(a1 + 12912) )
goto LABEL_23;
if ( *(_BYTE *)(a1 + 13024) )
{
if ( !*(_BYTE *)(a1 + 13025) )
goto LABEL_21;
v5 = (double *)(a1 + 976);
}
GJBaseGameLayer::pauseAudio(v4, v3);
GJBaseGameLayer::processActivatedAudioTriggers((_QWORD *)a1, *v5);
LABEL_21:
if ( !cocos2d::CCDictionary::objectForKey(
*(cocos2d::CCDictionary **)(a1 + 14896),
*(unsigned int *)(*(_QWORD *)(a1 + 12912) + 924LL)) )
{
Checkpoint = (struct cocos2d::CCObject *)PlayLayer::createCheckpoint(a1);
cocos2d::CCDictionary::setObject(
*(cocos2d::CCDictionary **)(a1 + 14896),
Checkpoint,
*(unsigned int *)(*(_QWORD *)(a1 + 12912) + 924LL));
}
LABEL_23:
*(_BYTE *)(a1 + 15560) = 0;
*(_BYTE *)(a1 + 14438) = 1;
}
}
}
}