{"type": "func", "start": 5369088688, "end": 5369088916, "name": "FMODAudioEngine::stopAndRemoveMusic", "pseudocode": "// \n// FMODAudioEngine::stopAndRemoveMusic from 0x14005cab0 to 0x14005cb94 (228 bytes)\n// \n// 6 xrefs:\n// > FMODAudioEngine::triggerQueuedMusic @ 0x14005bc1f\n// > FMODAudioEngine::preloadMusic @ 0x14005c8e4\n// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244113\n// > GJBaseGameLayer::processSongState @ 0x1402456e0\n// > MusicBrowser::onPlaybackControl @ 0x140339ab2\n// > <???> @ 0x1406c5490\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 FMODAudioEngine::stopAndRemoveMusic(FMODAudioEngine *a1, int a2)\n{\n  __int64 v3; // rax\n  FMOD::Channel *v4; // rax\n  _QWORD *v5; // rax\n  std::_Vector_val<std::_Simple_types<FMOD::Sound *>>::pointer Mylast; // rdx\n  std::_Simple_types<FMOD::Sound *>::value_type *v7; // r8\n  _BYTE v8[24]; // [rsp+20h] [rbp-18h] BYREF\n  int v9; // [rsp+48h] [rbp+10h] BYREF\n\n  v9 = a2;\n  if ( sub_14005F8D0(&a1->m_fmodMusic, &v9) )\n  {\n    v3 = sub_140061560(&a1->m_fmodMusic, v8, &v9);\n    v4 = FMODAudioEngine::channelForChannelID(a1, *(_DWORD *)(*(_QWORD *)v3 + 24LL));\n    if ( v4 )\n    {\n      FMOD::ChannelControl::stop(v4);\n    }\n    else\n    {\n      if ( *(_QWORD *)(*(_QWORD *)sub_140061560(&a1->m_fmodMusic, v8, &v9) + 32LL) )\n      {\n        v5 = (_QWORD *)sub_140061560(&a1->m_fmodMusic, v8, &v9);\n        Mylast = a1->m_removedSounds._Mypair._Myval2._Mylast;\n        v7 = (std::_Simple_types<FMOD::Sound *>::value_type *)(*v5 + 32LL);\n        if ( Mylast == a1->m_removedSounds._Mypair._Myval2._Myend )\n        {\n          sub_140063110(&a1->m_removedSounds, Mylast, v7);\n        }\n        else\n        {\n          *Mylast = *v7;\n          ++a1->m_removedSounds._Mypair._Myval2._Mylast;\n        }\n      }\n      sub_14005DA90(&a1->m_fmodMusic, &v9);\n    }\n  }\n}", "assembly": "; \n; FMODAudioEngine::stopAndRemoveMusic from 0x14005cab0 to 0x14005cb94 (228 bytes)\n; \n; 6 xrefs:\n; > FMODAudioEngine::triggerQueuedMusic @ 0x14005bc1f\n; > FMODAudioEngine::preloadMusic @ 0x14005c8e4\n; > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244113\n; > GJBaseGameLayer::processSongState @ 0x1402456e0\n; > MusicBrowser::onPlaybackControl @ 0x140339ab2\n; > <???> @ 0x1406c5490\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_0], rbx                                               ; +0x0, 0x14005cab0\nmov     [rsp+arg_8], edx                                               ; +0x5, 0x14005cab5\npush    rdi                                                            ; +0x9, 0x14005cab9\nsub     rsp, 30h                                                       ; +0xa, 0x14005caba\nmov     rdi, rcx                                                       ; +0xe, 0x14005cabe\nlea     rdx, [rsp+38h+arg_8]                                           ; +0x11, 0x14005cac1\nadd     rcx, 140h                                                      ; +0x16, 0x14005cac6\ncall    sub_14005F8D0                                                  ; +0x1d, 0x14005cacd\ntest    rax, rax                                                       ; +0x22, 0x14005cad2\njz      loc_14005CB89                                                  ; +0x25, 0x14005cad5\nlea     r8, [rsp+38h+arg_8]                                            ; +0x2b, 0x14005cadb\nlea     rdx, [rsp+38h+var_18]                                          ; +0x30, 0x14005cae0\nlea     rcx, [rdi+140h]                                                ; +0x35, 0x14005cae5\ncall    sub_140061560                                                  ; +0x3c, 0x14005caec\nmov     rcx, rdi                                                       ; +0x41, 0x14005caf1\nmov     rdx, [rax]                                                     ; +0x44, 0x14005caf4\nmov     edx, [rdx+18h]                                                 ; +0x47, 0x14005caf7\ncall    FMODAudioEngine__channelForChannelID                           ; +0x4a, 0x14005cafa\ntest    rax, rax                                                       ; +0x4f, 0x14005caff\njz      short loc_14005CB18                                            ; +0x52, 0x14005cb02\nmov     rcx, rax                                                       ; +0x54, 0x14005cb04\ncall    cs:?stop@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@XZ; FMOD::ChannelControl::stop(void) ; +0x57, 0x14005cb07\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x5d, 0x14005cb0d\nadd     rsp, 30h                                                       ; +0x62, 0x14005cb12\npop     rdi                                                            ; +0x66, 0x14005cb16\nretn                                                                   ; +0x67, 0x14005cb17\nlea     r8, [rsp+38h+arg_8]                                            ; +0x68, 0x14005cb18\nlea     rdx, [rsp+38h+var_18]                                          ; +0x6d, 0x14005cb1d\nlea     rcx, [rdi+140h]                                                ; +0x72, 0x14005cb22\ncall    sub_140061560                                                  ; +0x79, 0x14005cb29\nmov     rcx, [rax]                                                     ; +0x7e, 0x14005cb2e\ncmp     qword ptr [rcx+20h], 0                                         ; +0x81, 0x14005cb31\njz      short loc_14005CB78                                            ; +0x86, 0x14005cb36\nlea     r8, [rsp+38h+arg_8]                                            ; +0x88, 0x14005cb38\nlea     rdx, [rsp+38h+var_18]                                          ; +0x8d, 0x14005cb3d\nlea     rcx, [rdi+140h]                                                ; +0x92, 0x14005cb42\ncall    sub_140061560                                                  ; +0x99, 0x14005cb49\nlea     rcx, [rdi+5F0h]                                                ; +0x9e, 0x14005cb4e\nmov     rdx, [rcx+8]                                                   ; +0xa5, 0x14005cb55\nmov     r8, [rax]                                                      ; +0xa9, 0x14005cb59\nadd     r8, 20h ; ' '                                                  ; +0xac, 0x14005cb5c\ncmp     rdx, [rcx+10h]                                                 ; +0xb0, 0x14005cb60\njz      short loc_14005CB73                                            ; +0xb4, 0x14005cb64\nmov     rax, [r8]                                                      ; +0xb6, 0x14005cb66\nmov     [rdx], rax                                                     ; +0xb9, 0x14005cb69\nadd     qword ptr [rcx+8], 8                                           ; +0xbc, 0x14005cb6c\njmp     short loc_14005CB78                                            ; +0xc1, 0x14005cb71\ncall    sub_140063110                                                  ; +0xc3, 0x14005cb73\nlea     rdx, [rsp+38h+arg_8]                                           ; +0xc8, 0x14005cb78\nlea     rcx, [rdi+140h]                                                ; +0xcd, 0x14005cb7d\ncall    sub_14005DA90                                                  ; +0xd4, 0x14005cb84\nmov     rbx, [rsp+38h+arg_0]                                           ; +0xd9, 0x14005cb89\nadd     rsp, 30h                                                       ; +0xde, 0x14005cb8e\npop     rdi                                                            ; +0xe2, 0x14005cb92\nretn                                                                   ; +0xe3, 0x14005cb93", "xrefs": ["FMODAudioEngine::triggerQueuedMusic @ 0x14005bc1f", "FMODAudioEngine::preloadMusic @ 0x14005c8e4", "GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244113", "GJBaseGameLayer::processSongState @ 0x1402456e0", "MusicBrowser::onPlaybackControl @ 0x140339ab2", "<???> @ 0x1406c5490"], "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"}