{"type": "func", "start": 6027068, "end": 6027352, "name": "CreateGuidelinesLayer::playMusic", "pseudocode": "// \n// CreateGuidelinesLayer::playMusic from 0x5bf73c to 0x5bf858 (284 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x518e8\n// > <???> @ 0x11463a8\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 CreateGuidelinesLayer::playMusic(CreateGuidelinesLayer *a1)\n{\n  FMODAudioEngine *v2; // x22\n  void *v3; // x0\n  unsigned int *v4; // x2\n  int v5; // w1\n  __int64 v6; // [xsp+50h] [xbp+50h] BYREF\n\n  v2 = FMODAudioEngine::sharedEngine();\n  ((void (__fastcall *)(__int64 *__return_ptr, CustomSongDelegate *))a1->m_delegate->getSongFileName)(\n    &v6,\n    a1->m_delegate);\n  FMODAudioEngine::loadAndPlayMusic(v2, (__int64)&v6, (unsigned int)(float)(a1->m_elapsed * 1000.0), 0);\n  v3 = (void *)(v6 - 24);\n  if ( (__int64 *)(v6 - 24) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v4 = (unsigned int *)(v6 - 8);\n      do\n        v5 = __ldaxr(v4);\n      while ( __stlxr(v5 - 1, v4) );\n    }\n    else\n    {\n      v5 = *(_DWORD *)(v6 - 8);\n      *(_DWORD *)(v6 - 8) = v5 - 1;\n    }\n    if ( v5 <= 0 )\n      operator delete(v3);\n  }\n}", "assembly": "; \n; CreateGuidelinesLayer::playMusic from 0x5bf73c to 0x5bf858 (284 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x518e8\n; > <???> @ 0x11463a8\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_60]!                                ; +0x0, 0x5bf73c\nMOV             X29, SP                                                ; +0x4, 0x5bf740\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x8, 0x5bf744\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x5bf748\nADD             X20, X29, #0x60+var_10                                 ; +0x10, 0x5bf74c\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x14, 0x5bf750\nMOV             X21, X0                                                ; +0x18, 0x5bf754\nLDR             X0, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x5bf758\nLDR             X0, [X0]; this                                         ; +0x20, 0x5bf75c\nSTR             X0, [X29,#0x60+var_8]                                  ; +0x24, 0x5bf760\nBL              _ZN15FMODAudioEngine12sharedEngineEv; FMODAudioEngine::sharedEngine(void) ; +0x28, 0x5bf764\nMOV             X22, X0                                                ; +0x2c, 0x5bf768\nLDR             X2, [X21,#0x280]                                       ; +0x30, 0x5bf76c\nMOV             X8, X20                                                ; +0x34, 0x5bf770\nSTR             X20, [X29,#0x60+var_28]                                ; +0x38, 0x5bf774\nMOV             X0, X2                                                 ; +0x3c, 0x5bf778\nLDR             X2, [X2]                                               ; +0x40, 0x5bf77c\nLDR             X2, [X2,#0x10]                                         ; +0x44, 0x5bf780\nBLR             X2                                                     ; +0x48, 0x5bf784\nLDR             S0, [X21,#0x2B0]                                       ; +0x4c, 0x5bf788\nLDR             X1, [X29,#0x60+var_28]                                 ; +0x50, 0x5bf78c\nLDR             S1, =0x447A0000                                        ; +0x54, 0x5bf790\nMOV             X0, X22                                                ; +0x58, 0x5bf794\nMOV             W3, #0                                                 ; +0x5c, 0x5bf798\nFMUL            S0, S0, S1                                             ; +0x60, 0x5bf79c\nFCVTZU          W2, S0                                                 ; +0x64, 0x5bf7a0\nBL              _ZN15FMODAudioEngine16loadAndPlayMusicESsji; FMODAudioEngine::loadAndPlayMusic(std::string,uint,int) ; +0x68, 0x5bf7a4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x6c, 0x5bf7a8\nLDR             X2, [X29,#0x60+var_10]                                 ; +0x70, 0x5bf7ac\nSUB             X0, X2, #0x18; p                                       ; +0x74, 0x5bf7b0\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x78, 0x5bf7b4\nCMP             X0, X1                                                 ; +0x7c, 0x5bf7b8\nB.NE            loc_5BF7E4                                             ; +0x80, 0x5bf7bc\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x84, 0x5bf7c0\nLDR             X1, [X29,#0x60+var_8]                                  ; +0x88, 0x5bf7c4\nLDR             X0, [X19]                                              ; +0x8c, 0x5bf7c8\nCMP             X1, X0                                                 ; +0x90, 0x5bf7cc\nB.NE            loc_5BF828                                             ; +0x94, 0x5bf7d0\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0x98, 0x5bf7d4\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0x9c, 0x5bf7d8\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0xa0, 0x5bf7dc\nRET                                                                    ; +0xa4, 0x5bf7e0\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xa8, 0x5bf7e4\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xac, 0x5bf7e8\nCBZ             X1, loc_5BF818                                         ; +0xb0, 0x5bf7ec\nSUB             X2, X2, #8                                             ; +0xb4, 0x5bf7f0\nLDAXR           W1, [X2]                                               ; +0xb8, 0x5bf7f4\nSUB             W3, W1, #1                                             ; +0xbc, 0x5bf7f8\nSTLXR           W4, W3, [X2]                                           ; +0xc0, 0x5bf7fc\nCBNZ            W4, loc_5BF7F4                                         ; +0xc4, 0x5bf800\nCMP             W1, WZR                                                ; +0xc8, 0x5bf804\nB.GT            loc_5BF7C0                                             ; +0xcc, 0x5bf808\nADD             X1, X29, #0x60+var_18                                  ; +0xd0, 0x5bf80c\nBL              j__ZdlPv; operator delete(void *)                      ; +0xd4, 0x5bf810\nB               loc_5BF7C0                                             ; +0xd8, 0x5bf814\nLDUR            W1, [X2,#-8]                                           ; +0xdc, 0x5bf818\nSUB             W3, W1, #1                                             ; +0xe0, 0x5bf81c\nSTUR            W3, [X2,#-8]                                           ; +0xe4, 0x5bf820\nB               loc_5BF804                                             ; +0xe8, 0x5bf824\nBL              .__stack_chk_fail                                      ; +0xec, 0x5bf828\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xf0, 0x5bf82c\nMOV             X19, X0                                                ; +0xf4, 0x5bf830\nLDR             X0, [X29,#0x60+var_10]                                 ; +0xf8, 0x5bf834\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xfc, 0x5bf838\nSUB             X0, X0, #0x18                                          ; +0x100, 0x5bf83c\nCMP             X0, X1                                                 ; +0x104, 0x5bf840\nB.EQ            loc_5BF850                                             ; +0x108, 0x5bf844\nADD             X1, X29, #0x60+var_18                                  ; +0x10c, 0x5bf848\nBL              sub_4DB3D0                                             ; +0x110, 0x5bf84c\nMOV             X0, X19                                                ; +0x114, 0x5bf850\nBL              _Unwind_Resume                                         ; +0x118, 0x5bf854", "xrefs": ["<???> @ 0x518e8", "<???> @ 0x11463a8"], "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"}