{"type": "func", "start": 4299956064, "end": 4299956266, "name": "EndLevelLayer::onMenu", "pseudocode": "// \n// EndLevelLayer::onMenu from 0x1004c1f60 to 0x1004c202a (202 bytes)\n// \n// 5 xrefs:\n// > EndLevelLayer::keyBackClicked @ 0x1004c31b5\n// > sub_1004C31C0 @ 0x1004c31cc\n// > EndLevelLayer::keyDown @ 0x1004c398b\n// > sub_1004C3990 @ 0x1004c39d2\n// > EndLevelLayer::customSetup @ 0x1004c0f8b\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid __fastcall EndLevelLayer::onMenu(EndLevelLayer *a1, cocos2d::CCObject *a2)\n{\n  PlayLayer *m_playLayer; // rdi\n  GameManager *v4; // rax\n  FMODAudioEngine *v5; // rax\n  void *v6[4]; // [rsp+0h] [rbp-20h] BYREF\n\n  if ( !a1->m_exiting )\n  {\n    a1->m_exiting = 1;\n    m_playLayer = a1->m_playLayer;\n    if ( m_playLayer->m_endLayerStars || a1->m_animateCoins || m_playLayer->m_orbs > 0 || m_playLayer->m_diamonds > 0 )\n    {\n      v4 = GameManager::sharedState();\n      GameManager::doQuickSave(v4);\n      m_playLayer = a1->m_playLayer;\n    }\n    PlayLayer::onQuit(m_playLayer);\n    a1->m_playLayer = nullptr;\n    ((void (__fastcall *)(EndLevelLayer *, _QWORD))a1->exitLayer)(a1, 0);\n    v5 = FMODAudioEngine::sharedEngine();\n    strcpy((char *)v6, \" quitSound_01.ogg\");\n    FMODAudioEngine::playEffect((__int64)v5, (__int64)v6, (__m128)0x3F800000u, 0.0, 0.69999999);\n    if ( ((__int64)v6[0] & 1) != 0 )\n      operator delete(v6[2]);\n  }\n}", "assembly": "; \n; EndLevelLayer::onMenu from 0x1004c1f60 to 0x1004c202a (202 bytes)\n; \n; 5 xrefs:\n; > EndLevelLayer::keyBackClicked @ 0x1004c31b5\n; > sub_1004C31C0 @ 0x1004c31cc\n; > EndLevelLayer::keyDown @ 0x1004c398b\n; > sub_1004C3990 @ 0x1004c39d2\n; > EndLevelLayer::customSetup @ 0x1004c0f8b\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\npush    rbp                                                            ; +0x0, 0x1004c1f60\nmov     rbp, rsp                                                       ; +0x1, 0x1004c1f61\npush    rbx                                                            ; +0x4, 0x1004c1f64\nsub     rsp, 18h                                                       ; +0x5, 0x1004c1f65\ncmp     byte ptr [rdi+26Bh], 0                                         ; +0x9, 0x1004c1f69\njnz     loc_1004C2023                                                  ; +0x10, 0x1004c1f70\nmov     rbx, rdi                                                       ; +0x16, 0x1004c1f76\nmov     byte ptr [rdi+26Bh], 1                                         ; +0x19, 0x1004c1f79\nmov     rdi, [rdi+260h]                                                ; +0x20, 0x1004c1f80\ncmp     byte ptr [rdi+373Ch], 0                                        ; +0x27, 0x1004c1f87\njnz     short loc_1004C1FAB                                            ; +0x2e, 0x1004c1f8e\ncmp     byte ptr [rbx+26Ch], 0                                         ; +0x30, 0x1004c1f90\njnz     short loc_1004C1FAB                                            ; +0x37, 0x1004c1f97\ncmp     dword ptr [rdi+3740h], 0                                       ; +0x39, 0x1004c1f99\njg      short loc_1004C1FAB                                            ; +0x40, 0x1004c1fa0\ncmp     dword ptr [rdi+3744h], 0                                       ; +0x42, 0x1004c1fa2\njle     short loc_1004C1FBF                                            ; +0x49, 0x1004c1fa9\ncall    GameManager__sharedState                                       ; +0x4b, 0x1004c1fab\nmov     rdi, rax                                                       ; +0x50, 0x1004c1fb0\ncall    GameManager__doQuickSave                                       ; +0x53, 0x1004c1fb3\nmov     rdi, [rbx+260h]                                                ; +0x58, 0x1004c1fb8\ncall    PlayLayer__onQuit                                              ; +0x5f, 0x1004c1fbf\nmov     qword ptr [rbx+260h], 0                                        ; +0x64, 0x1004c1fc4\nmov     rax, [rbx]                                                     ; +0x6f, 0x1004c1fcf\nmov     rdi, rbx                                                       ; +0x72, 0x1004c1fd2\nxor     esi, esi                                                       ; +0x75, 0x1004c1fd5\ncall    qword ptr [rax+518h]                                           ; +0x77, 0x1004c1fd7\ncall    FMODAudioEngine__sharedEngine                                  ; +0x7d, 0x1004c1fdd\nmov     [rbp+var_20], 20h ; ' '                                        ; +0x82, 0x1004c1fe2\nmovups  xmm0, xmmword ptr cs:aQuitsound01Ogg; \"quitSound_01.ogg\"       ; +0x86, 0x1004c1fe6\nmovups  xmmword ptr [rbp+var_20+1], xmm0                               ; +0x8d, 0x1004c1fed\nmov     [rbp+var_20+11h], 0                                            ; +0x91, 0x1004c1ff1\nlea     rsi, [rbp+var_20]                                              ; +0x95, 0x1004c1ff5\nmovss   xmm0, cs:alpha                                                 ; +0x99, 0x1004c1ff9\nmovss   xmm2, cs:dword_100814FC4                                       ; +0xa1, 0x1004c2001\nxorps   xmm1, xmm1                                                     ; +0xa9, 0x1004c2009\nmov     rdi, rax                                                       ; +0xac, 0x1004c200c\ncall    FMODAudioEngine__playEffect                                    ; +0xaf, 0x1004c200f\ntest    [rbp+var_20], 1                                                ; +0xb4, 0x1004c2014\njz      short loc_1004C2023                                            ; +0xb8, 0x1004c2018\nmov     rdi, qword ptr [rbp+var_20+10h]; __p                           ; +0xba, 0x1004c201a\ncall    __ZdlPv; operator delete(void *)                               ; +0xbe, 0x1004c201e\nadd     rsp, 18h                                                       ; +0xc3, 0x1004c2023\npop     rbx                                                            ; +0xc7, 0x1004c2027\npop     rbp                                                            ; +0xc8, 0x1004c2028\nretn                                                                   ; +0xc9, 0x1004c2029", "xrefs": ["EndLevelLayer::keyBackClicked @ 0x1004c31b5", "sub_1004C31C0 @ 0x1004c31cc", "EndLevelLayer::keyDown @ 0x1004c398b", "sub_1004C3990 @ 0x1004c39d2", "EndLevelLayer::customSetup @ 0x1004c0f8b"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}