//
// PauseLayer::tryQuit from 0x48fbb0 to 0x48fc78 (200 bytes)
//
// 2 xrefs:
// > PauseLayer::keyDown @ 0x48fcfa
// > PauseLayer::keyBackClicked @ 0x48fd38
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:49:36 +0000
//
int __fastcall PauseLayer::tryQuit(PauseLayer *this, cocos2d::CCObject *a2)
{
int v2; // r5
GameManager *v6; // r0
GameManager *v7; // r0
int *v8; // r4
int v9[3]; // [sp+8h] [bp-14h] BYREF
v2 = *((unsigned __int8 *)this + 462);
if ( *((_BYTE *)this + 462) )
{
*((_BYTE *)this + 461) = 0;
return PauseLayer::onToggleUI(this, nullptr);
}
else
{
v6 = *((GameManager **)this + 120);
if ( v6 && (v6 = (GameManager *)(*(int (__fastcall **)(GameManager *))(*(_DWORD *)v6 + 176))(v6)) != nullptr )
{
return (*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 120) + 172))(*((_DWORD *)this + 120), v2);
}
else
{
v7 = (GameManager *)GameManager::sharedState(v6);
if ( GameManager::getGameVariable(v7, "0167") )
{
memset(v9, 0, sizeof(v9));
std::string::__init(v9, "Are you sure you want to exit?", 0x26u);
v8 = FLAlertLayer::create(
(int)this + 444,
(cocos2d::CCLabelBMFont *)"Exit Level",
(int)v9,
(ButtonSprite *)"Cancel",
(ButtonSprite *)"Exit",
300.0);
std::string::~string((int)v9);
(*(void (__fastcall **)(int *, _DWORD))(*v8 + 36))(v8, 0);
return (*(int (__fastcall **)(int *))(*v8 + 656))(v8);
}
else
{
return PauseLayer::onQuit(this, a2);
}
}
}
}