{"type": "func", "start": 6443238240, "end": 6443238643, "name": "sub_1800C0360", "pseudocode": "// \n// sub_1800C0360 from 0x1800c0360 to 0x1800c04f3 (403 bytes)\n// \n// 2 xrefs:\n// > sub_1800BF8E0 @ 0x1800bf914\n// > <???> @ 0x1801fd9ec\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:03 +0000\n// \n\n__int64 __fastcall sub_1800C0360(__int64 a1, void *a2, __int64 a3, unsigned int *a4)\n{\n  int v7; // ecx\n  __int64 v8; // rcx\n  unsigned int v9; // ebx\n  int v10; // ecx\n  __int64 v11; // rcx\n  unsigned int v12; // ebx\n  unsigned int v13; // r8d\n  unsigned __int64 v14; // rcx\n  __int64 result; // rax\n  int v16; // [rsp+40h] [rbp-48h] BYREF\n  int v17; // [rsp+44h] [rbp-44h] BYREF\n  __int64 v18; // [rsp+48h] [rbp-40h] BYREF\n  __int64 v19; // [rsp+50h] [rbp-38h] BYREF\n  __int64 v20[6]; // [rsp+58h] [rbp-30h] BYREF\n  __int16 v21; // [rsp+90h] [rbp+8h] BYREF\n  unsigned int v22; // [rsp+A8h] [rbp+20h] BYREF\n\n  v18 = 0;\n  v20[0] = 0;\n  v17 = 0;\n  v16 = 0;\n  v21 = 0;\n  v19 = 0;\n  v22 = 0;\n  *a4 = 0;\n  while ( 1 )\n  {\n    v7 = (*(__int64 (__fastcall **)(_QWORD, _QWORD, __int64 *, __int64, __int64 *, int *, int *, __int16 *))(**(_QWORD **)(a1 + 376) + 56LL))(\n           *(_QWORD *)(a1 + 376),\n           *(unsigned __int16 *)(a1 + 392),\n           &v18,\n           a1 + 400,\n           v20,\n           &v17,\n           &v16,\n           &v21);\n    if ( v7 < 0 )\n      break;\n    (*(void (__fastcall **)(__int64, __int64 *, unsigned int *))(*(_QWORD *)v18 + 56LL))(v18, &v19, &v22);\n    v8 = *(unsigned int *)(a1 + 424);\n    v9 = v22;\n    if ( (unsigned int)v8 < v22 )\n    {\n      memmove(a2, (const void *)(v19 + v8), v22 - (unsigned int)v8);\n      v11 = *(_QWORD *)(a1 + 8);\n      v12 = v9 - *(_DWORD *)(a1 + 424);\n      v13 = *(_DWORD *)(v11 + 12);\n      if ( v13 )\n      {\n        switch ( *(_DWORD *)(v11 + 8) )\n        {\n          case 1:\n            v14 = 8;\n            break;\n          case 2:\n            v14 = 16;\n            break;\n          case 3:\n            v14 = 24;\n            break;\n          default:\n            if ( (unsigned int)(*(_DWORD *)(v11 + 8) - 4) >= 2 )\n            {\n              *a4 = v12;\n              goto LABEL_16;\n            }\n            v14 = 32;\n            break;\n        }\n        *a4 = (unsigned int)(8 * (unsigned __int64)v12 / v14) / v13;\n      }\nLABEL_16:\n      v10 = 0;\n      goto LABEL_17;\n    }\n    v10 = v8 - v22;\nLABEL_17:\n    *(_DWORD *)(a1 + 424) = v10;\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)v18 + 16LL))(v18);\n    if ( *a4 )\n      return 0;\n  }\n  result = 13;\n  if ( v7 == -1072886833 )\n    return 16;\n  return result;\n}", "assembly": "; \n; sub_1800C0360 from 0x1800c0360 to 0x1800c04f3 (403 bytes)\n; \n; 2 xrefs:\n; > sub_1800BF8E0 @ 0x1800bf914\n; > <???> @ 0x1801fd9ec\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:03 +0000\n; \nmov     rax, rsp                                                       ; +0x0, 0x1800c0360\nmov     [rax+18h], rbp                                                 ; +0x3, 0x1800c0363\npush    rsi                                                            ; +0x7, 0x1800c0367\npush    rdi                                                            ; +0x8, 0x1800c0368\npush    r12                                                            ; +0x9, 0x1800c0369\npush    r14                                                            ; +0xb, 0x1800c036b\npush    r15                                                            ; +0xd, 0x1800c036d\nsub     rsp, 60h                                                       ; +0xf, 0x1800c036f\nxor     r15d, r15d                                                     ; +0x13, 0x1800c0373\nmov     [rax+10h], rbx                                                 ; +0x16, 0x1800c0376\nmov     rsi, r9                                                        ; +0x1a, 0x1800c037a\nmov     [rax-40h], r15                                                 ; +0x1d, 0x1800c037d\nmov     rbp, rdx                                                       ; +0x21, 0x1800c0381\nmov     [rax-30h], r15                                                 ; +0x24, 0x1800c0384\nmov     rdi, rcx                                                       ; +0x28, 0x1800c0388\nmov     [rax-44h], r15d                                                ; +0x2b, 0x1800c038b\nlea     r12d, [r15+10h]                                                ; +0x2f, 0x1800c038f\nmov     [rax-48h], r15d                                                ; +0x33, 0x1800c0393\nmov     [rax+8], r15w                                                  ; +0x37, 0x1800c0397\nmov     [rax-38h], r15                                                 ; +0x3c, 0x1800c039c\nmov     [rax+20h], r15d                                                ; +0x40, 0x1800c03a0\nmov     [r9], r15d                                                     ; +0x44, 0x1800c03a4\nnop     word ptr [rax+rax+00000000h]                                   ; +0x47, 0x1800c03a7\nmov     rcx, [rdi+178h]                                                ; +0x50, 0x1800c03b0\nlea     rdx, [rsp+88h+arg_0]                                           ; +0x57, 0x1800c03b7\nmov     [rsp+88h+var_50], rdx                                          ; +0x5f, 0x1800c03bf\nlea     r9, [rdi+190h]                                                 ; +0x64, 0x1800c03c4\nlea     rdx, [rsp+88h+var_48]                                          ; +0x6b, 0x1800c03cb\nmov     [rsp+88h+var_58], rdx                                          ; +0x70, 0x1800c03d0\nlea     r8, [rsp+88h+var_40]                                           ; +0x75, 0x1800c03d5\nmov     rax, [rcx]                                                     ; +0x7a, 0x1800c03da\nlea     rdx, [rsp+88h+var_44]                                          ; +0x7d, 0x1800c03dd\nmov     [rsp+88h+var_60], rdx                                          ; +0x82, 0x1800c03e2\nlea     rdx, [rsp+88h+var_30]                                          ; +0x87, 0x1800c03e7\nmov     [rsp+88h+var_68], rdx                                          ; +0x8c, 0x1800c03ec\nmovzx   edx, word ptr [rdi+188h]                                       ; +0x91, 0x1800c03f1\ncall    qword ptr [rax+38h]                                            ; +0x98, 0x1800c03f8\nmov     ecx, eax                                                       ; +0x9b, 0x1800c03fb\ntest    eax, eax                                                       ; +0x9d, 0x1800c03fd\njs      loc_1800C04C7                                                  ; +0x9f, 0x1800c03ff\nmov     rcx, [rsp+88h+var_40]                                          ; +0xa5, 0x1800c0405\nlea     r8, [rsp+88h+arg_18]                                           ; +0xaa, 0x1800c040a\nlea     rdx, [rsp+88h+var_38]                                          ; +0xb2, 0x1800c0412\nmov     rax, [rcx]                                                     ; +0xb7, 0x1800c0417\ncall    qword ptr [rax+38h]                                            ; +0xba, 0x1800c041a\nmov     ecx, [rdi+1A8h]                                                ; +0xbd, 0x1800c041d\nmov     ebx, [rsp+88h+arg_18]                                          ; +0xc3, 0x1800c0423\ncmp     ecx, ebx                                                       ; +0xca, 0x1800c042a\njb      short loc_1800C0432                                            ; +0xcc, 0x1800c042c\nsub     ecx, ebx                                                       ; +0xce, 0x1800c042e\njmp     short loc_1800C04A8                                            ; +0xd0, 0x1800c0430\nmov     rdx, rcx                                                       ; +0xd2, 0x1800c0432\nmov     r8d, ebx                                                       ; +0xd5, 0x1800c0435\nadd     rdx, [rsp+88h+var_38]; Src                                     ; +0xd8, 0x1800c0438\nsub     r8d, ecx; Size                                                 ; +0xdd, 0x1800c043d\nmov     rcx, rbp; void *                                               ; +0xe0, 0x1800c0440\ncall    memmove                                                        ; +0xe3, 0x1800c0443\nmov     rcx, [rdi+8]                                                   ; +0xe8, 0x1800c0448\nsub     ebx, [rdi+1A8h]                                                ; +0xec, 0x1800c044c\nmov     r8d, [rcx+0Ch]                                                 ; +0xf2, 0x1800c0452\ntest    r8d, r8d                                                       ; +0xf6, 0x1800c0456\njz      short loc_1800C04A5                                            ; +0xf9, 0x1800c0459\nmov     eax, [rcx+8]                                                   ; +0xfb, 0x1800c045b\nsub     eax, 1                                                         ; +0xfe, 0x1800c045e\njz      short loc_1800C048E                                            ; +0x101, 0x1800c0461\nsub     eax, 1                                                         ; +0x103, 0x1800c0463\njz      short loc_1800C0489                                            ; +0x106, 0x1800c0466\nsub     eax, 1                                                         ; +0x108, 0x1800c0468\njz      short loc_1800C0482                                            ; +0x10b, 0x1800c046b\nsub     eax, 1                                                         ; +0x10d, 0x1800c046d\njz      short loc_1800C047B                                            ; +0x110, 0x1800c0470\ncmp     eax, 1                                                         ; +0x112, 0x1800c0472\njz      short loc_1800C047B                                            ; +0x115, 0x1800c0475\nmov     [rsi], ebx                                                     ; +0x117, 0x1800c0477\njmp     short loc_1800C04A5                                            ; +0x119, 0x1800c0479\nmov     ecx, 20h ; ' '                                                 ; +0x11b, 0x1800c047b\njmp     short loc_1800C0493                                            ; +0x120, 0x1800c0480\nmov     ecx, 18h                                                       ; +0x122, 0x1800c0482\njmp     short loc_1800C0493                                            ; +0x127, 0x1800c0487\nmov     rcx, r12                                                       ; +0x129, 0x1800c0489\njmp     short loc_1800C0493                                            ; +0x12c, 0x1800c048c\nmov     ecx, 8                                                         ; +0x12e, 0x1800c048e\nxor     edx, edx                                                       ; +0x133, 0x1800c0493\nmov     eax, ebx                                                       ; +0x135, 0x1800c0495\nshl     rax, 3                                                         ; +0x137, 0x1800c0497\ndiv     rcx                                                            ; +0x13b, 0x1800c049b\nxor     edx, edx                                                       ; +0x13e, 0x1800c049e\ndiv     r8d                                                            ; +0x140, 0x1800c04a0\nmov     [rsi], eax                                                     ; +0x143, 0x1800c04a3\nmov     ecx, r15d                                                      ; +0x145, 0x1800c04a5\nmov     [rdi+1A8h], ecx                                                ; +0x148, 0x1800c04a8\nmov     rcx, [rsp+88h+var_40]                                          ; +0x14e, 0x1800c04ae\nmov     rdx, [rcx]                                                     ; +0x153, 0x1800c04b3\ncall    qword ptr [rdx+10h]                                            ; +0x156, 0x1800c04b6\ncmp     [rsi], r15d                                                    ; +0x159, 0x1800c04b9\njz      loc_1800C03B0                                                  ; +0x15c, 0x1800c04bc\nmov     eax, r15d                                                      ; +0x162, 0x1800c04c2\njmp     short loc_1800C04D6                                            ; +0x165, 0x1800c04c5\ncmp     ecx, 0C00D0BCFh                                                ; +0x167, 0x1800c04c7\nmov     eax, 0Dh                                                       ; +0x16d, 0x1800c04cd\ncmovz   eax, r12d                                                      ; +0x172, 0x1800c04d2\nmov     rbx, [rsp+88h+arg_8]                                           ; +0x176, 0x1800c04d6\nmov     rbp, [rsp+88h+arg_10]                                          ; +0x17e, 0x1800c04de\nadd     rsp, 60h                                                       ; +0x186, 0x1800c04e6\npop     r15                                                            ; +0x18a, 0x1800c04ea\npop     r14                                                            ; +0x18c, 0x1800c04ec\npop     r12                                                            ; +0x18e, 0x1800c04ee\npop     rdi                                                            ; +0x190, 0x1800c04f0\npop     rsi                                                            ; +0x191, 0x1800c04f1\nretn                                                                   ; +0x192, 0x1800c04f2", "xrefs": ["sub_1800BF8E0 @ 0x1800bf914", "<???> @ 0x1801fd9ec"], "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"}