{"type": "func", "start": 6442550080, "end": 6442550172, "name": "sub_180018340", "pseudocode": "// \n// sub_180018340 from 0x180018340 to 0x18001839c (92 bytes)\n// \n// 6 xrefs:\n// > sub_180001E90 @ 0x18000206c\n// > sub_180001E90 @ 0x1800020e4\n// > sub_180001E90 @ 0x180002180\n// > sub_180001E90 @ 0x1800021c1\n// > sub_180001E90 @ 0x18000224a\n// > sub_180007790 @ 0x1800077df\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_180018340(int a1, int a2)\n{\n  __int64 v2; // r9\n  __int64 v3; // rdx\n  __int64 result; // rax\n  int v5; // r11d\n\n  if ( !qword_1801B2810 || dword_1801B2818 <= 0 )\n    return 0;\n  v2 = ~(a1 - 1);\n  v3 = v2 & (a2 - 1 + a1);\n  result = v2 & (qword_1801B2810 + a1 - 1LL);\n  v5 = dword_1801B2818 - ((v2 & (qword_1801B2810 + a1 - 1)) - qword_1801B2810 + v3);\n  qword_1801B2810 = v3 + result;\n  dword_1801B2818 = v5;\n  return result;\n}", "assembly": "; \n; sub_180018340 from 0x180018340 to 0x18001839c (92 bytes)\n; \n; 6 xrefs:\n; > sub_180001E90 @ 0x18000206c\n; > sub_180001E90 @ 0x1800020e4\n; > sub_180001E90 @ 0x180002180\n; > sub_180001E90 @ 0x1800021c1\n; > sub_180001E90 @ 0x18000224a\n; > sub_180007790 @ 0x1800077df\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     r10, cs:qword_1801B2810                                        ; +0x0, 0x180018340\ntest    r10, r10                                                       ; +0x7, 0x180018347\njz      short loc_180018399                                            ; +0xa, 0x18001834a\nmov     r11d, cs:dword_1801B2818                                       ; +0xc, 0x18001834c\ntest    r11d, r11d                                                     ; +0x13, 0x180018353\njle     short loc_180018399                                            ; +0x16, 0x180018356\nlea     eax, [rcx-1]                                                   ; +0x18, 0x180018358\ndec     edx                                                            ; +0x1b, 0x18001835b\nnot     eax                                                            ; +0x1d, 0x18001835d\nmovsxd  r9, eax                                                        ; +0x1f, 0x18001835f\nmovsxd  rax, ecx                                                       ; +0x22, 0x180018362\nadd     ecx, edx                                                       ; +0x25, 0x180018365\ndec     rax                                                            ; +0x27, 0x180018367\nmovsxd  rdx, ecx                                                       ; +0x2a, 0x18001836a\nadd     rax, r10                                                       ; +0x2d, 0x18001836d\nand     rdx, r9                                                        ; +0x30, 0x180018370\nand     rax, r9                                                        ; +0x33, 0x180018373\nmov     r8, rax                                                        ; +0x36, 0x180018376\nsub     r8, r10                                                        ; +0x39, 0x180018379\nlea     rcx, [rdx+r8]                                                  ; +0x3c, 0x18001837c\nadd     r10, rcx                                                       ; +0x40, 0x180018380\nlea     ecx, [r8+rdx]                                                  ; +0x43, 0x180018383\nsub     r11d, ecx                                                      ; +0x47, 0x180018387\nmov     cs:qword_1801B2810, r10                                        ; +0x4a, 0x18001838a\nmov     cs:dword_1801B2818, r11d                                       ; +0x51, 0x180018391\nretn                                                                   ; +0x58, 0x180018398\nxor     eax, eax                                                       ; +0x59, 0x180018399\nretn                                                                   ; +0x5b, 0x18001839b", "xrefs": ["sub_180001E90 @ 0x18000206c", "sub_180001E90 @ 0x1800020e4", "sub_180001E90 @ 0x180002180", "sub_180001E90 @ 0x1800021c1", "sub_180001E90 @ 0x18000224a", "sub_180007790 @ 0x1800077df"], "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"}