{"type": "func", "start": 4299946148, "end": 4299946500, "name": "FMOD::Sound::getLength", "pseudocode": "// \n// FMOD::Sound::getLength from 0x1004bf8a4 to 0x1004bfa04 (352 bytes)\n// \n// 4 xrefs:\n// > FMODAudioEngine::storeEffect @ 0x10013cbcc\n// > FMODAudioEngine::startMusic @ 0x10013d768\n// > FMODAudioEngine::getMusicLengthMS @ 0x10013e688\n// > sub_100453074 @ 0x100453078\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!\nFMOD_RESULT __fastcall FMOD::Sound::getLength(FMOD::Sound *a1, unsigned int *a2, unsigned int a3)\n{\n  __int64 v3; // x21\n  int v6; // w3\n  int v7; // w4\n  int v8; // w5\n  int v9; // w6\n  int v10; // w7\n  __int64 v11; // x20\n  unsigned int v12; // w8\n  unsigned int v13; // w8\n  int v14; // w0\n  __int64 v15; // x22\n  int v16; // w3\n  int v17; // w4\n  int v18; // w5\n  int v19; // w6\n  int v20; // w7\n  int v21; // w0\n  int v22; // w3\n  int v23; // w4\n  int v24; // w5\n  int v25; // w6\n  int v26; // w7\n  __int64 v28; // [xsp+8h] [xbp-158h] BYREF\n  unsigned int *v29; // [xsp+10h] [xbp-150h] BYREF\n  _BYTE v30[256]; // [xsp+18h] [xbp-148h] BYREF\n\n  v3 = *(_QWORD *)&a3;\n  v28 = 0;\n  v11 = sub_1004C3CE0(a1, &v29, &v28);\n  if ( !(_DWORD)v11 )\n  {\n    v12 = atomic_load(v29 + 68);\n    if ( v12 && (v13 = atomic_load(v29 + 68), v13 != 7) )\n    {\n      v11 = 46;\n    }\n    else\n    {\n      v11 = (*(__int64 (__fastcall **)(unsigned int *, unsigned int *, __int64))(*(_QWORD *)v29 + 152LL))(v29, a2, v3);\n      if ( !(_DWORD)v11 )\n        goto LABEL_9;\n    }\n  }\n  if ( (*((_BYTE *)off_1008524C8 + 32) & 0x80) != 0 )\n  {\n    v14 = sub_1004360EC((int)v30, 0x100u, (__int64)a2, v6, v7, v8, v9, v10);\n    v15 = v14;\n    v21 = sub_100435EB4(&v30[v14], (unsigned int)(256 - v14), \", \", v16, v17, v18, v19, v20);\n    sub_100435D28(&v30[v15 + v21], (unsigned int)(256 - (v15 + v21)), v3, v22, v23, v24, v25, v26);\n    sub_10048489C(v11, 5, (__int64)a1, (__int64)\"Sound::getLength\", (__int64)v30);\n  }\nLABEL_9:\n  if ( v28 )\n    sub_100442B7C(v28, 0xDu);\n  return (unsigned int)v11;\n}", "assembly": "; \n; FMOD::Sound::getLength from 0x1004bf8a4 to 0x1004bfa04 (352 bytes)\n; \n; 4 xrefs:\n; > FMODAudioEngine::storeEffect @ 0x10013cbcc\n; > FMODAudioEngine::startMusic @ 0x10013d768\n; > FMODAudioEngine::getMusicLengthMS @ 0x10013e688\n; > sub_100453074 @ 0x100453078\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\nSUB             SP, SP, #0x170                                         ; +0x0, 0x1004bf8a4\nSTP             X28, X27, [SP,#0x160+var_40]                           ; +0x4, 0x1004bf8a8\nSTP             X24, X23, [SP,#0x160+var_30]                           ; +0x8, 0x1004bf8ac\nSTP             X22, X21, [SP,#0x160+var_20]                           ; +0xc, 0x1004bf8b0\nSTP             X20, X19, [SP,#0x160+var_10]                           ; +0x10, 0x1004bf8b4\nSTP             X29, X30, [SP,#0x160+var_s0]                           ; +0x14, 0x1004bf8b8\nADD             X29, SP, #0x160                                        ; +0x18, 0x1004bf8bc\nMOV             X21, X2                                                ; +0x1c, 0x1004bf8c0\nMOV             X22, X1                                                ; +0x20, 0x1004bf8c4\nMOV             X19, X0                                                ; +0x24, 0x1004bf8c8\nADRP            X8, #___stack_chk_guard_ptr@PAGE                       ; +0x28, 0x1004bf8cc\nLDR             X8, [X8,#___stack_chk_guard_ptr@PAGEOFF]; ___stack_chk_guard ; +0x2c, 0x1004bf8d0\nLDR             X8, [X8]                                               ; +0x30, 0x1004bf8d4\nSTUR            X8, [X29,#var_48]                                      ; +0x34, 0x1004bf8d8\nSTR             XZR, [SP,#0x160+var_158]                               ; +0x38, 0x1004bf8dc\nADD             X1, SP, #0x160+var_150                                 ; +0x3c, 0x1004bf8e0\nADD             X2, SP, #0x160+var_158                                 ; +0x40, 0x1004bf8e4\nBL              sub_1004C3CE0                                          ; +0x44, 0x1004bf8e8\nMOV             X20, X0                                                ; +0x48, 0x1004bf8ec\nCBNZ            W0, loc_1004BF940                                      ; +0x4c, 0x1004bf8f0\nLDR             X8, [SP,#0x160+var_150]                                ; +0x50, 0x1004bf8f4\nADD             X8, X8, #0x110                                         ; +0x54, 0x1004bf8f8\nLDAR            W8, [X8]                                               ; +0x58, 0x1004bf8fc\nCBZ             W8, loc_1004BF918                                      ; +0x5c, 0x1004bf900\nLDR             X8, [SP,#0x160+var_150]                                ; +0x60, 0x1004bf904\nADD             X8, X8, #0x110                                         ; +0x64, 0x1004bf908\nLDAR            W8, [X8]                                               ; +0x68, 0x1004bf90c\nCMP             W8, #7                                                 ; +0x6c, 0x1004bf910\nB.NE            loc_1004BF93C                                          ; +0x70, 0x1004bf914\nLDR             X0, [SP,#0x160+var_150]                                ; +0x74, 0x1004bf918\nLDR             X8, [X0]                                               ; +0x78, 0x1004bf91c\nLDR             X8, [X8,#0x98]                                         ; +0x7c, 0x1004bf920\nMOV             X1, X22                                                ; +0x80, 0x1004bf924\nMOV             X2, X21                                                ; +0x84, 0x1004bf928\nBLR             X8                                                     ; +0x88, 0x1004bf92c\nMOV             X20, X0                                                ; +0x8c, 0x1004bf930\nCBNZ            W0, loc_1004BF940                                      ; +0x90, 0x1004bf934\nB               loc_1004BF9B8                                          ; +0x94, 0x1004bf938\nMOV             W20, #0x2E ; '.'                                       ; +0x98, 0x1004bf93c\nADRL            X8, off_1008524C8                                      ; +0x9c, 0x1004bf940\nLDR             X8, [X8]; unk_1008786E0                                ; +0xa4, 0x1004bf948\nLDRB            W8, [X8,#(dword_100878700 - 0x1008786E0)]              ; +0xa8, 0x1004bf94c\nTBZ             W8, #7, loc_1004BF9B8                                  ; +0xac, 0x1004bf950\nADD             X23, SP, #0x160+var_148                                ; +0xb0, 0x1004bf954\nMOV             W24, #0x100                                            ; +0xb4, 0x1004bf958\nADD             X0, SP, #0x160+var_148                                 ; +0xb8, 0x1004bf95c\nMOV             W1, #0x100                                             ; +0xbc, 0x1004bf960\nMOV             X2, X22                                                ; +0xc0, 0x1004bf964\nBL              sub_1004360EC                                          ; +0xc4, 0x1004bf968\nSXTW            X22, W0                                                ; +0xc8, 0x1004bf96c\nADD             X8, X23, X22                                           ; +0xcc, 0x1004bf970\nSUB             W1, W24, W0                                            ; +0xd0, 0x1004bf974\nADRL            X2, asc_1006C9A07; \", \"                                ; +0xd4, 0x1004bf978\nMOV             X0, X8                                                 ; +0xdc, 0x1004bf980\nBL              sub_100435EB4                                          ; +0xe0, 0x1004bf984\nADD             X8, X22, W0,SXTW                                       ; +0xe4, 0x1004bf988\nADD             X0, X23, X8; int                                       ; +0xe8, 0x1004bf98c\nSUB             W1, W24, W8; int                                       ; +0xec, 0x1004bf990\nMOV             X2, X21; char                                          ; +0xf0, 0x1004bf994\nBL              sub_100435D28                                          ; +0xf4, 0x1004bf998\nADRL            X3, aSoundGetlength; \"Sound::getLength\"                ; +0xf8, 0x1004bf99c\nADD             X4, SP, #0x160+var_148                                 ; +0x100, 0x1004bf9a4\nMOV             X0, X20                                                ; +0x104, 0x1004bf9a8\nMOV             W1, #5                                                 ; +0x108, 0x1004bf9ac\nMOV             X2, X19                                                ; +0x10c, 0x1004bf9b0\nBL              sub_10048489C                                          ; +0x110, 0x1004bf9b4\nLDR             X0, [SP,#0x160+var_158]                                ; +0x114, 0x1004bf9b8\nCBZ             X0, loc_1004BF9C8                                      ; +0x118, 0x1004bf9bc\nMOV             W1, #0xD                                               ; +0x11c, 0x1004bf9c0\nBL              sub_100442B7C                                          ; +0x120, 0x1004bf9c4\nLDUR            X8, [X29,#var_48]                                      ; +0x124, 0x1004bf9c8\nADRP            X9, #___stack_chk_guard_ptr@PAGE                       ; +0x128, 0x1004bf9cc\nLDR             X9, [X9,#___stack_chk_guard_ptr@PAGEOFF]; ___stack_chk_guard ; +0x12c, 0x1004bf9d0\nLDR             X9, [X9]                                               ; +0x130, 0x1004bf9d4\nCMP             X9, X8                                                 ; +0x134, 0x1004bf9d8\nB.NE            loc_1004BFA00                                          ; +0x138, 0x1004bf9dc\nMOV             X0, X20                                                ; +0x13c, 0x1004bf9e0\nLDP             X29, X30, [SP,#0x160+var_s0]                           ; +0x140, 0x1004bf9e4\nLDP             X20, X19, [SP,#0x160+var_10]                           ; +0x144, 0x1004bf9e8\nLDP             X22, X21, [SP,#0x160+var_20]                           ; +0x148, 0x1004bf9ec\nLDP             X24, X23, [SP,#0x160+var_30]                           ; +0x14c, 0x1004bf9f0\nLDP             X28, X27, [SP,#0x160+var_40]                           ; +0x150, 0x1004bf9f4\nADD             SP, SP, #0x170                                         ; +0x154, 0x1004bf9f8\nRET                                                                    ; +0x158, 0x1004bf9fc\nBL              ___stack_chk_fail                                      ; +0x15c, 0x1004bfa00", "xrefs": ["FMODAudioEngine::storeEffect @ 0x10013cbcc", "FMODAudioEngine::startMusic @ 0x10013d768", "FMODAudioEngine::getMusicLengthMS @ 0x10013e688", "sub_100453074 @ 0x100453078"], "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"}