{"type": "func", "start": 5372617664, "end": 5372618304, "name": "PlayLayer::resumeAndRestart", "pseudocode": "// \n// PlayLayer::resumeAndRestart from 0x1403ba3c0 to 0x1403ba640 (640 bytes)\n// \n// 3 xrefs:\n// > PauseLayer::onRestart @ 0x14037e48b\n// > PauseLayer::onRestartFull @ 0x14037e52b\n// > <???> @ 0x1406d70e8\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\n// local variable allocation has failed, the output may be wrong!\n// Hidden C++ exception states: #wind=5\nvoid PlayLayer::resumeAndRestart(PlayLayer *a1, bool a2)\n{\n  FMODAudioEngine *v4; // rcx\n  FMODAudioEngine *v5; // rcx\n  __int64 v6; // rax\n  __int64 v7; // rdx\n  __int64 v8; // rcx\n  UILayer *m_uiLayer; // rcx\n  __int64 v10; // rcx\n  GameManager *v11; // rcx\n  __int64 v12; // rcx\n  cocos2d::CCEGLView *v13; // rax\n  GameManager *v14; // rcx\n  __int64 v15; // rcx\n  cocos2d::CCEGLView *v16; // rax\n  FMODAudioEngine *v17; // [rsp+30h] [rbp+8h]\n  FMODAudioEngine *v18; // [rsp+30h] [rbp+8h]\n  FMODAudioEngine *v19; // [rsp+30h] [rbp+8h]\n  void *v20; // [rsp+30h] [rbp+8h]\n  void *v21; // [rsp+30h] [rbp+8h]\n\n  if ( !a1->m_isPracticeMode || a1->m_practiceMusicSync )\n  {\n    if ( a2 || !a1->m_isPlatformer )\n    {\n      GJBaseGameLayer::resetAudio(a1);\n    }\n    else\n    {\n      v4 = (FMODAudioEngine *)qword_1406C2E88;\n      if ( !qword_1406C2E88 )\n      {\n        v17 = (FMODAudioEngine *)operator new(0x888u);\n        qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v17);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n        v4 = (FMODAudioEngine *)qword_1406C2E88;\n      }\n      FMODAudioEngine::stopAllEffects(v4);\n      v5 = (FMODAudioEngine *)qword_1406C2E88;\n      if ( !qword_1406C2E88 )\n      {\n        v18 = (FMODAudioEngine *)operator new(0x888u);\n        qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v18);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n        v5 = (FMODAudioEngine *)qword_1406C2E88;\n      }\n      FMODAudioEngine::stopAllMusic(v5, 0);\n    }\n    a1->m_musicPrepared = 0;\n    v6 = qword_1406C2E88;\n    if ( !qword_1406C2E88 )\n    {\n      v19 = (FMODAudioEngine *)operator new(0x888u);\n      qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v19);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n      v6 = qword_1406C2E88;\n    }\n    a1->m_isSilent = *(float *)(v6 + 512) <= 0.0;\n  }\n  a1->m_isPaused = 0;\n  if ( *(_BYTE *)(cocos2d::CCApplication::sharedApplication(a1, a2) + 217) )\n  {\n    *(_BYTE *)(cocos2d::CCApplication::sharedApplication(v8, v7) + 217) = 0;\n    PlayerObject::releaseAllButtons(a1->m_player1);\n    m_uiLayer = a1->m_uiLayer;\n    *(_QWORD *)&m_uiLayer->m_p1TouchId = -1;\n    *(_WORD *)&m_uiLayer->m_p1Jumping = 0;\n    m_uiLayer->m_checkpointBtnDown = 0;\n    UILayer::resetUINodeState(m_uiLayer);\n    UILayer::toggleMenuVisibility(a1->m_uiLayer, 1);\n    *(_BYTE *)(cocos2d::CCEGLView::sharedOpenGLView(v10) + 237) = 1;\n    v11 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v20 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v20);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v11 = (GameManager *)qword_1406C2ED8;\n    }\n    if ( GameManager::getGameVariable(v11, \"0128\") )\n    {\n      v13 = (cocos2d::CCEGLView *)cocos2d::CCEGLView::sharedOpenGLView(v12);\n      cocos2d::CCEGLView::toggleLockCursor(v13, 1);\n    }\n    else\n    {\n      v14 = (GameManager *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v21 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v21);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v14 = (GameManager *)qword_1406C2ED8;\n      }\n      if ( !GameManager::getGameVariable(v14, \"0024\") )\n      {\n        v16 = (cocos2d::CCEGLView *)cocos2d::CCEGLView::sharedOpenGLView(v15);\n        cocos2d::CCEGLView::showCursor(v16, 0);\n      }\n    }\n    a1->onEnter(a1);\n    if ( a2 )\n      PlayLayer::resetLevelFromStart(a1);\n    else\n      a1->resetLevel(a1);\n  }\n}", "assembly": "; \n; PlayLayer::resumeAndRestart from 0x1403ba3c0 to 0x1403ba640 (640 bytes)\n; \n; 3 xrefs:\n; > PauseLayer::onRestart @ 0x14037e48b\n; > PauseLayer::onRestartFull @ 0x14037e52b\n; > <???> @ 0x1406d70e8\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1403ba3c0\npush    rdi                                                            ; +0x5, 0x1403ba3c5\nsub     rsp, 20h                                                       ; +0x6, 0x1403ba3c6\nmovzx   edi, dl                                                        ; +0xa, 0x1403ba3ca\nmov     rbx, rcx                                                       ; +0xd, 0x1403ba3cd\ncmp     byte ptr [rcx+31F0h], 0                                        ; +0x10, 0x1403ba3d0\njz      short loc_1403BA3E6                                            ; +0x17, 0x1403ba3d7\ncmp     byte ptr [rcx+31F1h], 0                                        ; +0x19, 0x1403ba3d9\njz      loc_1403BA4DA                                                  ; +0x20, 0x1403ba3e0\ntest    dil, dil                                                       ; +0x26, 0x1403ba3e6\njnz     loc_1403BA480                                                  ; +0x29, 0x1403ba3e9\ncmp     [rcx+309Eh], dil                                               ; +0x2f, 0x1403ba3ef\njz      loc_1403BA480                                                  ; +0x36, 0x1403ba3f6\nmov     rcx, cs:qword_1406C2E88                                        ; +0x3c, 0x1403ba3fc\ntest    rcx, rcx                                                       ; +0x43, 0x1403ba403\njnz     short loc_1403BA437                                            ; +0x46, 0x1403ba406\nmov     ecx, 888h; Size                                                ; +0x48, 0x1403ba408\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x4d, 0x1403ba40d\nmov     [rsp+28h+arg_0], rax                                           ; +0x52, 0x1403ba412\nmov     rcx, rax                                                       ; +0x57, 0x1403ba417\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x5a, 0x1403ba41a\nnop                                                                    ; +0x5f, 0x1403ba41f\nmov     cs:qword_1406C2E88, rax                                        ; +0x60, 0x1403ba420\nmov     rdx, [rax]                                                     ; +0x67, 0x1403ba427\nmov     rcx, rax                                                       ; +0x6a, 0x1403ba42a\ncall    qword ptr [rdx+48h]                                            ; +0x6d, 0x1403ba42d\nmov     rcx, cs:qword_1406C2E88                                        ; +0x70, 0x1403ba430\ncall    FMODAudioEngine__stopAllEffects                                ; +0x77, 0x1403ba437\nmov     rcx, cs:qword_1406C2E88                                        ; +0x7c, 0x1403ba43c\ntest    rcx, rcx                                                       ; +0x83, 0x1403ba443\njnz     short loc_1403BA477                                            ; +0x86, 0x1403ba446\nmov     ecx, 888h; Size                                                ; +0x88, 0x1403ba448\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x8d, 0x1403ba44d\nmov     [rsp+28h+arg_0], rax                                           ; +0x92, 0x1403ba452\nmov     rcx, rax                                                       ; +0x97, 0x1403ba457\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x9a, 0x1403ba45a\nnop                                                                    ; +0x9f, 0x1403ba45f\nmov     cs:qword_1406C2E88, rax                                        ; +0xa0, 0x1403ba460\nmov     rdx, [rax]                                                     ; +0xa7, 0x1403ba467\nmov     rcx, rax                                                       ; +0xaa, 0x1403ba46a\ncall    qword ptr [rdx+48h]                                            ; +0xad, 0x1403ba46d\nmov     rcx, cs:qword_1406C2E88                                        ; +0xb0, 0x1403ba470\nxor     edx, edx                                                       ; +0xb7, 0x1403ba477\ncall    FMODAudioEngine__stopAllMusic                                  ; +0xb9, 0x1403ba479\njmp     short loc_1403BA485                                            ; +0xbe, 0x1403ba47e\ncall    GJBaseGameLayer__resetAudio                                    ; +0xc0, 0x1403ba480\nmov     byte ptr [rbx+3A70h], 0                                        ; +0xc5, 0x1403ba485\nmov     rax, cs:qword_1406C2E88                                        ; +0xcc, 0x1403ba48c\ntest    rax, rax                                                       ; +0xd3, 0x1403ba493\njnz     short loc_1403BA4C7                                            ; +0xd6, 0x1403ba496\nmov     ecx, 888h; Size                                                ; +0xd8, 0x1403ba498\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xdd, 0x1403ba49d\nmov     [rsp+28h+arg_0], rax                                           ; +0xe2, 0x1403ba4a2\nmov     rcx, rax                                                       ; +0xe7, 0x1403ba4a7\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0xea, 0x1403ba4aa\nnop                                                                    ; +0xef, 0x1403ba4af\nmov     cs:qword_1406C2E88, rax                                        ; +0xf0, 0x1403ba4b0\nmov     rdx, [rax]                                                     ; +0xf7, 0x1403ba4b7\nmov     rcx, rax                                                       ; +0xfa, 0x1403ba4ba\ncall    qword ptr [rdx+48h]                                            ; +0xfd, 0x1403ba4bd\nmov     rax, cs:qword_1406C2E88                                        ; +0x100, 0x1403ba4c0\nxorps   xmm0, xmm0                                                     ; +0x107, 0x1403ba4c7\ncomiss  xmm0, dword ptr [rax+200h]                                     ; +0x10a, 0x1403ba4ca\nsetnb   al                                                             ; +0x111, 0x1403ba4d1\nmov     [rbx+38B0h], al                                                ; +0x114, 0x1403ba4d4\nmov     byte ptr [rbx+39EFh], 0                                        ; +0x11a, 0x1403ba4da\ncall    cs:?sharedApplication@CCApplication@cocos2d@@SAPEAV12@XZ; cocos2d::CCApplication::sharedApplication(void) ; +0x121, 0x1403ba4e1\ncmp     byte ptr [rax+0D9h], 0                                         ; +0x127, 0x1403ba4e7\njz      loc_1403BA635                                                  ; +0x12e, 0x1403ba4ee\ncall    cs:?sharedApplication@CCApplication@cocos2d@@SAPEAV12@XZ; cocos2d::CCApplication::sharedApplication(void) ; +0x134, 0x1403ba4f4\nmov     byte ptr [rax+0D9h], 0                                         ; +0x13a, 0x1403ba4fa\nmov     rcx, [rbx+0DA0h]                                               ; +0x141, 0x1403ba501\ncall    PlayerObject__releaseAllButtons                                ; +0x148, 0x1403ba508\nmov     rcx, [rbx+3540h]                                               ; +0x14d, 0x1403ba50d\nmov     qword ptr [rcx+248h], 0FFFFFFFFFFFFFFFFh                       ; +0x154, 0x1403ba514\nmov     word ptr [rcx+242h], 0                                         ; +0x15f, 0x1403ba51f\nmov     byte ptr [rcx+244h], 0                                         ; +0x168, 0x1403ba528\ncall    UILayer__resetUINodeState                                      ; +0x16f, 0x1403ba52f\nmov     dl, 1                                                          ; +0x174, 0x1403ba534\nmov     rcx, [rbx+3540h]                                               ; +0x176, 0x1403ba536\ncall    UILayer__toggleMenuVisibility                                  ; +0x17d, 0x1403ba53d\ncall    cs:?sharedOpenGLView@CCEGLView@cocos2d@@SAPEAV12@XZ; cocos2d::CCEGLView::sharedOpenGLView(void) ; +0x182, 0x1403ba542\nmov     byte ptr [rax+0EDh], 1                                         ; +0x188, 0x1403ba548\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x18f, 0x1403ba54f\ntest    rcx, rcx                                                       ; +0x196, 0x1403ba556\njnz     short loc_1403BA58A                                            ; +0x199, 0x1403ba559\nmov     ecx, 668h; Size                                                ; +0x19b, 0x1403ba55b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1a0, 0x1403ba560\nmov     [rsp+28h+arg_0], rax                                           ; +0x1a5, 0x1403ba565\nmov     rcx, rax                                                       ; +0x1aa, 0x1403ba56a\ncall    sub_14017AB00                                                  ; +0x1ad, 0x1403ba56d\nnop                                                                    ; +0x1b2, 0x1403ba572\nmov     cs:qword_1406C2ED8, rax                                        ; +0x1b3, 0x1403ba573\nmov     rdx, [rax]                                                     ; +0x1ba, 0x1403ba57a\nmov     rcx, rax                                                       ; +0x1bd, 0x1403ba57d\ncall    qword ptr [rdx+48h]                                            ; +0x1c0, 0x1403ba580\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x1c3, 0x1403ba583\nlea     rdx, a0128; \"0128\"                                             ; +0x1ca, 0x1403ba58a\ncall    GameManager__getGameVariable                                   ; +0x1d1, 0x1403ba591\ntest    al, al                                                         ; +0x1d6, 0x1403ba596\njz      short loc_1403BA5AD                                            ; +0x1d8, 0x1403ba598\ncall    cs:?sharedOpenGLView@CCEGLView@cocos2d@@SAPEAV12@XZ; cocos2d::CCEGLView::sharedOpenGLView(void) ; +0x1da, 0x1403ba59a\nmov     rcx, rax                                                       ; +0x1e0, 0x1403ba5a0\nmov     dl, 1                                                          ; +0x1e3, 0x1403ba5a3\ncall    cs:?toggleLockCursor@CCEGLView@cocos2d@@QEAAX_N@Z; cocos2d::CCEGLView::toggleLockCursor(bool) ; +0x1e5, 0x1403ba5a5\njmp     short loc_1403BA609                                            ; +0x1eb, 0x1403ba5ab\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x1ed, 0x1403ba5ad\ntest    rcx, rcx                                                       ; +0x1f4, 0x1403ba5b4\njnz     short loc_1403BA5E8                                            ; +0x1f7, 0x1403ba5b7\nmov     ecx, 668h; Size                                                ; +0x1f9, 0x1403ba5b9\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1fe, 0x1403ba5be\nmov     [rsp+28h+arg_0], rax                                           ; +0x203, 0x1403ba5c3\nmov     rcx, rax                                                       ; +0x208, 0x1403ba5c8\ncall    sub_14017AB00                                                  ; +0x20b, 0x1403ba5cb\nnop                                                                    ; +0x210, 0x1403ba5d0\nmov     cs:qword_1406C2ED8, rax                                        ; +0x211, 0x1403ba5d1\nmov     rdx, [rax]                                                     ; +0x218, 0x1403ba5d8\nmov     rcx, rax                                                       ; +0x21b, 0x1403ba5db\ncall    qword ptr [rdx+48h]                                            ; +0x21e, 0x1403ba5de\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x221, 0x1403ba5e1\nlea     rdx, a0024; \"0024\"                                             ; +0x228, 0x1403ba5e8\ncall    GameManager__getGameVariable                                   ; +0x22f, 0x1403ba5ef\ntest    al, al                                                         ; +0x234, 0x1403ba5f4\njnz     short loc_1403BA609                                            ; +0x236, 0x1403ba5f6\ncall    cs:?sharedOpenGLView@CCEGLView@cocos2d@@SAPEAV12@XZ; cocos2d::CCEGLView::sharedOpenGLView(void) ; +0x238, 0x1403ba5f8\nmov     rcx, rax                                                       ; +0x23e, 0x1403ba5fe\nxor     edx, edx                                                       ; +0x241, 0x1403ba601\ncall    cs:?showCursor@CCEGLView@cocos2d@@QEAAX_N@Z; cocos2d::CCEGLView::showCursor(bool) ; +0x243, 0x1403ba603\nmov     rax, [rbx]                                                     ; +0x249, 0x1403ba609\nmov     rcx, rbx                                                       ; +0x24c, 0x1403ba60c\ncall    qword ptr [rax+2A8h]                                           ; +0x24f, 0x1403ba60f\nmov     rcx, rbx                                                       ; +0x255, 0x1403ba615\ntest    dil, dil                                                       ; +0x258, 0x1403ba618\njz      short loc_1403BA62C                                            ; +0x25b, 0x1403ba61b\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x25d, 0x1403ba61d\nadd     rsp, 20h                                                       ; +0x262, 0x1403ba622\npop     rdi                                                            ; +0x266, 0x1403ba626\njmp     PlayLayer__resetLevelFromStart                                 ; +0x267, 0x1403ba627\nmov     rax, [rbx]                                                     ; +0x26c, 0x1403ba62c\ncall    qword ptr [rax+580h]                                           ; +0x26f, 0x1403ba62f\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x275, 0x1403ba635\nadd     rsp, 20h                                                       ; +0x27a, 0x1403ba63a\npop     rdi                                                            ; +0x27e, 0x1403ba63e\nretn                                                                   ; +0x27f, 0x1403ba63f", "xrefs": ["PauseLayer::onRestart @ 0x14037e48b", "PauseLayer::onRestartFull @ 0x14037e52b", "<???> @ 0x1406d70e8"], "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"}