{"type": "func", "start": 5372323968, "end": 5372324232, "name": "OptionsLayer::onMenuMusic", "pseudocode": "// \n// OptionsLayer::onMenuMusic from 0x140372880 to 0x140372988 (264 bytes)\n// \n// 2 xrefs:\n// > OptionsLayer::customSetup @ 0x140372828\n// > <???> @ 0x1406d5abc\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// Hidden C++ exception states: #wind=4\nvoid OptionsLayer::onMenuMusic(OptionsLayer *a1, cocos2d::CCObject *a2)\n{\n  __int64 v2; // rbx\n  GameManager *v3; // rcx\n  void *v4; // [rsp+40h] [rbp+18h]\n  FMODAudioEngine *v5; // [rsp+40h] [rbp+18h]\n  void *v6; // [rsp+40h] [rbp+18h]\n\n  if ( !qword_1406C2ED8 )\n  {\n    v4 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00((__int64)v4);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n  }\n  if ( GameManager::toggleGameVariable((GameManager *)a1, \"0122\") )\n  {\n    v2 = qword_1406C2E88;\n    if ( !qword_1406C2E88 )\n    {\n      v5 = (FMODAudioEngine *)operator new(0x888u);\n      qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v5);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n      v2 = qword_1406C2E88;\n    }\n    if ( *(_QWORD *)(v2 + 552) )\n      FMOD::ChannelControl::stop(*(FMOD::ChannelControl **)(v2 + 552));\n    sub_14005E0D0((_QWORD *)(v2 + 1064));\n    sub_14005E0D0((_QWORD *)(v2 + 1128));\n    sub_14005E0D0((_QWORD *)(v2 + 1192));\n  }\n  else\n  {\n    v3 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v6 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v6);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v3 = (GameManager *)qword_1406C2ED8;\n    }\n    GameManager::fadeInMenuMusic(v3);\n  }\n}", "assembly": "; \n; OptionsLayer::onMenuMusic from 0x140372880 to 0x140372988 (264 bytes)\n; \n; 2 xrefs:\n; > OptionsLayer::customSetup @ 0x140372828\n; > <???> @ 0x1406d5abc\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    rbx                                                            ; +0x0, 0x140372880\nsub     rsp, 20h                                                       ; +0x2, 0x140372882\ncmp     cs:qword_1406C2ED8, 0                                          ; +0x6, 0x140372886\njnz     short loc_1403728B8                                            ; +0xe, 0x14037288e\nmov     ecx, 668h; Size                                                ; +0x10, 0x140372890\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x15, 0x140372895\nmov     [rsp+28h+arg_10], rax                                          ; +0x1a, 0x14037289a\nmov     rcx, rax                                                       ; +0x1f, 0x14037289f\ncall    sub_14017AB00                                                  ; +0x22, 0x1403728a2\nnop                                                                    ; +0x27, 0x1403728a7\nmov     cs:qword_1406C2ED8, rax                                        ; +0x28, 0x1403728a8\nmov     rdx, [rax]                                                     ; +0x2f, 0x1403728af\nmov     rcx, rax                                                       ; +0x32, 0x1403728b2\ncall    qword ptr [rdx+48h]                                            ; +0x35, 0x1403728b5\nlea     rdx, a0122; \"0122\"                                             ; +0x38, 0x1403728b8\ncall    GameManager__toggleGameVariable                                ; +0x3f, 0x1403728bf\ntest    al, al                                                         ; +0x44, 0x1403728c4\njz      short loc_140372943                                            ; +0x46, 0x1403728c6\nmov     rbx, cs:qword_1406C2E88                                        ; +0x48, 0x1403728c8\ntest    rbx, rbx                                                       ; +0x4f, 0x1403728cf\njnz     short loc_140372903                                            ; +0x52, 0x1403728d2\nmov     ecx, 888h; Size                                                ; +0x54, 0x1403728d4\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x59, 0x1403728d9\nmov     [rsp+28h+arg_10], rax                                          ; +0x5e, 0x1403728de\nmov     rcx, rax                                                       ; +0x63, 0x1403728e3\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x66, 0x1403728e6\nnop                                                                    ; +0x6b, 0x1403728eb\nmov     cs:qword_1406C2E88, rax                                        ; +0x6c, 0x1403728ec\nmov     rdx, [rax]                                                     ; +0x73, 0x1403728f3\nmov     rcx, rax                                                       ; +0x76, 0x1403728f6\ncall    qword ptr [rdx+48h]                                            ; +0x79, 0x1403728f9\nmov     rbx, cs:qword_1406C2E88                                        ; +0x7c, 0x1403728fc\ncmp     qword ptr [rbx+228h], 0                                        ; +0x83, 0x140372903\njz      short loc_14037291A                                            ; +0x8b, 0x14037290b\nmov     rcx, [rbx+228h]                                                ; +0x8d, 0x14037290d\ncall    cs:?stop@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@XZ; FMOD::ChannelControl::stop(void) ; +0x94, 0x140372914\nlea     rcx, [rbx+428h]                                                ; +0x9a, 0x14037291a\ncall    sub_14005E0D0                                                  ; +0xa1, 0x140372921\nlea     rcx, [rbx+468h]                                                ; +0xa6, 0x140372926\ncall    sub_14005E0D0                                                  ; +0xad, 0x14037292d\nlea     rcx, [rbx+4A8h]                                                ; +0xb2, 0x140372932\nadd     rsp, 20h                                                       ; +0xb9, 0x140372939\npop     rbx                                                            ; +0xbd, 0x14037293d\njmp     sub_14005E0D0                                                  ; +0xbe, 0x14037293e\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xc3, 0x140372943\ntest    rcx, rcx                                                       ; +0xca, 0x14037294a\njnz     short loc_14037297E                                            ; +0xcd, 0x14037294d\nmov     ecx, 668h; Size                                                ; +0xcf, 0x14037294f\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xd4, 0x140372954\nmov     [rsp+28h+arg_10], rax                                          ; +0xd9, 0x140372959\nmov     rcx, rax                                                       ; +0xde, 0x14037295e\ncall    sub_14017AB00                                                  ; +0xe1, 0x140372961\nnop                                                                    ; +0xe6, 0x140372966\nmov     cs:qword_1406C2ED8, rax                                        ; +0xe7, 0x140372967\nmov     rdx, [rax]                                                     ; +0xee, 0x14037296e\nmov     rcx, rax                                                       ; +0xf1, 0x140372971\ncall    qword ptr [rdx+48h]                                            ; +0xf4, 0x140372974\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xf7, 0x140372977\nadd     rsp, 20h                                                       ; +0xfe, 0x14037297e\npop     rbx                                                            ; +0x102, 0x140372982\njmp     GameManager__fadeInMenuMusic                                   ; +0x103, 0x140372983", "xrefs": ["OptionsLayer::customSetup @ 0x140372828", "<???> @ 0x1406d5abc"], "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"}