{"type": "func", "start": 4298076964, "end": 4298077172, "name": "EndLevelLayer::onMenu", "pseudocode": "// \n// EndLevelLayer::onMenu from 0x1002f7324 to 0x1002f73f4 (208 bytes)\n// \n// 4 xrefs:\n// > EndLevelLayer::keyBackClicked @ 0x1002f8438\n// > sub_1002F843C @ 0x1002f8440\n// > EndLevelLayer::keyDown @ 0x1002f8bb8\n// > EndLevelLayer::customSetup @ 0x1002f64d8\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; // x0\n  GameManager *v4; // x0\n  FMODAudioEngine *v5; // x19\n  void *__p[2]; // [xsp+8h] [xbp-28h] BYREF\n  char v7; // [xsp+1Fh] [xbp-11h]\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 >= 1 )\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    sub_100009900(__p, \"quitSound_01.ogg\");\n    FMODAudioEngine::playEffect((__int64)v5, (__int64)__p, 1.0, 0.0, 0.7);\n    if ( v7 < 0 )\n      operator delete(__p[0]);\n  }\n}", "assembly": "; \n; EndLevelLayer::onMenu from 0x1002f7324 to 0x1002f73f4 (208 bytes)\n; \n; 4 xrefs:\n; > EndLevelLayer::keyBackClicked @ 0x1002f8438\n; > sub_1002F843C @ 0x1002f8440\n; > EndLevelLayer::keyDown @ 0x1002f8bb8\n; > EndLevelLayer::customSetup @ 0x1002f64d8\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\nSUB             SP, SP, #0x40                                          ; +0x0, 0x1002f7324\nSTP             X20, X19, [SP,#0x30+var_10]                            ; +0x4, 0x1002f7328\nSTP             X29, X30, [SP,#0x30+var_s0]                            ; +0x8, 0x1002f732c\nADD             X29, SP, #0x30                                         ; +0xc, 0x1002f7330\nLDRB            W8, [X0,#0x26B]                                        ; +0x10, 0x1002f7334\nTBNZ            W8, #0, loc_1002F73E4                                  ; +0x14, 0x1002f7338\nMOV             X19, X0                                                ; +0x18, 0x1002f733c\nMOV             W8, #1                                                 ; +0x1c, 0x1002f7340\nSTRB            W8, [X0,#0x26B]                                        ; +0x20, 0x1002f7344\nLDR             X0, [X0,#0x260]                                        ; +0x24, 0x1002f7348\nMOV             W8, #0x376C                                            ; +0x28, 0x1002f734c\nLDRB            W8, [X0,X8]                                            ; +0x2c, 0x1002f7350\nTBNZ            W8, #0, loc_1002F7378                                  ; +0x30, 0x1002f7354\nLDRB            W8, [X19,#0x26C]                                       ; +0x34, 0x1002f7358\nTBNZ            W8, #0, loc_1002F7378                                  ; +0x38, 0x1002f735c\nLDR             W8, [X0,#0x3770]                                       ; +0x3c, 0x1002f7360\nCMP             W8, #0                                                 ; +0x40, 0x1002f7364\nB.GT            loc_1002F7378                                          ; +0x44, 0x1002f7368\nLDR             W8, [X0,#0x3774]                                       ; +0x48, 0x1002f736c\nCMP             W8, #1                                                 ; +0x4c, 0x1002f7370\nB.LT            loc_1002F7384                                          ; +0x50, 0x1002f7374\nBL              GameManager__sharedState                               ; +0x54, 0x1002f7378\nBL              GameManager__doQuickSave                               ; +0x58, 0x1002f737c\nLDR             X0, [X19,#0x260]                                       ; +0x5c, 0x1002f7380\nBL              PlayLayer__onQuit                                      ; +0x60, 0x1002f7384\nSTR             XZR, [X19,#0x260]                                      ; +0x64, 0x1002f7388\nLDR             X8, [X19]                                              ; +0x68, 0x1002f738c\nLDR             X8, [X8,#0x518]                                        ; +0x6c, 0x1002f7390\nMOV             X0, X19                                                ; +0x70, 0x1002f7394\nMOV             X1, #0                                                 ; +0x74, 0x1002f7398\nBLR             X8                                                     ; +0x78, 0x1002f739c\nBL              FMODAudioEngine__sharedEngine                          ; +0x7c, 0x1002f73a0\nMOV             X19, X0                                                ; +0x80, 0x1002f73a4\nADRL            X1, aQuitsound01Ogg; \"quitSound_01.ogg\"                ; +0x84, 0x1002f73a8\nADD             X0, SP, #0x30+__p; int                                 ; +0x8c, 0x1002f73b0\nBL              sub_100009900                                          ; +0x90, 0x1002f73b4\nADRP            X8, #dword_100635380@PAGE                              ; +0x94, 0x1002f73b8\nLDR             S2, [X8,#dword_100635380@PAGEOFF]                      ; +0x98, 0x1002f73bc\nADD             X1, SP, #0x30+__p                                      ; +0x9c, 0x1002f73c0\nFMOV            S0, #1.0                                               ; +0xa0, 0x1002f73c4\nFMOV            S1, WZR                                                ; +0xa4, 0x1002f73c8\nMOV             X0, X19                                                ; +0xa8, 0x1002f73cc\nBL              FMODAudioEngine__playEffect                            ; +0xac, 0x1002f73d0\nLDRSB           W8, [SP,#0x30+var_11]                                  ; +0xb0, 0x1002f73d4\nTBZ             W8, #0x1F, loc_1002F73E4                               ; +0xb4, 0x1002f73d8\nLDR             X0, [SP,#0x30+__p]; __p                                ; +0xb8, 0x1002f73dc\nBL              __ZdlPv; operator delete(void *)                       ; +0xbc, 0x1002f73e0\nLDP             X29, X30, [SP,#0x30+var_s0]                            ; +0xc0, 0x1002f73e4\nLDP             X20, X19, [SP,#0x30+var_10]                            ; +0xc4, 0x1002f73e8\nADD             SP, SP, #0x40 ; '@'                                    ; +0xc8, 0x1002f73ec\nRET                                                                    ; +0xcc, 0x1002f73f0", "xrefs": ["EndLevelLayer::keyBackClicked @ 0x1002f8438", "sub_1002F843C @ 0x1002f8440", "EndLevelLayer::keyDown @ 0x1002f8bb8", "EndLevelLayer::customSetup @ 0x1002f64d8"], "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"}