//
// PauseLayer::tryQuit from 0x1003c1390 to 0x1003c14ba (298 bytes)
//
// 4 xrefs:
// > PauseLayer::keyDown @ 0x1003c33d0
// > PauseLayer::keyBackClicked @ 0x1003c34b9
// > sub_1003C34C0 @ 0x1003c34e0
// > PauseLayer::customSetup @ 0x1003bfc32
//
// This function is hookable on this platform (idp: pc, 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:29:33 +0000
//
__int64 __fastcall PauseLayer::tryQuit(__int64 a1)
{
__int64 v3; // rdi
__int64 v4; // rax
__int64 v5; // rbx
_QWORD v6[2]; // [rsp+0h] [rbp-20h] BYREF
void *__p; // [rsp+10h] [rbp-10h]
if ( *(_BYTE *)(a1 + 586) == 1 )
{
*(_BYTE *)(a1 + 585) = 0;
return sub_1003C1980();
}
else
{
v3 = *(_QWORD *)(a1 + 624);
if ( v3 && (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v3 + 352LL))(v3) )
{
return (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 624) + 344LL))(*(_QWORD *)(a1 + 624), 0);
}
else
{
v4 = GameManager::sharedState();
if ( (unsigned __int8)GameManager::getGameVariable(v4, "0167") )
{
__p = operator new(0x28u);
v6[0] = 41;
v6[1] = 38;
strcpy((char *)__p, "Are you sure you want to exit?");
v5 = FLAlertLayer::create_1(a1 + 552, "Exit Level", v6, "Cancel", "Exit", 300.0);
if ( (v6[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v5 + 72LL))(v5, 0);
return (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 1312LL))(v5);
}
else
{
return PauseLayer::onQuit(a1);
}
}
}
}