{"type": "func", "start": 6443233568, "end": 6443233806, "name": "sub_1800BF120", "pseudocode": "// \n// sub_1800BF120 from 0x1800bf120 to 0x1800bf20e (238 bytes)\n// \n// 2 xrefs:\n// > _cfltcvt_init_0 @ 0x1800bf266\n// > <???> @ 0x1801fd938\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:02 +0000\n// \n\n__int64 __fastcall sub_1800BF120(__int64 *a1)\n{\n  __int64 v1; // rbx\n  int v3; // edi\n  __int64 result; // rax\n  __int64 v5; // r9\n  int v6; // ecx\n  __int64 v7; // r8\n  int v8; // edx\n  __int64 v9; // rdx\n  _BYTE *v10; // rax\n  int v11; // [rsp+30h] [rbp+8h] BYREF\n\n  v1 = *a1;\n  v3 = 0;\n  v11 = 0;\n  result = sub_1800C1770(&v11);\n  if ( !(_DWORD)result )\n  {\n    v6 = 0;\n    v7 = *(unsigned int *)(v1 + 8);\n    v8 = v11 - *(_DWORD *)(v1 + 24);\n    *(_DWORD *)(v1 + 24) = v11;\n    if ( v8 <= 1000 )\n      v6 = v8;\n    v9 = (unsigned int)(*(_DWORD *)v1 * v6 / 1000);\n    *(_DWORD *)(v1 + 32) += v9;\n    if ( *(_DWORD *)(v1 + 32) - *(_DWORD *)(v1 + 28) >= (int)v7 )\n    {\n      result = ((__int64 (__fastcall *)(__int64 *, _QWORD))a1[1])(a1, *(_QWORD *)(v1 + 40));\n      if ( !(_DWORD)result )\n      {\n        *(_DWORD *)(v1 + 28) += *(_DWORD *)(v1 + 8);\n        if ( *(_DWORD *)(v1 + 20) == 1 )\n        {\n          v10 = *(_BYTE **)(v1 + 40);\n          if ( *(int *)(v1 + 12) > 0 )\n          {\n            do\n            {\n              *v10++ ^= 0x80u;\n              ++v3;\n            }\n            while ( v3 < *(_DWORD *)(v1 + 12) );\n          }\n        }\n        result = FMOD_OS_File_Write(*(HANDLE *)(v1 + 48));\n        if ( !(_DWORD)result )\n        {\n          *(_DWORD *)(v1 + 36) += *(_DWORD *)(v1 + 12);\n          return 0;\n        }\n      }\n    }\n    else\n    {\n      FMOD_OS_Time_Sleep(*(unsigned int *)(v1 + 16), v9, v7, v5);\n      return 0;\n    }\n  }\n  return result;\n}", "assembly": "; \n; sub_1800BF120 from 0x1800bf120 to 0x1800bf20e (238 bytes)\n; \n; 2 xrefs:\n; > _cfltcvt_init_0 @ 0x1800bf266\n; > <???> @ 0x1801fd938\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:02 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1800bf120\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x1800bf125\npush    rdi                                                            ; +0xa, 0x1800bf12a\nsub     rsp, 20h                                                       ; +0xb, 0x1800bf12b\nmov     rbx, [rcx]                                                     ; +0xf, 0x1800bf12f\nmov     rsi, rcx                                                       ; +0x12, 0x1800bf132\nxor     edi, edi                                                       ; +0x15, 0x1800bf135\nlea     rcx, [rsp+28h+arg_0]                                           ; +0x17, 0x1800bf137\nmov     [rsp+28h+arg_0], edi                                           ; +0x1c, 0x1800bf13c\ncall    sub_1800C1770                                                  ; +0x20, 0x1800bf140\ntest    eax, eax                                                       ; +0x25, 0x1800bf145\njnz     loc_1800BF1FE                                                  ; +0x27, 0x1800bf147\nmov     eax, [rsp+28h+arg_0]                                           ; +0x2d, 0x1800bf14d\nmov     ecx, edi                                                       ; +0x31, 0x1800bf151\nmov     r8d, [rbx+8]                                                   ; +0x33, 0x1800bf153\nmov     edx, eax                                                       ; +0x37, 0x1800bf157\nsub     edx, [rbx+18h]                                                 ; +0x39, 0x1800bf159\nmov     [rbx+18h], eax                                                 ; +0x3c, 0x1800bf15c\ncmp     edx, 3E8h                                                      ; +0x3f, 0x1800bf15f\nmov     eax, 10624DD3h                                                 ; +0x45, 0x1800bf165\ncmovle  ecx, edx                                                       ; +0x4a, 0x1800bf16a\nimul    ecx, [rbx]                                                     ; +0x4d, 0x1800bf16d\nimul    ecx                                                            ; +0x50, 0x1800bf170\nsar     edx, 6                                                         ; +0x52, 0x1800bf172\nmov     eax, edx                                                       ; +0x55, 0x1800bf175\nshr     eax, 1Fh                                                       ; +0x57, 0x1800bf177\nadd     edx, eax                                                       ; +0x5a, 0x1800bf17a\nadd     [rbx+20h], edx                                                 ; +0x5c, 0x1800bf17c\nmov     eax, [rbx+20h]                                                 ; +0x5f, 0x1800bf17f\nsub     eax, [rbx+1Ch]                                                 ; +0x62, 0x1800bf182\ncmp     eax, r8d                                                       ; +0x65, 0x1800bf185\njge     short loc_1800BF1A4                                            ; +0x68, 0x1800bf188\nmov     ecx, [rbx+10h]                                                 ; +0x6a, 0x1800bf18a\ncall    FMOD_OS_Time_Sleep                                             ; +0x6d, 0x1800bf18d\nxor     eax, eax                                                       ; +0x72, 0x1800bf192\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x74, 0x1800bf194\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x79, 0x1800bf199\nadd     rsp, 20h                                                       ; +0x7e, 0x1800bf19e\npop     rdi                                                            ; +0x82, 0x1800bf1a2\nretn                                                                   ; +0x83, 0x1800bf1a3\nmov     rdx, [rbx+28h]                                                 ; +0x84, 0x1800bf1a4\nmov     rcx, rsi                                                       ; +0x88, 0x1800bf1a8\ncall    qword ptr [rsi+8]                                              ; +0x8b, 0x1800bf1ab\ntest    eax, eax                                                       ; +0x8e, 0x1800bf1ae\njnz     short loc_1800BF1FE                                            ; +0x90, 0x1800bf1b0\nmov     eax, [rbx+8]                                                   ; +0x92, 0x1800bf1b2\nadd     [rbx+1Ch], eax                                                 ; +0x95, 0x1800bf1b5\ncmp     dword ptr [rbx+14h], 1                                         ; +0x98, 0x1800bf1b8\njnz     short loc_1800BF1DE                                            ; +0x9c, 0x1800bf1bc\nmov     rax, [rbx+28h]                                                 ; +0x9e, 0x1800bf1be\ncmp     [rbx+0Ch], edi                                                 ; +0xa2, 0x1800bf1c2\njle     short loc_1800BF1DE                                            ; +0xa5, 0x1800bf1c5\nnop     word ptr [rax+rax+00000000h]                                   ; +0xa7, 0x1800bf1c7\nxor     byte ptr [rax], 80h                                            ; +0xb0, 0x1800bf1d0\nlea     rax, [rax+1]                                                   ; +0xb3, 0x1800bf1d3\ninc     edi                                                            ; +0xb7, 0x1800bf1d7\ncmp     edi, [rbx+0Ch]                                                 ; +0xb9, 0x1800bf1d9\njl      short loc_1800BF1D0                                            ; +0xbc, 0x1800bf1dc\nmov     r8d, [rbx+0Ch]                                                 ; +0xbe, 0x1800bf1de\nxor     r9d, r9d                                                       ; +0xc2, 0x1800bf1e2\nmov     rdx, [rbx+28h]                                                 ; +0xc5, 0x1800bf1e5\nmov     rcx, [rbx+30h]; hFile                                          ; +0xc9, 0x1800bf1e9\ncall    FMOD_OS_File_Write                                             ; +0xcd, 0x1800bf1ed\ntest    eax, eax                                                       ; +0xd2, 0x1800bf1f2\njnz     short loc_1800BF1FE                                            ; +0xd4, 0x1800bf1f4\nmov     eax, [rbx+0Ch]                                                 ; +0xd6, 0x1800bf1f6\nadd     [rbx+24h], eax                                                 ; +0xd9, 0x1800bf1f9\nxor     eax, eax                                                       ; +0xdc, 0x1800bf1fc\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xde, 0x1800bf1fe\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xe3, 0x1800bf203\nadd     rsp, 20h                                                       ; +0xe8, 0x1800bf208\npop     rdi                                                            ; +0xec, 0x1800bf20c\nretn                                                                   ; +0xed, 0x1800bf20d", "xrefs": ["_cfltcvt_init_0 @ 0x1800bf266", "<???> @ 0x1801fd938"], "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"}