//
// PauseLayer::tryQuit from 0x7d6794 to 0x7d6900 (364 bytes)
//
// 5 xrefs:
// > PauseLayer::keyDown @ 0x7d69b0
// > PauseLayer::keyBackClicked @ 0x7d69f8
// > ??> @ 0xe6bd8
// > PauseLayer::customSetup @ 0x7d84b8
// > ??> @ 0x1546f30
//
// 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:54:21 +0000
//
__int64 __fastcall PauseLayer::tryQuit(PauseLayer *this, cocos2d::CCObject *a2)
{
GameManager *v4; // x0
GameManager *v6; // x0
__int64 v7; // x20
__int64 v8[2]; // [xsp+30h] [xbp+30h] BYREF
void *v9; // [xsp+40h] [xbp+40h]
if ( *((_BYTE *)this + 586) )
{
*((_BYTE *)this + 585) = 0;
PauseLayer::onToggleUI(this, nullptr);
}
else
{
v4 = *((GameManager **)this + 78);
if ( v4
&& (v4 = (GameManager *)(*(unsigned __int8 (__fastcall **)(GameManager *))(*(_QWORD *)v4 + 352LL))(v4), (_BYTE)v4) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 78) + 344LL))(*((_QWORD *)this + 78), 0);
}
else
{
v6 = (GameManager *)GameManager::sharedState(v4);
if ( (unsigned __int8)GameManager::getGameVariable(v6, "0167") )
{
v8[0] = 0;
v8[1] = 0;
v9 = nullptr;
std::string::__init(v8, "Are you sure you want to exit?", 0x26u);
v7 = FLAlertLayer::create(
(__int64)this + 552,
(cocos2d::CCLabelBMFont *)"Exit Level",
(char *)v8,
(ButtonSprite *)"Cancel",
(ButtonSprite *)"Exit",
300.0);
if ( (v8[0] & 1) != 0 )
operator delete(v9);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v7 + 72LL))(v7, 0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v7 + 1312LL))(v7);
}
else
{
PauseLayer::onQuit(this, a2);
}
}
}
return _stack_chk_guard;
}