{"type": "func", "start": 4299948372, "end": 4299948784, "name": "FMOD::Sound::readData", "pseudocode": "// \n// FMOD::Sound::readData from 0x1004c0154 to 0x1004c02f0 (412 bytes)\n// \n// 1 xrefs:\n// > sub_100453124 @ 0x100453128\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::readData(FMOD::Sound *a1, void *a2, unsigned int a3, unsigned int *a4)\n{\n  __int64 v5; // x22\n  int v8; // w3\n  int v9; // w4\n  int v10; // w5\n  int v11; // w6\n  int v12; // w7\n  __int64 v13; // x21\n  unsigned int v14; // w8\n  unsigned int v15; // w8\n  int v16; // w0\n  int v17; // w3\n  int v18; // w4\n  int v19; // w5\n  int v20; // w6\n  int v21; // w7\n  __int64 v22; // x26\n  int v23; // w3\n  int v24; // w4\n  int v25; // w5\n  int v26; // w6\n  int v27; // w7\n  int v28; // w22\n  int v29; // w3\n  int v30; // w4\n  int v31; // w5\n  int v32; // w6\n  int v33; // w7\n  int v34; // w0\n  int v35; // w3\n  int v36; // w4\n  int v37; // w5\n  int v38; // w6\n  int v39; // w7\n  __int64 v41; // [xsp+8h] [xbp-168h] BYREF\n  unsigned int *v42; // [xsp+10h] [xbp-160h] BYREF\n  _BYTE v43[256]; // [xsp+18h] [xbp-158h] BYREF\n\n  v5 = *(_QWORD *)&a3;\n  v41 = 0;\n  v13 = sub_1004C3CE0(a1, &v42, &v41);\n  if ( !(_DWORD)v13 )\n  {\n    v14 = atomic_load(v42 + 68);\n    if ( v14 && (v15 = atomic_load(v42 + 68), v15 != 7) )\n    {\n      v13 = 46;\n    }\n    else\n    {\n      v13 = (*(__int64 (__fastcall **)(unsigned int *, void *, __int64, unsigned int *))(*(_QWORD *)v42 + 200LL))(\n              v42,\n              a2,\n              v5,\n              a4);\n      if ( !(_DWORD)v13 )\n        goto LABEL_9;\n    }\n  }\n  if ( (*((_BYTE *)off_1008524C8 + 32) & 0x80) != 0 )\n  {\n    v16 = sub_100436324((int)v43, 0x100u, (char)a2, v8, v9, v10, v11, v12);\n    v22 = v16 + (__int64)(int)sub_100435EB4(&v43[v16], (unsigned int)(256 - v16), \", \", v17, v18, v19, v20, v21);\n    v28 = v22 + sub_100435D28(&v43[v22], (unsigned int)(256 - v22), v5, v23, v24, v25, v26, v27);\n    v34 = sub_100435EB4(&v43[v28], (unsigned int)(256 - v28), \", \", v29, v30, v31, v32, v33);\n    sub_1004360EC((int)&v43[v28 + v34], (unsigned int)(256 - (v28 + v34)), (__int64)a4, v35, v36, v37, v38, v39);\n    sub_10048489C(v13, 5, (__int64)a1, (__int64)\"Sound::readData\", (__int64)v43);\n  }\nLABEL_9:\n  if ( v41 )\n    sub_100442B7C(v41, 0xDu);\n  return (unsigned int)v13;\n}", "assembly": "; \n; FMOD::Sound::readData from 0x1004c0154 to 0x1004c02f0 (412 bytes)\n; \n; 1 xrefs:\n; > sub_100453124 @ 0x100453128\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, #0x180                                         ; +0x0, 0x1004c0154\nSTP             X28, X27, [SP,#0x170+var_50]                           ; +0x4, 0x1004c0158\nSTP             X26, X25, [SP,#0x170+var_40]                           ; +0x8, 0x1004c015c\nSTP             X24, X23, [SP,#0x170+var_30]                           ; +0xc, 0x1004c0160\nSTP             X22, X21, [SP,#0x170+var_20]                           ; +0x10, 0x1004c0164\nSTP             X20, X19, [SP,#0x170+var_10]                           ; +0x14, 0x1004c0168\nSTP             X29, X30, [SP,#0x170+var_s0]                           ; +0x18, 0x1004c016c\nADD             X29, SP, #0x170                                        ; +0x1c, 0x1004c0170\nMOV             X20, X3                                                ; +0x20, 0x1004c0174\nMOV             X22, X2                                                ; +0x24, 0x1004c0178\nMOV             X23, X1                                                ; +0x28, 0x1004c017c\nMOV             X19, X0                                                ; +0x2c, 0x1004c0180\nADRP            X8, #___stack_chk_guard_ptr@PAGE                       ; +0x30, 0x1004c0184\nLDR             X8, [X8,#___stack_chk_guard_ptr@PAGEOFF]; ___stack_chk_guard ; +0x34, 0x1004c0188\nLDR             X8, [X8]                                               ; +0x38, 0x1004c018c\nSTUR            X8, [X29,#var_58]                                      ; +0x3c, 0x1004c0190\nSTR             XZR, [SP,#0x170+var_168]                               ; +0x40, 0x1004c0194\nADD             X1, SP, #0x170+var_160                                 ; +0x44, 0x1004c0198\nADD             X2, SP, #0x170+var_168                                 ; +0x48, 0x1004c019c\nBL              sub_1004C3CE0                                          ; +0x4c, 0x1004c01a0\nMOV             X21, X0                                                ; +0x50, 0x1004c01a4\nCBNZ            W0, loc_1004C01FC                                      ; +0x54, 0x1004c01a8\nLDR             X8, [SP,#0x170+var_160]                                ; +0x58, 0x1004c01ac\nADD             X8, X8, #0x110                                         ; +0x5c, 0x1004c01b0\nLDAR            W8, [X8]                                               ; +0x60, 0x1004c01b4\nCBZ             W8, loc_1004C01D0                                      ; +0x64, 0x1004c01b8\nLDR             X8, [SP,#0x170+var_160]                                ; +0x68, 0x1004c01bc\nADD             X8, X8, #0x110                                         ; +0x6c, 0x1004c01c0\nLDAR            W8, [X8]                                               ; +0x70, 0x1004c01c4\nCMP             W8, #7                                                 ; +0x74, 0x1004c01c8\nB.NE            loc_1004C01F8                                          ; +0x78, 0x1004c01cc\nLDR             X0, [SP,#0x170+var_160]                                ; +0x7c, 0x1004c01d0\nLDR             X8, [X0]                                               ; +0x80, 0x1004c01d4\nLDR             X8, [X8,#0xC8]                                         ; +0x84, 0x1004c01d8\nMOV             X1, X23                                                ; +0x88, 0x1004c01dc\nMOV             X2, X22                                                ; +0x8c, 0x1004c01e0\nMOV             X3, X20                                                ; +0x90, 0x1004c01e4\nBLR             X8                                                     ; +0x94, 0x1004c01e8\nMOV             X21, X0                                                ; +0x98, 0x1004c01ec\nCBNZ            W0, loc_1004C01FC                                      ; +0x9c, 0x1004c01f0\nB               loc_1004C02A0                                          ; +0xa0, 0x1004c01f4\nMOV             W21, #0x2E ; '.'                                       ; +0xa4, 0x1004c01f8\nADRL            X8, off_1008524C8                                      ; +0xa8, 0x1004c01fc\nLDR             X8, [X8]; unk_1008786E0                                ; +0xb0, 0x1004c0204\nLDRB            W8, [X8,#(dword_100878700 - 0x1008786E0)]              ; +0xb4, 0x1004c0208\nTBZ             W8, #7, loc_1004C02A0                                  ; +0xb8, 0x1004c020c\nADD             X24, SP, #0x170+var_158                                ; +0xbc, 0x1004c0210\nMOV             W25, #0x100                                            ; +0xc0, 0x1004c0214\nADD             X0, SP, #0x170+var_158; int                            ; +0xc4, 0x1004c0218\nMOV             W1, #0x100; int                                        ; +0xc8, 0x1004c021c\nMOV             X2, X23; char                                          ; +0xcc, 0x1004c0220\nBL              sub_100436324                                          ; +0xd0, 0x1004c0224\nSXTW            X26, W0                                                ; +0xd4, 0x1004c0228\nADD             X8, X24, X26                                           ; +0xd8, 0x1004c022c\nSUB             W1, W25, W0                                            ; +0xdc, 0x1004c0230\nADRL            X23, asc_1006C9A07; \", \"                               ; +0xe0, 0x1004c0234\nMOV             X0, X8                                                 ; +0xe8, 0x1004c023c\nMOV             X2, X23                                                ; +0xec, 0x1004c0240\nBL              sub_100435EB4                                          ; +0xf0, 0x1004c0244\nADD             X26, X26, W0,SXTW                                      ; +0xf4, 0x1004c0248\nADD             X0, X24, X26; int                                      ; +0xf8, 0x1004c024c\nSUB             W1, W25, W26; int                                      ; +0xfc, 0x1004c0250\nMOV             X2, X22; char                                          ; +0x100, 0x1004c0254\nBL              sub_100435D28                                          ; +0x104, 0x1004c0258\nADD             W22, W26, W0                                           ; +0x108, 0x1004c025c\nADD             X0, X24, W22,SXTW                                      ; +0x10c, 0x1004c0260\nSUB             W1, W25, W22                                           ; +0x110, 0x1004c0264\nMOV             X2, X23                                                ; +0x114, 0x1004c0268\nBL              sub_100435EB4                                          ; +0x118, 0x1004c026c\nADD             W8, W22, W0                                            ; +0x11c, 0x1004c0270\nADD             X0, X24, W8,SXTW                                       ; +0x120, 0x1004c0274\nSUB             W1, W25, W8                                            ; +0x124, 0x1004c0278\nMOV             X2, X20                                                ; +0x128, 0x1004c027c\nBL              sub_1004360EC                                          ; +0x12c, 0x1004c0280\nADRL            X3, aSoundReaddata; \"Sound::readData\"                  ; +0x130, 0x1004c0284\nADD             X4, SP, #0x170+var_158                                 ; +0x138, 0x1004c028c\nMOV             X0, X21                                                ; +0x13c, 0x1004c0290\nMOV             W1, #5                                                 ; +0x140, 0x1004c0294\nMOV             X2, X19                                                ; +0x144, 0x1004c0298\nBL              sub_10048489C                                          ; +0x148, 0x1004c029c\nLDR             X0, [SP,#0x170+var_168]                                ; +0x14c, 0x1004c02a0\nCBZ             X0, loc_1004C02B0                                      ; +0x150, 0x1004c02a4\nMOV             W1, #0xD                                               ; +0x154, 0x1004c02a8\nBL              sub_100442B7C                                          ; +0x158, 0x1004c02ac\nLDUR            X8, [X29,#var_58]                                      ; +0x15c, 0x1004c02b0\nADRP            X9, #___stack_chk_guard_ptr@PAGE                       ; +0x160, 0x1004c02b4\nLDR             X9, [X9,#___stack_chk_guard_ptr@PAGEOFF]; ___stack_chk_guard ; +0x164, 0x1004c02b8\nLDR             X9, [X9]                                               ; +0x168, 0x1004c02bc\nCMP             X9, X8                                                 ; +0x16c, 0x1004c02c0\nB.NE            loc_1004C02EC                                          ; +0x170, 0x1004c02c4\nMOV             X0, X21                                                ; +0x174, 0x1004c02c8\nLDP             X29, X30, [SP,#0x170+var_s0]                           ; +0x178, 0x1004c02cc\nLDP             X20, X19, [SP,#0x170+var_10]                           ; +0x17c, 0x1004c02d0\nLDP             X22, X21, [SP,#0x170+var_20]                           ; +0x180, 0x1004c02d4\nLDP             X24, X23, [SP,#0x170+var_30]                           ; +0x184, 0x1004c02d8\nLDP             X26, X25, [SP,#0x170+var_40]                           ; +0x188, 0x1004c02dc\nLDP             X28, X27, [SP,#0x170+var_50]                           ; +0x18c, 0x1004c02e0\nADD             SP, SP, #0x180                                         ; +0x190, 0x1004c02e4\nRET                                                                    ; +0x194, 0x1004c02e8\nBL              ___stack_chk_fail                                      ; +0x198, 0x1004c02ec", "xrefs": ["sub_100453124 @ 0x100453128"], "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"}