{"type": "func", "start": 5992212, "end": 5992484, "name": "FMODAudioEngine::loadMusic", "pseudocode": "// \n// FMODAudioEngine::loadMusic from 0x5b6f14 to 0x5b7024 (272 bytes)\n// \n// 2 xrefs:\n// > SetupSongTriggerPopup::updateSongTimeSlider @ 0x9a9ea8\n// > <???> @ 0x514e0\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__int64 __fastcall FMODAudioEngine::loadMusic(__int64 a1, __int64 a2)\n{\n  unsigned int v3; // w20\n  void *v4; // x0\n  unsigned int *v6; // x2\n  int v7; // w1\n  __int64 v8; // [xsp+40h] [xbp+40h] BYREF\n\n  sub_D18D28(&v8, a2);\n  v3 = FMODAudioEngine::loadMusic(a1, &v8, 0, 0, 0, 0, 1.0, 0.0, 1.0);\n  v4 = (void *)(v8 - 24);\n  if ( (__int64 *)(v8 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v6 = (unsigned int *)(v8 - 8);\n      do\n        v7 = __ldaxr(v6);\n      while ( __stlxr(v7 - 1, v6) );\n    }\n    else\n    {\n      v7 = *(_DWORD *)(v8 - 8);\n      *(_DWORD *)(v8 - 8) = v7 - 1;\n    }\n    if ( v7 <= 0 )\n      operator delete(v4);\n  }\n  return v3;\n}", "assembly": "; \n; FMODAudioEngine::loadMusic from 0x5b6f14 to 0x5b7024 (272 bytes)\n; \n; 2 xrefs:\n; > SetupSongTriggerPopup::updateSongTimeSlider @ 0x9a9ea8\n; > <???> @ 0x514e0\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\nSTP             X29, X30, [SP,#var_50]!                                ; +0x0, 0x5b6f14\nMOV             X29, SP                                                ; +0x4, 0x5b6f18\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x5b6f1c\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x5b6f20\nADD             X20, X29, #0x50+var_10                                 ; +0x10, 0x5b6f24\nSTR             X21, [SP,#0x50+var_30]                                 ; +0x14, 0x5b6f28\nMOV             X21, X0                                                ; +0x18, 0x5b6f2c\nMOV             X0, X20                                                ; +0x1c, 0x5b6f30\nLDR             X2, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x5b6f34\nLDR             X2, [X2]                                               ; +0x24, 0x5b6f38\nSTR             X2, [X29,#0x50+var_8]                                  ; +0x28, 0x5b6f3c\nBL              sub_D18D28                                             ; +0x2c, 0x5b6f40\nFMOV            S0, #1.0                                               ; +0x30, 0x5b6f44\nMOV             X0, X21                                                ; +0x34, 0x5b6f48\nFMOV            S1, WZR                                                ; +0x38, 0x5b6f4c\nMOV             X1, X20                                                ; +0x3c, 0x5b6f50\nFMOV            S2, S0                                                 ; +0x40, 0x5b6f54\nMOV             W2, #0                                                 ; +0x44, 0x5b6f58\nMOV             W3, #0                                                 ; +0x48, 0x5b6f5c\nMOV             W4, #0                                                 ; +0x4c, 0x5b6f60\nMOV             W5, #0                                                 ; +0x50, 0x5b6f64\nBL              _ZN15FMODAudioEngine9loadMusicESsfffbiib; FMODAudioEngine::loadMusic(std::string,float,float,float,bool,int,int,bool) ; +0x54, 0x5b6f68\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x58, 0x5b6f6c\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x5c, 0x5b6f70\nMOV             W20, W0                                                ; +0x60, 0x5b6f74\nSUB             X0, X2, #0x18; p                                       ; +0x64, 0x5b6f78\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x68, 0x5b6f7c\nCMP             X0, X1                                                 ; +0x6c, 0x5b6f80\nB.NE            loc_5B6FB0                                             ; +0x70, 0x5b6f84\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x74, 0x5b6f88\nMOV             W0, W20                                                ; +0x78, 0x5b6f8c\nLDR             X2, [X29,#0x50+var_8]                                  ; +0x7c, 0x5b6f90\nLDR             X1, [X19]                                              ; +0x80, 0x5b6f94\nCMP             X2, X1                                                 ; +0x84, 0x5b6f98\nB.NE            loc_5B6FF4                                             ; +0x88, 0x5b6f9c\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x8c, 0x5b6fa0\nLDR             X21, [SP,#0x50+var_30]                                 ; +0x90, 0x5b6fa4\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x94, 0x5b6fa8\nRET                                                                    ; +0x98, 0x5b6fac\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x9c, 0x5b6fb0\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xa0, 0x5b6fb4\nCBZ             X1, loc_5B6FE4                                         ; +0xa4, 0x5b6fb8\nSUB             X2, X2, #8                                             ; +0xa8, 0x5b6fbc\nLDAXR           W1, [X2]                                               ; +0xac, 0x5b6fc0\nSUB             W3, W1, #1                                             ; +0xb0, 0x5b6fc4\nSTLXR           W4, W3, [X2]                                           ; +0xb4, 0x5b6fc8\nCBNZ            W4, loc_5B6FC0                                         ; +0xb8, 0x5b6fcc\nCMP             W1, WZR                                                ; +0xbc, 0x5b6fd0\nB.GT            loc_5B6F88                                             ; +0xc0, 0x5b6fd4\nADD             X1, X29, #0x50+var_18                                  ; +0xc4, 0x5b6fd8\nBL              j__ZdlPv; operator delete(void *)                      ; +0xc8, 0x5b6fdc\nB               loc_5B6F88                                             ; +0xcc, 0x5b6fe0\nLDUR            W1, [X2,#-8]                                           ; +0xd0, 0x5b6fe4\nSUB             W3, W1, #1                                             ; +0xd4, 0x5b6fe8\nSTUR            W3, [X2,#-8]                                           ; +0xd8, 0x5b6fec\nB               loc_5B6FD0                                             ; +0xdc, 0x5b6ff0\nBL              .__stack_chk_fail                                      ; +0xe0, 0x5b6ff4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xe4, 0x5b6ff8\nMOV             X19, X0                                                ; +0xe8, 0x5b6ffc\nLDR             X0, [X29,#0x50+var_10]                                 ; +0xec, 0x5b7000\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xf0, 0x5b7004\nSUB             X0, X0, #0x18                                          ; +0xf4, 0x5b7008\nCMP             X0, X1                                                 ; +0xf8, 0x5b700c\nB.EQ            loc_5B701C                                             ; +0xfc, 0x5b7010\nADD             X1, X29, #0x50+var_18                                  ; +0x100, 0x5b7014\nBL              sub_5A9AC0                                             ; +0x104, 0x5b7018\nMOV             X0, X19                                                ; +0x108, 0x5b701c\nBL              _Unwind_Resume                                         ; +0x10c, 0x5b7020", "xrefs": ["SetupSongTriggerPopup::updateSongTimeSlider @ 0x9a9ea8", "<???> @ 0x514e0"], "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"}