//
// PlayLayer::startMusic from 0x710ddc to 0x710f18 (316 bytes)
//
// 6 xrefs:
// > PlayLayer::startGame @ 0x710f7c
// > PlayLayer::startGameDelayed @ 0x710fa0
// > PlayLayer::switchToStartPosObject @ 0x711000
// > PlayLayer::switchToStartPosObject @ 0x71101c
// > PlayLayer::resetLevel @ 0x711a84
// > ??> @ 0x96820
//
// 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:52:13 +0000
//
__int64 __fastcall PlayLayer::startMusic(__int64 this)
{
unsigned __int8 *v1; // x20
__int64 v2; // x1
__int64 v3; // x19
FMODAudioEngine *v4; // x0
__int64 v5; // x1
float v6; // s0
FMODAudioEngine *v7; // x0
FMODAudioEngine *v8; // x0
cocos2d::CCObject *Checkpoint; // x0
v1 = (unsigned __int8 *)(this + 12288);
if ( !*(_BYTE *)(this + 12650) )
{
if ( *(_BYTE *)(this + 12664) )
{
v2 = *(_QWORD *)(this + 12432);
v3 = this;
if ( !v2
|| (this = cocos2d::CCDictionary::objectForKey(
*(cocos2d::CCDictionary **)(this + 14240),
*(unsigned int *)(v2 + 916))) == 0 )
{
v4 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine((FMODAudioEngine *)this);
FMODAudioEngine::getBackgroundMusicVolume(v4);
if ( !v1[2592] )
PlayLayer::prepareMusic((PlayLayer *)v3, 0);
GJBaseGameLayer::processQueuedAudioTriggers((GJBaseGameLayer *)v3);
GJBaseGameLayer::updateProximityVolumeEffects((GJBaseGameLayer *)v3);
if ( *(double *)(v3 + 928) <= 0.0 && *(_BYTE *)(*(_QWORD *)(v3 + 3272) + 348LL) )
{
v7 = (FMODAudioEngine *)v1[256];
if ( v1[256] )
{
v7 = (FMODAudioEngine *)v1[257];
if ( !v1[257] )
{
v5 = *(_QWORD *)(v3 + 12432);
if ( !v5 )
goto LABEL_15;
goto LABEL_13;
}
}
v8 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(v7);
FMODAudioEngine::fadeInMusic(v8, 2.0, 0);
}
v5 = *(_QWORD *)(v3 + 12432);
if ( !v5 )
{
LABEL_15:
v1[2592] = 0;
v1[1518] = 1;
return 1;
}
if ( !v1[256] || v1[257] )
{
GJBaseGameLayer::pauseAudio((GJBaseGameLayer *)v3);
v6 = *(double *)(v3 + 928);
GJBaseGameLayer::processActivatedAudioTriggers((GJBaseGameLayer *)v3, v6);
v5 = *(_QWORD *)(v3 + 12432);
}
LABEL_13:
if ( !cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v3 + 14240), *(unsigned int *)(v5 + 916)) )
{
Checkpoint = (cocos2d::CCObject *)PlayLayer::createCheckpoint((PlayerObject **)v3);
cocos2d::CCDictionary::setObject(
*(cocos2d::CCDictionary **)(v3 + 14240),
Checkpoint,
*(unsigned int *)(*(_QWORD *)(v3 + 12432) + 916LL));
}
goto LABEL_15;
}
}
}
return this;
}