{"type": "func", "start": 6443266000, "end": 6443266407, "name": "sub_1800C6FD0", "pseudocode": "// \n// sub_1800C6FD0 from 0x1800c6fd0 to 0x1800c7167 (407 bytes)\n// \n// 2 xrefs:\n// > sub_1800E31C0 @ 0x1800e35ff\n// > <???> @ 0x1801fe070\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 10:54:05 +0000\n// \n\n__int64 __fastcall sub_1800C6FD0(int a1, __int64 *a2)\n{\n  __int64 v4; // rbx\n  __int64 *v5; // r14\n  struct _RTL_CRITICAL_SECTION *v6; // rsi\n  void *v7; // rax\n  unsigned int v8; // edi\n  char v10[256]; // [rsp+50h] [rbp-138h] BYREF\n\n  v4 = qword_1801EF9A8[a1];\n  v5 = &qword_1801EF9A8[a1];\n  if ( v4 )\n    goto LABEL_8;\n  v6 = *((struct _RTL_CRITICAL_SECTION **)off_1801AED20 + 37);\n  FMOD_OS_CriticalSection_Enter(v6);\n  v4 = *v5;\n  if ( *v5 )\n  {\nLABEL_7:\n    FMOD_OS_CriticalSection_Leave(v6);\nLABEL_8:\n    *a2 = v4;\n    return 0;\n  }\n  v7 = sub_1800B6880(\n         *((_QWORD *)off_1801AED20 + 52),\n         376,\n         \"C:\\\\buildagent1\\\\work\\\\570ad728b1678096\\\\core_api\\\\src\\\\fmod_async.cpp\",\n         368,\n         0x200000);\n  v4 = (__int64)v7;\n  if ( v7 )\n  {\n    sub_1800B8400((__int64)v7);\n    *(_DWORD *)(v4 + 368) = a1;\n    *(_QWORD *)(v4 + 344) = v4 + 336;\n    *(_QWORD *)(v4 + 336) = v4 + 336;\n    *(_QWORD *)(v4 + 352) = 0;\n    *(_QWORD *)(v4 + 360) = 0;\n    v8 = FMOD_OS_CriticalSection_Create((struct _RTL_CRITICAL_SECTION **)(v4 + 360), 0);\n    if ( !v8 )\n    {\n      sub_1800B7CA0((int)v10, 256, \"FMOD nonblocking thread (%d)\", *(_DWORD *)(v4 + 368));\n      v8 = sub_1800B8690(v4, v10, (__int64)sub_1800C6FC0, v4, 4, 1, 0, 0, 1);\n      if ( !v8 )\n      {\n        *((_QWORD *)off_1801AED20 + *(int *)(v4 + 368) + 38) = *(_QWORD *)(v4 + 272);\n        *v5 = v4;\n        goto LABEL_7;\n      }\n    }\n  }\n  else\n  {\n    v8 = 38;\n  }\n  FMOD_OS_CriticalSection_Leave(v6);\n  return v8;\n}", "assembly": "; \n; sub_1800C6FD0 from 0x1800c6fd0 to 0x1800c7167 (407 bytes)\n; \n; 2 xrefs:\n; > sub_1800E31C0 @ 0x1800e35ff\n; > <???> @ 0x1801fe070\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 10:54:05 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x1800c6fd0\npush    rbp                                                            ; +0x5, 0x1800c6fd5\npush    rsi                                                            ; +0x6, 0x1800c6fd6\npush    rdi                                                            ; +0x7, 0x1800c6fd7\npush    r14                                                            ; +0x8, 0x1800c6fd8\npush    r15                                                            ; +0xa, 0x1800c6fda\nsub     rsp, 160h                                                      ; +0xc, 0x1800c6fdc\nmov     rax, cs:__security_cookie                                      ; +0x13, 0x1800c6fe3\nxor     rax, rsp                                                       ; +0x1a, 0x1800c6fea\nmov     [rsp+188h+var_38], rax                                         ; +0x1d, 0x1800c6fed\nmovsxd  rdi, ecx                                                       ; +0x25, 0x1800c6ff5\nmov     r15, rdx                                                       ; +0x28, 0x1800c6ff8\nlea     rcx, qword_1801EF9A8                                           ; +0x2b, 0x1800c6ffb\nmov     rbx, [rcx+rdi*8]                                               ; +0x32, 0x1800c7002\nlea     r14, [rcx+rdi*8]                                               ; +0x36, 0x1800c7006\nnop                                                                    ; +0x3a, 0x1800c700a\ntest    rbx, rbx                                                       ; +0x3b, 0x1800c700b\njnz     loc_1800C712A                                                  ; +0x3e, 0x1800c700e\nmov     rax, cs:off_1801AED20                                          ; +0x44, 0x1800c7014\nmov     rsi, [rax+128h]                                                ; +0x4b, 0x1800c701b\nmov     rcx, rsi                                                       ; +0x52, 0x1800c7022\ncall    FMOD_OS_CriticalSection_Enter                                  ; +0x55, 0x1800c7025\nmov     rbx, [r14]                                                     ; +0x5a, 0x1800c702a\nnop                                                                    ; +0x5d, 0x1800c702d\ntest    rbx, rbx                                                       ; +0x5e, 0x1800c702e\njnz     loc_1800C7122                                                  ; +0x61, 0x1800c7031\nmov     rcx, cs:off_1801AED20                                          ; +0x67, 0x1800c7037\nlea     r8, aCBuildagent1Wo_50; \"C:\\\\buildagent1\\\\work\\\\570ad728b1678096\"... ; +0x6e, 0x1800c703e\nmov     r9d, 170h                                                      ; +0x75, 0x1800c7045\nmov     [rsp+188h+var_168], 200000h                                    ; +0x7b, 0x1800c704b\nmov     rcx, [rcx+1A0h]                                                ; +0x83, 0x1800c7053\nlea     edx, [r9+8]                                                    ; +0x8a, 0x1800c705a\ncall    sub_1800B6880                                                  ; +0x8e, 0x1800c705e\nmov     rbx, rax                                                       ; +0x93, 0x1800c7063\ntest    rax, rax                                                       ; +0x96, 0x1800c7066\njz      loc_1800C7156                                                  ; +0x99, 0x1800c7069\nmov     rcx, rax                                                       ; +0x9f, 0x1800c706f\ncall    sub_1800B8400                                                  ; +0xa2, 0x1800c7072\nlea     rcx, [rbx+150h]                                                ; +0xa7, 0x1800c7077\nmov     [rbx+170h], edi                                                ; +0xae, 0x1800c707e\nxor     ebp, ebp                                                       ; +0xb4, 0x1800c7084\nmov     [rcx+8], rcx                                                   ; +0xb6, 0x1800c7086\nmov     [rcx], rcx                                                     ; +0xba, 0x1800c708a\nxor     edx, edx                                                       ; +0xbd, 0x1800c708d\nmov     [rcx+10h], rbp                                                 ; +0xbf, 0x1800c708f\nlea     rcx, [rbx+168h]                                                ; +0xc3, 0x1800c7093\nmov     [rcx], rbp                                                     ; +0xca, 0x1800c709a\ncall    FMOD_OS_CriticalSection_Create                                 ; +0xcd, 0x1800c709d\nmov     edi, eax                                                       ; +0xd2, 0x1800c70a2\ntest    eax, eax                                                       ; +0xd4, 0x1800c70a4\njnz     loc_1800C715B                                                  ; +0xd6, 0x1800c70a6\nmov     r9d, [rbx+170h]                                                ; +0xdc, 0x1800c70ac\nlea     r8, aFmodNonblockin; \"FMOD nonblocking thread (%d)\"            ; +0xe3, 0x1800c70b3\nmov     edx, 100h                                                      ; +0xea, 0x1800c70ba\nlea     rcx, [rsp+188h+var_138]                                        ; +0xef, 0x1800c70bf\ncall    sub_1800B7CA0                                                  ; +0xf4, 0x1800c70c4\nmov     [rsp+188h+var_148], 1                                          ; +0xf9, 0x1800c70c9\nlea     r8, sub_1800C6FC0                                              ; +0xfe, 0x1800c70ce\nmov     [rsp+188h+var_150], rbp                                        ; +0x105, 0x1800c70d5\nlea     rdx, [rsp+188h+var_138]                                        ; +0x10a, 0x1800c70da\nmov     [rsp+188h+var_158], ebp                                        ; +0x10f, 0x1800c70df\nmov     r9, rbx                                                        ; +0x113, 0x1800c70e3\nmov     [rsp+188h+var_160], 1                                          ; +0x116, 0x1800c70e6\nmov     rcx, rbx                                                       ; +0x11b, 0x1800c70eb\nmov     [rsp+188h+var_168], 4                                          ; +0x11e, 0x1800c70ee\ncall    sub_1800B8690                                                  ; +0x126, 0x1800c70f6\nmov     edi, eax                                                       ; +0x12b, 0x1800c70fb\ntest    eax, eax                                                       ; +0x12d, 0x1800c70fd\njnz     short loc_1800C715B                                            ; +0x12f, 0x1800c70ff\nmovsxd  rdx, dword ptr [rbx+170h]                                      ; +0x131, 0x1800c7101\nmov     rax, cs:off_1801AED20                                          ; +0x138, 0x1800c7108\nmov     rcx, [rbx+110h]                                                ; +0x13f, 0x1800c710f\nmov     [rax+rdx*8+130h], rcx                                          ; +0x146, 0x1800c7116\nnop                                                                    ; +0x14e, 0x1800c711e\nmov     [r14], rbx                                                     ; +0x14f, 0x1800c711f\nmov     rcx, rsi                                                       ; +0x152, 0x1800c7122\ncall    FMOD_OS_CriticalSection_Leave                                  ; +0x155, 0x1800c7125\nmov     [r15], rbx                                                     ; +0x15a, 0x1800c712a\nxor     eax, eax                                                       ; +0x15d, 0x1800c712d\nmov     rcx, [rsp+188h+var_38]                                         ; +0x15f, 0x1800c712f\nxor     rcx, rsp; StackCookie                                          ; +0x167, 0x1800c7137\ncall    __security_check_cookie                                        ; +0x16a, 0x1800c713a\nmov     rbx, [rsp+188h+arg_10]                                         ; +0x16f, 0x1800c713f\nadd     rsp, 160h                                                      ; +0x177, 0x1800c7147\npop     r15                                                            ; +0x17e, 0x1800c714e\npop     r14                                                            ; +0x180, 0x1800c7150\npop     rdi                                                            ; +0x182, 0x1800c7152\npop     rsi                                                            ; +0x183, 0x1800c7153\npop     rbp                                                            ; +0x184, 0x1800c7154\nretn                                                                   ; +0x185, 0x1800c7155\nmov     edi, 26h ; '&'                                                 ; +0x186, 0x1800c7156\nmov     rcx, rsi                                                       ; +0x18b, 0x1800c715b\ncall    FMOD_OS_CriticalSection_Leave                                  ; +0x18e, 0x1800c715e\nmov     eax, edi                                                       ; +0x193, 0x1800c7163\njmp     short loc_1800C712F                                            ; +0x195, 0x1800c7165", "xrefs": ["sub_1800E31C0 @ 0x1800e35ff", "<???> @ 0x1801fe070"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}