{"type": "func", "start": 6442773984, "end": 6442774477, "name": "sub_18004EDE0", "pseudocode": "// \n// sub_18004EDE0 from 0x18004ede0 to 0x18004efcd (493 bytes)\n// \n// 5 xrefs:\n// > <???> @ 0x180166e48\n// > <???> @ 0x180166e88\n// > <???> @ 0x180166ec8\n// > <???> @ 0x1801f8844\n// > <???> @ 0x1801f8850\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_DWORD *__fastcall sub_18004EDE0(__int64 a1, __int64 a2, int *a3)\n{\n  int v5; // esi\n  __int64 v6; // rdi\n  int v7; // r13d\n  _DWORD *v8; // r15\n  int v9; // eax\n  int v10; // ebp\n  unsigned int *v11; // r14\n  unsigned int v12; // ebx\n  int v13; // eax\n  int v14; // eax\n  int i; // ecx\n  __int64 v16; // rbx\n  int *v17; // r14\n  int v18; // eax\n  __int64 v19; // r9\n  int v20; // r8d\n  int *v21; // rdx\n  __int64 v22; // rax\n  int *v23; // rcx\n  int v24; // eax\n  __int64 v27; // [rsp+68h] [rbp+10h]\n\n  v5 = 1;\n  v6 = 0;\n  v7 = 0;\n  v8 = (_DWORD *)sub_180033C30(a1, 1, 1812);\n  v27 = *(_QWORD *)(a2 + 32);\n  if ( v8 )\n  {\n    *v8 = sub_180048210(a3, 0x18u);\n    v8[1] = sub_180048210(a3, 0x18u);\n    v8[2] = sub_180048210(a3, 0x18u) + 1;\n    v8[3] = sub_180048210(a3, 6u) + 1;\n    v9 = sub_180048210(a3, 8u);\n    v8[4] = v9;\n    if ( v9 >= 0 )\n    {\n      v10 = 0;\n      if ( (int)v8[3] <= 0 )\n      {\nLABEL_12:\n        if ( v7 <= 0 )\n        {\nLABEL_16:\n          v19 = (int)v8[4];\n          v20 = *(_DWORD *)(v27 + 24);\n          if ( (int)v19 < v20 )\n          {\n            if ( v7 <= 0 )\n            {\nLABEL_22:\n              v23 = *(int **)(v27 + 8 * v19 + 2848);\n              v24 = *v23;\n              if ( *v23 <= 0 )\n                return v8;\n              while ( 1 )\n              {\n                v5 *= v8[3];\n                if ( v5 > v23[1] )\n                  break;\n                if ( --v24 <= 0 )\n                  return v8;\n              }\n            }\n            else\n            {\n              v21 = v8 + 69;\n              while ( 1 )\n              {\n                v22 = *v21;\n                if ( (int)v22 >= v20 || !*(_DWORD *)(*(_QWORD *)(v27 + 8 * v22 + 2848) + 16LL) )\n                  break;\n                ++v6;\n                ++v21;\n                if ( v6 >= v7 )\n                  goto LABEL_22;\n              }\n            }\n          }\n        }\n        else\n        {\n          v16 = 0;\n          v17 = v8 + 69;\n          while ( 1 )\n          {\n            v18 = sub_180048210(a3, 8u);\n            if ( v18 < 0 )\n              break;\n            *v17 = v18;\n            ++v16;\n            ++v17;\n            if ( v16 >= v7 )\n              goto LABEL_16;\n          }\n        }\n      }\n      else\n      {\n        v11 = v8 + 5;\n        while ( 1 )\n        {\n          v12 = sub_180048210(a3, 3u);\n          v13 = sub_180048210(a3, 1u);\n          if ( v13 < 0 )\n            break;\n          if ( v13 )\n          {\n            v14 = sub_180048210(a3, 5u);\n            if ( v14 < 0 )\n              break;\n            v12 |= 8 * v14;\n          }\n          *v11 = v12;\n          for ( i = 0; v12; v12 >>= 1 )\n            i += v12 & 1;\n          v7 += i;\n          ++v10;\n          ++v11;\n          if ( v10 >= v8[3] )\n            goto LABEL_12;\n        }\n      }\n    }\n    memset(v8, 0, 0x714u);\n    sub_180033C90(a1, (__int64)v8);\n  }\n  return nullptr;\n}", "assembly": "; \n; sub_18004EDE0 from 0x18004ede0 to 0x18004efcd (493 bytes)\n; \n; 5 xrefs:\n; > <???> @ 0x180166e48\n; > <???> @ 0x180166e88\n; > <???> @ 0x180166ec8\n; > <???> @ 0x1801f8844\n; > <???> @ 0x1801f8850\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, 0x18004ede0\nmov     [rsp+arg_0], rcx                                               ; +0x5, 0x18004ede5\npush    rbp                                                            ; +0xa, 0x18004edea\npush    rsi                                                            ; +0xb, 0x18004edeb\npush    rdi                                                            ; +0xc, 0x18004edec\npush    r12                                                            ; +0xd, 0x18004eded\npush    r13                                                            ; +0xf, 0x18004edef\npush    r14                                                            ; +0x11, 0x18004edf1\npush    r15                                                            ; +0x13, 0x18004edf3\nsub     rsp, 20h                                                       ; +0x15, 0x18004edf5\nmov     r12, r8                                                        ; +0x19, 0x18004edf9\nmov     rbx, rdx                                                       ; +0x1c, 0x18004edfc\nmov     esi, 1                                                         ; +0x1f, 0x18004edff\nxor     edi, edi                                                       ; +0x24, 0x18004ee04\nmov     edx, esi                                                       ; +0x26, 0x18004ee06\nmov     r8d, 714h                                                      ; +0x28, 0x18004ee08\nmov     r13d, edi                                                      ; +0x2e, 0x18004ee0e\ncall    sub_180033C30                                                  ; +0x31, 0x18004ee11\nmov     r15, rax                                                       ; +0x36, 0x18004ee16\nmov     rax, [rbx+20h]                                                 ; +0x39, 0x18004ee19\nmov     [rsp+58h+arg_8], rax                                           ; +0x3d, 0x18004ee1d\ntest    r15, r15                                                       ; +0x42, 0x18004ee22\njz      loc_18004EFB6                                                  ; +0x45, 0x18004ee25\nlea     edx, [rdi+18h]                                                 ; +0x4b, 0x18004ee2b\nmov     rcx, r12                                                       ; +0x4e, 0x18004ee2e\ncall    sub_180048210                                                  ; +0x51, 0x18004ee31\nlea     edx, [rdi+18h]                                                 ; +0x56, 0x18004ee36\nmov     [r15], eax                                                     ; +0x59, 0x18004ee39\nmov     rcx, r12                                                       ; +0x5c, 0x18004ee3c\ncall    sub_180048210                                                  ; +0x5f, 0x18004ee3f\nlea     edx, [rdi+18h]                                                 ; +0x64, 0x18004ee44\nmov     [r15+4], eax                                                   ; +0x67, 0x18004ee47\nmov     rcx, r12                                                       ; +0x6b, 0x18004ee4b\ncall    sub_180048210                                                  ; +0x6e, 0x18004ee4e\ninc     eax                                                            ; +0x73, 0x18004ee53\nlea     edx, [rdi+6]                                                   ; +0x75, 0x18004ee55\nmov     rcx, r12                                                       ; +0x78, 0x18004ee58\nmov     [r15+8], eax                                                   ; +0x7b, 0x18004ee5b\ncall    sub_180048210                                                  ; +0x7f, 0x18004ee5f\ninc     eax                                                            ; +0x84, 0x18004ee64\nlea     edx, [rdi+8]                                                   ; +0x86, 0x18004ee66\nmov     rcx, r12                                                       ; +0x89, 0x18004ee69\nmov     [r15+0Ch], eax                                                 ; +0x8c, 0x18004ee6c\ncall    sub_180048210                                                  ; +0x90, 0x18004ee70\nmov     [r15+10h], eax                                                 ; +0x95, 0x18004ee75\ntest    eax, eax                                                       ; +0x99, 0x18004ee79\njs      loc_18004EF99                                                  ; +0x9b, 0x18004ee7b\nmov     ebp, edi                                                       ; +0xa1, 0x18004ee81\ncmp     [r15+0Ch], edi                                                 ; +0xa3, 0x18004ee83\njle     short loc_18004EEF9                                            ; +0xa7, 0x18004ee87\nlea     r14, [r15+14h]                                                 ; +0xa9, 0x18004ee89\nnop     dword ptr [rax]                                                ; +0xad, 0x18004ee8d\nmov     edx, 3                                                         ; +0xb0, 0x18004ee90\nmov     rcx, r12                                                       ; +0xb5, 0x18004ee95\ncall    sub_180048210                                                  ; +0xb8, 0x18004ee98\nmov     edx, esi                                                       ; +0xbd, 0x18004ee9d\nmov     rcx, r12                                                       ; +0xbf, 0x18004ee9f\nmov     ebx, eax                                                       ; +0xc2, 0x18004eea2\ncall    sub_180048210                                                  ; +0xc4, 0x18004eea4\ntest    eax, eax                                                       ; +0xc9, 0x18004eea9\njs      loc_18004EF99                                                  ; +0xcb, 0x18004eeab\njz      short loc_18004EED1                                            ; +0xd1, 0x18004eeb1\nmov     edx, 5                                                         ; +0xd3, 0x18004eeb3\nmov     rcx, r12                                                       ; +0xd8, 0x18004eeb8\ncall    sub_180048210                                                  ; +0xdb, 0x18004eebb\ntest    eax, eax                                                       ; +0xe0, 0x18004eec0\njs      loc_18004EF99                                                  ; +0xe2, 0x18004eec2\nlea     eax, ds:0[rax*8]                                               ; +0xe8, 0x18004eec8\nor      ebx, eax                                                       ; +0xef, 0x18004eecf\nmov     [r14], ebx                                                     ; +0xf1, 0x18004eed1\nmov     ecx, edi                                                       ; +0xf4, 0x18004eed4\ntest    ebx, ebx                                                       ; +0xf6, 0x18004eed6\njz      short loc_18004EEEA                                            ; +0xf8, 0x18004eed8\nnop     word ptr [rax+rax+00h]                                         ; +0xfa, 0x18004eeda\nmov     eax, ebx                                                       ; +0x100, 0x18004eee0\nand     eax, esi                                                       ; +0x102, 0x18004eee2\nadd     ecx, eax                                                       ; +0x104, 0x18004eee4\nshr     ebx, 1                                                         ; +0x106, 0x18004eee6\njnz     short loc_18004EEE0                                            ; +0x108, 0x18004eee8\nadd     r13d, ecx                                                      ; +0x10a, 0x18004eeea\ninc     ebp                                                            ; +0x10d, 0x18004eeed\nadd     r14, 4                                                         ; +0x10f, 0x18004eeef\ncmp     ebp, [r15+0Ch]                                                 ; +0x113, 0x18004eef3\njl      short loc_18004EE90                                            ; +0x117, 0x18004eef7\nmovsxd  rbp, r13d                                                      ; +0x119, 0x18004eef9\ntest    r13d, r13d                                                     ; +0x11c, 0x18004eefc\njle     short loc_18004EF30                                            ; +0x11f, 0x18004eeff\nmov     rbx, rdi                                                       ; +0x121, 0x18004ef01\nlea     r14, [r15+114h]                                                ; +0x124, 0x18004ef04\nnop     dword ptr [rax+rax+00h]                                        ; +0x12b, 0x18004ef0b\nmov     edx, 8                                                         ; +0x130, 0x18004ef10\nmov     rcx, r12                                                       ; +0x135, 0x18004ef15\ncall    sub_180048210                                                  ; +0x138, 0x18004ef18\ntest    eax, eax                                                       ; +0x13d, 0x18004ef1d\njs      short loc_18004EF99                                            ; +0x13f, 0x18004ef1f\nmov     [r14], eax                                                     ; +0x141, 0x18004ef21\ninc     rbx                                                            ; +0x144, 0x18004ef24\nadd     r14, 4                                                         ; +0x147, 0x18004ef27\ncmp     rbx, rbp                                                       ; +0x14b, 0x18004ef2b\njl      short loc_18004EF10                                            ; +0x14e, 0x18004ef2e\nmov     r10, [rsp+58h+arg_8]                                           ; +0x150, 0x18004ef30\nmovsxd  r9, dword ptr [r15+10h]                                        ; +0x155, 0x18004ef35\nmov     r8d, [r10+18h]                                                 ; +0x159, 0x18004ef39\ncmp     r9d, r8d                                                       ; +0x15d, 0x18004ef3d\njge     short loc_18004EF99                                            ; +0x160, 0x18004ef40\ntest    r13d, r13d                                                     ; +0x162, 0x18004ef42\njle     short loc_18004EF72                                            ; +0x165, 0x18004ef45\nlea     rdx, [r15+114h]                                                ; +0x167, 0x18004ef47\nxchg    ax, ax                                                         ; +0x16e, 0x18004ef4e\nmovsxd  rax, dword ptr [rdx]                                           ; +0x170, 0x18004ef50\ncmp     eax, r8d                                                       ; +0x173, 0x18004ef53\njge     short loc_18004EF99                                            ; +0x176, 0x18004ef56\nmov     rcx, [r10+rax*8+0B20h]                                         ; +0x178, 0x18004ef58\ncmp     dword ptr [rcx+10h], 0                                         ; +0x180, 0x18004ef60\njz      short loc_18004EF99                                            ; +0x184, 0x18004ef64\ninc     rdi                                                            ; +0x186, 0x18004ef66\nadd     rdx, 4                                                         ; +0x189, 0x18004ef69\ncmp     rdi, rbp                                                       ; +0x18d, 0x18004ef6d\njl      short loc_18004EF50                                            ; +0x190, 0x18004ef70\nmov     rcx, [r10+r9*8+0B20h]                                          ; +0x192, 0x18004ef72\nmov     eax, [rcx]                                                     ; +0x19a, 0x18004ef7a\nmov     edx, [rcx+4]                                                   ; +0x19c, 0x18004ef7c\ntest    eax, eax                                                       ; +0x19f, 0x18004ef7f\njle     short loc_18004EF94                                            ; +0x1a1, 0x18004ef81\nmov     ecx, [r15+0Ch]                                                 ; +0x1a3, 0x18004ef83\nimul    esi, ecx                                                       ; +0x1a7, 0x18004ef87\ncmp     esi, edx                                                       ; +0x1aa, 0x18004ef8a\njg      short loc_18004EF99                                            ; +0x1ac, 0x18004ef8c\ndec     eax                                                            ; +0x1ae, 0x18004ef8e\ntest    eax, eax                                                       ; +0x1b0, 0x18004ef90\njg      short loc_18004EF87                                            ; +0x1b2, 0x18004ef92\nmov     rax, r15                                                       ; +0x1b4, 0x18004ef94\njmp     short loc_18004EFB8                                            ; +0x1b7, 0x18004ef97\nxor     edx, edx; Val                                                  ; +0x1b9, 0x18004ef99\nmov     r8d, 714h; Size                                                ; +0x1bb, 0x18004ef9b\nmov     rcx, r15; void *                                               ; +0x1c1, 0x18004efa1\ncall    memset                                                         ; +0x1c4, 0x18004efa4\nmov     rcx, [rsp+58h+arg_0]                                           ; +0x1c9, 0x18004efa9\nmov     rdx, r15                                                       ; +0x1ce, 0x18004efae\ncall    sub_180033C90                                                  ; +0x1d1, 0x18004efb1\nxor     eax, eax                                                       ; +0x1d6, 0x18004efb6\nmov     rbx, [rsp+58h+arg_10]                                          ; +0x1d8, 0x18004efb8\nadd     rsp, 20h                                                       ; +0x1dd, 0x18004efbd\npop     r15                                                            ; +0x1e1, 0x18004efc1\npop     r14                                                            ; +0x1e3, 0x18004efc3\npop     r13                                                            ; +0x1e5, 0x18004efc5\npop     r12                                                            ; +0x1e7, 0x18004efc7\npop     rdi                                                            ; +0x1e9, 0x18004efc9\npop     rsi                                                            ; +0x1ea, 0x18004efca\npop     rbp                                                            ; +0x1eb, 0x18004efcb\nretn                                                                   ; +0x1ec, 0x18004efcc", "xrefs": ["<???> @ 0x180166e48", "<???> @ 0x180166e88", "<???> @ 0x180166ec8", "<???> @ 0x1801f8844", "<???> @ 0x1801f8850"], "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"}