//
// UILayer::onPause from 0x140672f30 to 0x140673045 (277 bytes)
//
// 4 xrefs:
// > UILayer::handleAction @ 0x14067166a
// > UILayer::keyBackClicked @ 0x140672e9b
// > UILayer::init @ 0x1406701f2
// > ??> @ 0x140932354
//
// 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 11:35:55 +0000
//
// Hidden C++ exception states: #wind=5
__int64 __fastcall UILayer::onPause(__int64 a1)
{
__int64 result; // rax
__int64 v3; // rcx
_BYTE *v4; // rcx
__int64 v5; // rax
void *v6; // [rsp+40h] [rbp+18h]
void *v7; // [rsp+40h] [rbp+18h]
void *v8; // [rsp+40h] [rbp+18h]
result = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v6 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v6);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
result = qword_14090BFD0;
}
v3 = *(_QWORD *)(result + 560);
if ( !v3 || *(int *)(v3 + 2156) <= 2 )
{
*(_QWORD *)(a1 + 584) = -1;
UILayer::resetUINodeState(a1);
result = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v7 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
result = qword_14090BFD0;
}
v4 = *(_BYTE **)(result + 560);
if ( v4 )
{
PlayLayer::pauseGame(v4, 0);
v5 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v8 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v5 = qword_14090BFD0;
}
result = *(_QWORD *)(v5 + 560);
++*(_DWORD *)(result + 2156);
}
}
return result;
}