//
// EndLevelLayer::onMenu from 0x8f9990 to 0x8f9aa8 (280 bytes)
//
// 5 xrefs:
// > EndLevelLayer::keyBackClicked @ 0x8f9ab0
// > EndLevelLayer::keyDown @ 0x8fb22c
// > ??> @ 0xcb218
// > EndLevelLayer::customSetup @ 0x8fc554
// > ??> @ 0x1545f60
//
// 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 12:57:02 +0000
//
__int64 __fastcall EndLevelLayer::onMenu(EndLevelLayer *this, cocos2d::CCObject *a2)
{
__int64 v3; // x0
GameManager *v4; // x0
FMODAudioEngine *v5; // x0
__int64 v6; // x0
void *v8[3]; // [xsp+20h] [xbp+20h] BYREF
if ( !*((_BYTE *)this + 619) )
{
v3 = *((_QWORD *)this + 76);
*((_BYTE *)this + 619) = 1;
if ( *(_BYTE *)(v3 + 14644) || *((_BYTE *)this + 620) || *(int *)(v3 + 14648) > 0 || *(int *)(v3 + 14652) > 0 )
{
v4 = (GameManager *)GameManager::sharedState((GameManager *)v3);
GameManager::doQuickSave(v4);
v3 = *((_QWORD *)this + 76);
}
PlayLayer::onQuit((GJGameLevel **)v3);
*((_QWORD *)this + 76) = 0;
v5 = (FMODAudioEngine *)(*(__int64 (__fastcall **)(EndLevelLayer *, _QWORD))(*(_QWORD *)this + 1320LL))(this, 0);
v6 = FMODAudioEngine::sharedEngine(v5);
BYTE1(v8[2]) = 0;
WORD1(v8[2]) = 0;
HIDWORD(v8[2]) = 0;
strcpy((char *)v8, " quitSound_01.og");
FMODAudioEngine::playEffect(v6, (char *)v8, 1.0, 0.0, 0.7);
if ( ((__int64)v8[0] & 1) != 0 )
operator delete(v8[2]);
}
return _stack_chk_guard;
}