//
// PauseLayer::tryQuit from 0x6c8874 to 0x6c89dc (360 bytes)
//
// 5 xrefs:
// > PauseLayer::keyDown @ 0x6c8a6c
// > PauseLayer::keyBackClicked @ 0x6c8aa4
// > ??> @ 0xb0520
// > PauseLayer::customSetup @ 0x6c7d0c
// > ??> @ 0x122e1a0
//
// 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
//
void PauseLayer::tryQuit(PauseLayer *a1, cocos2d::CCObject *a2)
{
GameManager *v4; // x0
FLAlertLayer *v5; // x20
void *v6; // x0
unsigned int *v7; // x2
int v8; // w1
__int64 v9; // [xsp+40h] [xbp+40h] BYREF
v4 = GameManager::sharedState();
if ( GameManager::getGameVariable(v4, "0167") )
{
sub_D153B8((int)&v9, "Are you sure you want to exit?");
v5 = FLAlertLayer::create((int)a1 + 552, (__int64)"Exit Level", (__int64)&v9);
v6 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v6);
}
v5->setTag(v5, 0);
v5->show(v5);
}
else
{
PauseLayer::onQuit(a1, a2);
}
}