//
// PauseLayer::onQuit from 0x14037ebc0 to 0x14037ed02 (322 bytes)
//
// 3 xrefs:
// > PauseLayer::tryQuit @ 0x14037eb4b
// > PauseLayer::FLAlert_Clicked @ 0x14037eba4
// > ??> @ 0x1406d5dec
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=3
void PauseLayer::onQuit(PauseLayer *a1, cocos2d::CCObject *a2)
{
__int64 v3; // rax
cocos2d::CCTouchDispatcher *v4; // rax
__int64 v5; // rcx
__int64 v6; // r8
__int64 v7; // r9
int v8; // ecx
__int128 v9; // [rsp+30h] [rbp-28h] BYREF
__int64 v10; // [rsp+40h] [rbp-18h]
__int64 v11; // [rsp+48h] [rbp-10h]
FMODAudioEngine *v12; // [rsp+60h] [rbp+8h]
void *v13; // [rsp+68h] [rbp+10h]
if ( a1->m_forcePrioRegistered )
{
a1->m_forcePrioRegistered = 0;
v3 = cocos2d::CCDirector::sharedDirector(a1);
v4 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 144LL))(v3);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v4, a1);
}
cocos2d::CCNode::unscheduleAllSelectors(a1);
v5 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v13 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v5 = qword_1406C2ED8;
}
PlayLayer::onQuit(*(PlayLayer **)(v5 + 520));
v9 = 0;
*(_QWORD *)&v9 = sub_14003AA10(0x20u);
v10 = 16;
v11 = 31;
strcpy((char *)v9, "quitSound_01.ogg");
v8 = qword_1406C2E88;
if ( !qword_1406C2E88 )
{
v12 = (FMODAudioEngine *)operator new(0x888u);
qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);
v8 = qword_1406C2E88;
}
FMODAudioEngine::playEffect(v8, (__int64)&v9, v6, v7, 1060320051);
}