//
// PlayLayer::pauseGame from 0x10014c3d0 to 0x10014c518 (328 bytes)
//
// 2 xrefs:
// > UILayer::doPause @ 0x100052724
// > AppDelegate::pauseGame @ 0x100307158
//
// 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 10:59:37 +0000
//
_BYTE *__fastcall PlayLayer::pauseGame(_BYTE *result, __int64 a2)
{
_BYTE *v2; // x21
__int64 v4; // x19
__int64 v5; // x0
unsigned __int64 v6; // d1
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x20
__int64 v10; // x0
timeb v11; // [xsp+0h] [xbp-30h] BYREF
v2 = result + 12288;
if ( (result[13336] & 1) == 0 && (result[14637] & 1) == 0 )
{
v4 = (__int64)result;
result = (_BYTE *)AppDelegate::get(result);
if ( (result[17] & 1) == 0 )
{
*(_BYTE *)(v4 + 1982) = 1;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v4 + 1472LL))(v4, 1.0);
v2[2463] = 1;
sub_10051D72C(v4);
sub_10051D674(v4);
*(_OWORD *)(v4 + 14664) = 0u;
*(_QWORD *)(v4 + 14680) = 0;
v5 = ftime(&v11);
LOWORD(v6) = v11.millitm;
*(double *)(v4 + 14720) = (double)v6 / 1000.0 + (double)v11.time;
v7 = cocos2d::CCDirector::sharedDirector(v5);
*(_BYTE *)(v7 + 178) = 0;
PlatformToolbox::showCursor(v7);
GJBaseGameLayer::processQueuedButtons(v4, 1, 0.0);
PlayLayer::releaseAllPlayerButtons(v4);
v8 = GJBaseGameLayer::pauseAudio(v4);
GameManager::sharedState(v8);
PlayLayer::releaseAllPlayerButtons(v4);
UILayer::resetAllButtons(*(_QWORD *)(v4 + 13288));
UILayer::toggleMenuVisibility(*(_QWORD *)(v4 + 13288), 0);
v9 = PauseLayer::create(a2);
v10 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 512LL))(v4);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v10 + 464LL))(v10, v9, 10);
return (_BYTE *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 720LL))(v4);
}
}
return result;
}