{"type": "func", "start": 6443534832, "end": 6443535548, "name": "sub_1801089F0", "pseudocode": "// \n// sub_1801089F0 from 0x1801089f0 to 0x180108cbc (716 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1801b0780\n// > <???> @ 0x18020164c\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 sub_1801089F0(__int64 a1)\n{\n  struct _RTL_CRITICAL_SECTION *v1; // r15\n  unsigned int v3; // esi\n  __int64 v4; // rax\n  __int64 v5; // rax\n  int v6; // r8d\n  __int64 i; // rdx\n  __int64 v8; // rcx\n  __int64 v9; // rbx\n  int v10; // edi\n  __int64 v11; // rbp\n  __int64 v12; // r14\n  float *v13; // rcx\n  unsigned int v14; // eax\n  __int64 v15; // rdx\n  int v17; // [rsp+60h] [rbp+8h] BYREF\n  int v18; // [rsp+68h] [rbp+10h] BYREF\n\n  v1 = lpCriticalSection;\n  FMOD_OS_CriticalSection_Enter(lpCriticalSection);\n  if ( qword_1801F24F0[*(int *)(a1 + 48)] )\n  {\nLABEL_19:\n    v9 = *(_QWORD *)a1;\n    v10 = 0;\n    v11 = *(_QWORD *)(v9 + 232);\n    if ( *(int *)(v11 + 96) <= 0 )\n    {\nLABEL_27:\n      v15 = *(_QWORD *)(v9 + 168);\n      *(_QWORD *)(v9 + 548) = 0;\n      *(_QWORD *)(v9 + 748) = 0;\n      *(_QWORD *)(v9 + 564) = -1;\n      *(_DWORD *)(v9 + 560) = -1;\n      *(_DWORD *)(v9 + 760) = -1;\n      *(_DWORD *)(v9 + 556) = 0;\n      *(_DWORD *)(v9 + 756) = 0;\n      *(_DWORD *)(v9 + 764) = 1065353216;\n      *(_BYTE *)(v9 + 744) = 1;\n      sub_1800580D0(v9 + 576, v15, 1.0);\n      v3 = 0;\n      goto LABEL_28;\n    }\n    v12 = 0;\n    while ( 1 )\n    {\n      v13 = *(float **)(v12 + *(_QWORD *)(v11 + 104));\n      if ( !*(_DWORD *)v13 )\n        break;\n      if ( *(_DWORD *)v13 == 1 )\n      {\n        v14 = sub_18009C140(v9, (unsigned int)v10, *((_DWORD *)v13 + 14));\nLABEL_25:\n        v3 = v14;\n        if ( v14 )\n          goto LABEL_28;\n      }\n      ++v10;\n      v12 += 8;\n      if ( v10 >= *(_DWORD *)(v11 + 96) )\n        goto LABEL_27;\n    }\n    v14 = sub_18009C0C0(v9, v10, v13[14]);\n    goto LABEL_25;\n  }\n  qword_1801F24F0[*(int *)(a1 + 48)] = (__int64)sub_1800B6880(\n                                                  *((_QWORD *)off_1801AED20 + 52),\n                                                  3584,\n                                                  \"C:\\\\buildagent1\\\\work\\\\570ad728b1678096\\\\core_api\\\\src\\\\fmod_dsp_transceiver.cpp\",\n                                                  536,\n                                                  0);\n  if ( !qword_1801F24F0[*(int *)(a1 + 48)] )\n  {\n    v3 = 38;\n    goto LABEL_28;\n  }\n  v4 = *(_QWORD *)(a1 + 40);\n  v18 = 0;\n  v3 = (*(__int64 (__fastcall **)(__int64, int *))(v4 + 32))(a1, &v18);\n  if ( !v3 )\n  {\n    v5 = *(_QWORD *)(a1 + 40);\n    v17 = 0;\n    v3 = (*(__int64 (__fastcall **)(__int64, int *, _QWORD))(v5 + 56))(a1, &v17, 0);\n    if ( !v3 )\n    {\n      if ( v17 > 1000 )\n      {\nLABEL_16:\n        v6 = 0;\n      }\n      else if ( v17 == 1000 )\n      {\nLABEL_10:\n        v6 = 2;\n      }\n      else\n      {\n        switch ( v17 )\n        {\n          case 2:\n            v6 = 1;\n            break;\n          case 3:\n            goto LABEL_10;\n          case 4:\n            v6 = 4;\n            break;\n          case 5:\n            v6 = 5;\n            break;\n          case 6:\n            v6 = 6;\n            break;\n          case 7:\n            v6 = 8;\n            break;\n          case 8:\n            v6 = 12;\n            break;\n          default:\n            goto LABEL_16;\n        }\n      }\n      for ( i = 0; i < 3584; i += 112 )\n      {\n        v8 = qword_1801F24F0[*(int *)(a1 + 48)];\n        *(_DWORD *)(i + v8 + 96) = v18;\n        *(_QWORD *)(i + v8) = 0;\n        *(_QWORD *)(i + v8 + 32) = 0;\n        *(_QWORD *)(i + v8 + 24) = 0;\n        *(_QWORD *)(i + v8 + 72) = 0;\n        *(_DWORD *)(i + v8 + 100) = 0;\n        *(_QWORD *)(i + v8 + 8) = 0;\n        *(_QWORD *)(i + v8 + 48) = 0;\n        *(_QWORD *)(i + v8 + 40) = 0;\n        *(_QWORD *)(i + v8 + 16) = 0;\n        *(_QWORD *)(i + v8 + 64) = 0;\n        *(_QWORD *)(i + v8 + 56) = 0;\n        *(_DWORD *)(i + v8 + 80) = 0;\n        *(_WORD *)(i + v8 + 104) = 0;\n        *(_DWORD *)(i + v8 + 108) = 1;\n        *(_DWORD *)(i + v8 + 84) = 1;\n        *(_DWORD *)(i + v8 + 88) = 2;\n        *(_DWORD *)(i + v8 + 92) = v6;\n      }\n      goto LABEL_19;\n    }\n  }\nLABEL_28:\n  FMOD_OS_CriticalSection_Leave(v1);\n  return v3;\n}", "assembly": "; \n; sub_1801089F0 from 0x1801089f0 to 0x180108cbc (716 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1801b0780\n; > <???> @ 0x18020164c\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_10], rbx                                              ; +0x0, 0x1801089f0\nmov     [rsp+arg_18], rbp                                              ; +0x5, 0x1801089f5\npush    rsi                                                            ; +0xa, 0x1801089fa\npush    rdi                                                            ; +0xb, 0x1801089fb\npush    r12                                                            ; +0xc, 0x1801089fc\npush    r14                                                            ; +0xe, 0x1801089fe\npush    r15                                                            ; +0x10, 0x180108a00\nsub     rsp, 30h                                                       ; +0x12, 0x180108a02\nmov     r15, cs:lpCriticalSection                                      ; +0x16, 0x180108a06\nmov     rbx, rcx                                                       ; +0x1d, 0x180108a0d\nmov     rcx, r15                                                       ; +0x20, 0x180108a10\ncall    FMOD_OS_CriticalSection_Enter                                  ; +0x23, 0x180108a13\nmovsxd  rax, dword ptr [rbx+30h]                                       ; +0x28, 0x180108a18\nlea     rdi, cs:180000000h                                             ; +0x2c, 0x180108a1c\nxor     r12d, r12d                                                     ; +0x33, 0x180108a23\ncmp     rva qword_1801F24F0[rdi+rax*8], r12                            ; +0x36, 0x180108a26\njnz     loc_180108BAF                                                  ; +0x3e, 0x180108a2e\nmov     rcx, cs:off_1801AED20                                          ; +0x44, 0x180108a34\nlea     r8, aCBuildagent1Wo_79; \"C:\\\\buildagent1\\\\work\\\\570ad728b1678096\"... ; +0x4b, 0x180108a3b\nmov     r9d, 218h                                                      ; +0x52, 0x180108a42\nmov     [rsp+58h+var_38], r12d                                         ; +0x58, 0x180108a48\nmov     edx, 0E00h                                                     ; +0x5d, 0x180108a4d\nmov     rcx, [rcx+1A0h]                                                ; +0x62, 0x180108a52\ncall    sub_1800B6880                                                  ; +0x69, 0x180108a59\nmovsxd  rcx, dword ptr [rbx+30h]                                       ; +0x6e, 0x180108a5e\nmov     rva qword_1801F24F0[rdi+rcx*8], rax                            ; +0x72, 0x180108a62\nmovsxd  rax, dword ptr [rbx+30h]                                       ; +0x7a, 0x180108a6a\ncmp     rva qword_1801F24F0[rdi+rax*8], r12                            ; +0x7e, 0x180108a6e\njnz     short loc_180108A82                                            ; +0x86, 0x180108a76\nlea     esi, [r12+26h]                                                 ; +0x88, 0x180108a78\njmp     loc_180108C7D                                                  ; +0x8d, 0x180108a7d\nmov     rax, [rbx+28h]                                                 ; +0x92, 0x180108a82\nlea     rdx, [rsp+58h+arg_8]                                           ; +0x96, 0x180108a86\nmov     rcx, rbx                                                       ; +0x9b, 0x180108a8b\nmov     [rsp+58h+arg_8], r12d                                          ; +0x9e, 0x180108a8e\ncall    qword ptr [rax+20h]                                            ; +0xa3, 0x180108a93\nmov     esi, eax                                                       ; +0xa6, 0x180108a96\ntest    eax, eax                                                       ; +0xa8, 0x180108a98\njnz     loc_180108C7D                                                  ; +0xaa, 0x180108a9a\nmov     rax, [rbx+28h]                                                 ; +0xb0, 0x180108aa0\nlea     rdx, [rsp+58h+arg_0]                                           ; +0xb4, 0x180108aa4\nxor     r8d, r8d                                                       ; +0xb9, 0x180108aa9\nmov     [rsp+58h+arg_0], r12d                                          ; +0xbc, 0x180108aac\nmov     rcx, rbx                                                       ; +0xc1, 0x180108ab1\ncall    qword ptr [rax+38h]                                            ; +0xc4, 0x180108ab4\nmov     esi, eax                                                       ; +0xc7, 0x180108ab7\ntest    eax, eax                                                       ; +0xc9, 0x180108ab9\njnz     loc_180108C7D                                                  ; +0xcb, 0x180108abb\nmov     eax, [rsp+58h+arg_0]                                           ; +0xd1, 0x180108ac1\ncmp     eax, 3E8h                                                      ; +0xd5, 0x180108ac5\njg      short def_180108AE2; jumptable 0000000180108AE2 default case   ; +0xda, 0x180108aca\njz      short loc_180108AEC; jumptable 0000000180108AE2 case 3         ; +0xdc, 0x180108acc\nadd     eax, 0FFFFFFFEh; switch 7 cases                                ; +0xde, 0x180108ace\ncmp     eax, 6                                                         ; +0xe1, 0x180108ad1\nja      short def_180108AE2; jumptable 0000000180108AE2 default case   ; +0xe4, 0x180108ad4\ncdqe                                                                   ; +0xe6, 0x180108ad6\nmov     ecx, ds:(jpt_180108AE2 - 180000000h)[rdi+rax*4]                ; +0xe8, 0x180108ad8\nadd     rcx, rdi                                                       ; +0xef, 0x180108adf\njmp     rcx; switch jump                                               ; +0xf2, 0x180108ae2\nmov     r8d, 1; jumptable 0000000180108AE2 case 2                      ; +0xf4, 0x180108ae4\njmp     short loc_180108B1F                                            ; +0xfa, 0x180108aea\nmov     r8d, 2; jumptable 0000000180108AE2 case 3                      ; +0xfc, 0x180108aec\njmp     short loc_180108B1F                                            ; +0x102, 0x180108af2\nmov     r8d, 4; jumptable 0000000180108AE2 case 4                      ; +0x104, 0x180108af4\njmp     short loc_180108B1F                                            ; +0x10a, 0x180108afa\nmov     r8d, 5; jumptable 0000000180108AE2 case 5                      ; +0x10c, 0x180108afc\njmp     short loc_180108B1F                                            ; +0x112, 0x180108b02\nmov     r8d, 6; jumptable 0000000180108AE2 case 6                      ; +0x114, 0x180108b04\njmp     short loc_180108B1F                                            ; +0x11a, 0x180108b0a\nmov     r8d, 8; jumptable 0000000180108AE2 case 7                      ; +0x11c, 0x180108b0c\njmp     short loc_180108B1F                                            ; +0x122, 0x180108b12\nmov     r8d, 0Ch; jumptable 0000000180108AE2 case 8                    ; +0x124, 0x180108b14\njmp     short loc_180108B1F                                            ; +0x12a, 0x180108b1a\nmov     r8d, r12d; jumptable 0000000180108AE2 default case             ; +0x12c, 0x180108b1c\nmov     rdx, r12                                                       ; +0x12f, 0x180108b1f\nnop     dword ptr [rax+00h]                                            ; +0x132, 0x180108b22\nnop     word ptr [rax+rax+00000000h]                                   ; +0x136, 0x180108b26\nmovsxd  rax, dword ptr [rbx+30h]                                       ; +0x140, 0x180108b30\nmov     rcx, rva qword_1801F24F0[rdi+rax*8]                            ; +0x144, 0x180108b34\nmov     eax, [rsp+58h+arg_8]                                           ; +0x14c, 0x180108b3c\nmov     [rdx+rcx+60h], eax                                             ; +0x150, 0x180108b40\nmov     [rdx+rcx], r12                                                 ; +0x154, 0x180108b44\nmov     [rdx+rcx+20h], r12                                             ; +0x158, 0x180108b48\nmov     [rdx+rcx+18h], r12                                             ; +0x15d, 0x180108b4d\nmov     [rdx+rcx+48h], r12                                             ; +0x162, 0x180108b52\nmov     [rdx+rcx+64h], r12d                                            ; +0x167, 0x180108b57\nmov     [rdx+rcx+8], r12                                               ; +0x16c, 0x180108b5c\nmov     [rdx+rcx+30h], r12                                             ; +0x171, 0x180108b61\nmov     [rdx+rcx+28h], r12                                             ; +0x176, 0x180108b66\nmov     [rdx+rcx+10h], r12                                             ; +0x17b, 0x180108b6b\nmov     [rdx+rcx+40h], r12                                             ; +0x180, 0x180108b70\nmov     [rdx+rcx+38h], r12                                             ; +0x185, 0x180108b75\nmov     [rdx+rcx+50h], r12d                                            ; +0x18a, 0x180108b7a\nmov     [rdx+rcx+68h], r12w                                            ; +0x18f, 0x180108b7f\nmov     dword ptr [rdx+rcx+6Ch], 1                                     ; +0x195, 0x180108b85\nmov     dword ptr [rdx+rcx+54h], 1                                     ; +0x19d, 0x180108b8d\nmov     dword ptr [rdx+rcx+58h], 2                                     ; +0x1a5, 0x180108b95\nmov     [rdx+rcx+5Ch], r8d                                             ; +0x1ad, 0x180108b9d\nadd     rdx, 70h ; 'p'                                                 ; +0x1b2, 0x180108ba2\ncmp     rdx, 0E00h                                                     ; +0x1b6, 0x180108ba6\njl      short loc_180108B30                                            ; +0x1bd, 0x180108bad\nmov     rbx, [rbx]                                                     ; +0x1bf, 0x180108baf\nmov     edi, r12d                                                      ; +0x1c2, 0x180108bb2\nmov     rbp, [rbx+0E8h]                                                ; +0x1c5, 0x180108bb5\ncmp     [rbp+60h], r12d                                                ; +0x1cc, 0x180108bbc\njle     short loc_180108C13                                            ; +0x1d0, 0x180108bc0\nmov     r14, r12                                                       ; +0x1d2, 0x180108bc2\nnop     word ptr [rax+rax+00000000h]                                   ; +0x1d5, 0x180108bc5\nmov     rax, [rbp+68h]                                                 ; +0x1e0, 0x180108bd0\nmov     rcx, [r14+rax]                                                 ; +0x1e4, 0x180108bd4\nmov     eax, [rcx]                                                     ; +0x1e8, 0x180108bd8\ntest    eax, eax                                                       ; +0x1ea, 0x180108bda\njnz     short loc_180108BEF                                            ; +0x1ec, 0x180108bdc\nmovss   xmm2, dword ptr [rcx+38h]                                      ; +0x1ee, 0x180108bde\nmov     edx, edi                                                       ; +0x1f3, 0x180108be3\nmov     rcx, rbx                                                       ; +0x1f5, 0x180108be5\ncall    sub_18009C0C0                                                  ; +0x1f8, 0x180108be8\njmp     short loc_180108C02                                            ; +0x1fd, 0x180108bed\ncmp     eax, 1                                                         ; +0x1ff, 0x180108bef\njnz     short loc_180108C08                                            ; +0x202, 0x180108bf2\nmov     r8d, [rcx+38h]                                                 ; +0x204, 0x180108bf4\nmov     edx, edi                                                       ; +0x208, 0x180108bf8\nmov     rcx, rbx                                                       ; +0x20a, 0x180108bfa\ncall    sub_18009C140                                                  ; +0x20d, 0x180108bfd\nmov     esi, eax                                                       ; +0x212, 0x180108c02\ntest    eax, eax                                                       ; +0x214, 0x180108c04\njnz     short loc_180108C7D                                            ; +0x216, 0x180108c06\ninc     edi                                                            ; +0x218, 0x180108c08\nadd     r14, 8                                                         ; +0x21a, 0x180108c0a\ncmp     edi, [rbp+60h]                                                 ; +0x21e, 0x180108c0e\njl      short loc_180108BD0                                            ; +0x221, 0x180108c11\nmovss   xmm2, cs:dword_180145744                                       ; +0x223, 0x180108c13\nlea     rcx, [rbx+240h]                                                ; +0x22b, 0x180108c1b\nmov     rdx, [rbx+0A8h]                                                ; +0x232, 0x180108c22\nmov     [rbx+224h], r12                                                ; +0x239, 0x180108c29\nmov     [rbx+2ECh], r12                                                ; +0x240, 0x180108c30\nmov     qword ptr [rbx+234h], 0FFFFFFFFFFFFFFFFh                       ; +0x247, 0x180108c37\nmov     dword ptr [rbx+230h], 0FFFFFFFFh                               ; +0x252, 0x180108c42\nmov     dword ptr [rbx+2F8h], 0FFFFFFFFh                               ; +0x25c, 0x180108c4c\nmov     [rbx+22Ch], r12d                                               ; +0x266, 0x180108c56\nmov     [rbx+2F4h], r12d                                               ; +0x26d, 0x180108c5d\nmov     dword ptr [rbx+2FCh], 3F800000h                                ; +0x274, 0x180108c64\nmov     byte ptr [rbx+2E8h], 1                                         ; +0x27e, 0x180108c6e\ncall    sub_1800580D0                                                  ; +0x285, 0x180108c75\nmov     esi, r12d                                                      ; +0x28a, 0x180108c7a\nmov     rcx, r15                                                       ; +0x28d, 0x180108c7d\ncall    FMOD_OS_CriticalSection_Leave                                  ; +0x290, 0x180108c80\nmov     rbx, [rsp+58h+arg_10]                                          ; +0x295, 0x180108c85\nmov     eax, esi                                                       ; +0x29a, 0x180108c8a\nmov     rbp, [rsp+58h+arg_18]                                          ; +0x29c, 0x180108c8c\nadd     rsp, 30h                                                       ; +0x2a1, 0x180108c91\npop     r15                                                            ; +0x2a5, 0x180108c95\npop     r14                                                            ; +0x2a7, 0x180108c97\npop     r12                                                            ; +0x2a9, 0x180108c99\npop     rdi                                                            ; +0x2ab, 0x180108c9b\npop     rsi                                                            ; +0x2ac, 0x180108c9c\nretn                                                                   ; +0x2ad, 0x180108c9d\nalign 20h                                                              ; +0x2ae, 0x180108c9e\ndd offset loc_180108AE4 - 180000000h; jump table for switch statement  ; +0x2b0, 0x180108ca0", "xrefs": ["<???> @ 0x1801b0780", "<???> @ 0x18020164c"], "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"}