//
// PlayLayer::onQuit from 0x1001421b8 to 0x100142288 (208 bytes)
//
// 7 xrefs:
// > PlayLayer::setupHasCompleted @ 0x100140024
// > PlayLayer::levelComplete @ 0x100142bd4
// > PlayLayer::postUpdate @ 0x100148a90
// > PauseLayer::onQuit @ 0x1001c1134
// > sub_1002487E0 @ 0x1002487fc
// > sub_100393BF4 @ 0x100393c54
// > PlayLayer::setupHasCompleted @ 0x10013ff98
//
// 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 10:59:32 +0000
//
__int64 __fastcall PlayLayer::onQuit(__int64 a1)
{
__int64 v2; // x9
__int64 v3; // x8
__int64 v4; // x0
__int64 v5; // x0
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x0
__int64 v11; // x0
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__int64 Scene; // x0
__int64 v16; // x0
PlayLayer::writePersistentSave();
if ( *(_BYTE *)(a1 + 12238) == 1 )
{
v2 = *(_QWORD *)(a1 + 1936);
v3 = *(char *)(v2 + 1495);
if ( v3 < 0 )
v3 = *(_QWORD *)(v2 + 1480);
if ( v3 )
{
v4 = GameLevelManager::sharedState();
sub_1000AEF50(v4, *(_QWORD *)(a1 + 1936));
}
}
sub_10051D72C(a1);
v5 = sub_10051D674(a1);
v6 = cocos2d::CCDirector::sharedDirector(v5);
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 128LL))(v6);
*(_DWORD *)(v7 + 56) = 1065353216;
v8 = cocos2d::CCDirector::sharedDirector(v7);
*(_BYTE *)(v8 + 178) = 0;
v9 = GameManager::sharedState(v8);
v10 = sub_1003BAF90(v9);
PlatformToolbox::showCursor(v10);
UILayer::disableMenu(*(_QWORD *)(a1 + 13288));
cocos2d::CCNode::stopActionByTag(a1, 31);
cocos2d::CCNode::stopAllActions(a1);
cocos2d::CCNode::unscheduleAllSelectors(a1);
v11 = GJBaseGameLayer::resetAudio(a1);
v12 = FMODAudioEngine::sharedEngine(v11);
v13 = FMODAudioEngine::unloadAllEffects(v12);
v14 = GameManager::sharedState(v13);
Scene = GameManager::returnToLastScene(v14, *(_QWORD *)(a1 + 1936));
v16 = GameManager::sharedState(Scene);
return GameManager::fadeInMenuMusic(v16);
}