{"type": "func", "start": 6442539376, "end": 6442539705, "name": "sub_180015970", "pseudocode": "// \n// sub_180015970 from 0x180015970 to 0x180015ab9 (329 bytes)\n// \n// 3 xrefs:\n// > fmt::BasicWriter<char>::operator<< @ 0x18001825e\n// > DS_Dictionary::setIntegerForKey @ 0x18001f11a\n// > <???> @ 0x1801ae4dc\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_180015970(__int64 a1, int a2, __int64 a3)\n{\n  char v3; // r9\n  unsigned int v4; // eax\n  unsigned int v5; // ebx\n  unsigned int v6; // r10d\n  unsigned int v7; // edi\n  unsigned __int64 v8; // rdx\n  __int64 result; // rax\n  __int64 v10; // rsi\n  __int64 v11; // rbx\n  _BYTE *i; // r9\n  __int64 v13; // rcx\n  __int64 v14; // r8\n  __int64 v15; // rcx\n  char v16; // [rsp+48h] [rbp+10h] BYREF\n  __int16 v17; // [rsp+49h] [rbp+11h]\n  char v18; // [rsp+4Bh] [rbp+13h]\n\n  v3 = 0;\n  v17 = 0;\n  v18 = 0;\n  if ( a2 < 0 )\n    v3 = 45;\n  v16 = v3;\n  v4 = -a2;\n  v5 = 1;\n  if ( a2 >= 0 )\n    v4 = a2;\n  v6 = (unsigned int)a2 >> 31;\n  v7 = v4;\n  v8 = v4;\n  if ( v4 >= 0xAuLL )\n  {\n    while ( v8 >= 0x64 )\n    {\n      if ( v8 < 0x3E8 )\n      {\n        v5 += 2;\n        goto LABEL_14;\n      }\n      if ( v8 < 0x2710 )\n      {\n        v5 += 3;\n        goto LABEL_14;\n      }\n      v5 += 4;\n      v8 /= 0x2710u;\n      if ( v8 < 0xA )\n        goto LABEL_14;\n    }\n    ++v5;\n  }\nLABEL_14:\n  result = sub_180015CE0(a1, v5, a3, &v16, v6);\n  v10 = 1LL - v5;\n  v11 = v5 - 1;\n  for ( i = (_BYTE *)(result + v10); v7 >= 0x64; i[v13] = result )\n  {\n    v13 = (unsigned int)(v11 - 1);\n    v14 = 2 * (v7 % 0x64);\n    v7 /= 0x64u;\n    i[v11] = a00010203040506[(unsigned int)(v14 + 1)];\n    v11 = (unsigned int)(v11 - 2);\n    result = (unsigned __int8)a00010203040506[v14];\n  }\n  if ( v7 >= 0xA )\n  {\n    v15 = 2 * v7;\n    i[1] = a00010203040506[(unsigned int)(v15 + 1)];\n    result = (unsigned __int8)a00010203040506[v15];\n    *i = result;\n  }\n  else\n  {\n    *i = v7 + 48;\n  }\n  return result;\n}", "assembly": "; \n; sub_180015970 from 0x180015970 to 0x180015ab9 (329 bytes)\n; \n; 3 xrefs:\n; > fmt::BasicWriter<char>::operator<< @ 0x18001825e\n; > DS_Dictionary::setIntegerForKey @ 0x18001f11a\n; > <???> @ 0x1801ae4dc\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_0], rbx                                               ; +0x0, 0x180015970\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x180015975\npush    rdi                                                            ; +0xa, 0x18001597a\nsub     rsp, 30h                                                       ; +0xb, 0x18001597b\nxor     al, al                                                         ; +0xf, 0x18001597f\nmov     r10d, edx                                                      ; +0x11, 0x180015981\nxor     edx, edx                                                       ; +0x14, 0x180015984\nmovzx   r9d, al                                                        ; +0x16, 0x180015986\ntest    r10d, r10d                                                     ; +0x1a, 0x18001598a\nmov     [rsp+38h+arg_9], dx                                            ; +0x1d, 0x18001598d\nmov     eax, 2Dh ; '-'                                                 ; +0x22, 0x180015992\nmov     [rsp+38h+arg_B], dl                                            ; +0x27, 0x180015997\ncmovs   r9d, eax                                                       ; +0x2b, 0x18001599b\nmov     esi, 1                                                         ; +0x2f, 0x18001599f\nmov     eax, r10d                                                      ; +0x34, 0x1800159a4\nmov     [rsp+38h+arg_8], r9b                                           ; +0x37, 0x1800159a7\nneg     eax                                                            ; +0x3c, 0x1800159ac\nmov     ebx, esi                                                       ; +0x3e, 0x1800159ae\ntest    r10d, r10d                                                     ; +0x40, 0x1800159b0\ncmovns  eax, r10d                                                      ; +0x43, 0x1800159b3\nshr     r10d, 1Fh                                                      ; +0x47, 0x1800159b7\nmov     edi, eax                                                       ; +0x4b, 0x1800159bb\nmov     edx, eax                                                       ; +0x4d, 0x1800159bd\ncmp     rdi, 0Ah                                                       ; +0x4f, 0x1800159bf\njb      short loc_180015A09                                            ; +0x53, 0x1800159c3\nmov     r9, 346DC5D63886594Bh                                          ; +0x55, 0x1800159c5\nnop                                                                    ; +0x5f, 0x1800159cf\ncmp     rdx, 64h ; 'd'                                                 ; +0x60, 0x1800159d0\njb      short loc_180015A07                                            ; +0x64, 0x1800159d4\ncmp     rdx, 3E8h                                                      ; +0x66, 0x1800159d6\njb      short loc_180015A02                                            ; +0x6d, 0x1800159dd\ncmp     rdx, 2710h                                                     ; +0x6f, 0x1800159df\njb      short loc_1800159FD                                            ; +0x76, 0x1800159e6\nmov     rax, r9                                                        ; +0x78, 0x1800159e8\nadd     ebx, 4                                                         ; +0x7b, 0x1800159eb\nmul     rdx                                                            ; +0x7e, 0x1800159ee\nshr     rdx, 0Bh                                                       ; +0x81, 0x1800159f1\ncmp     rdx, 0Ah                                                       ; +0x85, 0x1800159f5\njnb     short loc_1800159D0                                            ; +0x89, 0x1800159f9\njmp     short loc_180015A09                                            ; +0x8b, 0x1800159fb\nadd     ebx, 3                                                         ; +0x8d, 0x1800159fd\njmp     short loc_180015A09                                            ; +0x90, 0x180015a00\nadd     ebx, 2                                                         ; +0x92, 0x180015a02\njmp     short loc_180015A09                                            ; +0x95, 0x180015a05\ninc     ebx                                                            ; +0x97, 0x180015a07\nlea     r9, [rsp+38h+arg_8]                                            ; +0x99, 0x180015a09\nmov     [rsp+38h+var_18], r10d                                         ; +0x9e, 0x180015a0e\nmov     edx, ebx                                                       ; +0xa3, 0x180015a13\ncall    sub_180015CE0                                                  ; +0xa5, 0x180015a15\nmov     ecx, ebx                                                       ; +0xaa, 0x180015a1a\nlea     r10, a00010203040506; \"000102030405060708091011121314151617181\"... ; +0xac, 0x180015a1c\nsub     rsi, rcx                                                       ; +0xb3, 0x180015a23\ndec     ebx                                                            ; +0xb6, 0x180015a26\nlea     r9, [rax+rsi]                                                  ; +0xb8, 0x180015a28\ncmp     edi, 64h ; 'd'                                                 ; +0xbc, 0x180015a2c\njb      short loc_180015A76                                            ; +0xbf, 0x180015a2f\nnop     dword ptr [rax+00h]                                            ; +0xc1, 0x180015a31\nnop     word ptr [rax+rax+00000000h]                                   ; +0xc5, 0x180015a35\nmov     eax, 51EB851Fh                                                 ; +0xd0, 0x180015a40\nlea     ecx, [rbx-1]                                                   ; +0xd5, 0x180015a45\nmul     edi                                                            ; +0xd8, 0x180015a48\nshr     edx, 5                                                         ; +0xda, 0x180015a4a\nimul    eax, edx, 64h ; 'd'                                            ; +0xdd, 0x180015a4d\nsub     edi, eax                                                       ; +0xe0, 0x180015a50\nlea     r8d, [rdi+rdi]                                                 ; +0xe2, 0x180015a52\nmov     edi, edx                                                       ; +0xe6, 0x180015a56\nlea     eax, [r8+1]                                                    ; +0xe8, 0x180015a58\nmovzx   eax, byte ptr [rax+r10]                                        ; +0xec, 0x180015a5c\nmov     [rbx+r9], al                                                   ; +0xf1, 0x180015a61\nlea     ebx, [rbx-2]                                                   ; +0xf5, 0x180015a65\nmovzx   eax, byte ptr [r8+r10]                                         ; +0xf8, 0x180015a68\nmov     [rcx+r9], al                                                   ; +0xfd, 0x180015a6d\ncmp     edx, 64h ; 'd'                                                 ; +0x101, 0x180015a71\njnb     short loc_180015A40                                            ; +0x104, 0x180015a74\ncmp     edi, 0Ah                                                       ; +0x106, 0x180015a76\njnb     short loc_180015A92                                            ; +0x109, 0x180015a79\nadd     dil, 30h ; '0'                                                 ; +0x10b, 0x180015a7b\nmov     [r9], dil                                                      ; +0x10f, 0x180015a7f\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x112, 0x180015a82\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x117, 0x180015a87\nadd     rsp, 30h                                                       ; +0x11c, 0x180015a8c\npop     rdi                                                            ; +0x120, 0x180015a90\nretn                                                                   ; +0x121, 0x180015a91\nlea     ecx, [rdi+rdi]                                                 ; +0x122, 0x180015a92\nlea     eax, [rcx+1]                                                   ; +0x125, 0x180015a95\nmovzx   eax, byte ptr [rax+r10]                                        ; +0x128, 0x180015a98\nmov     [r9+1], al                                                     ; +0x12d, 0x180015a9d\nmovzx   eax, byte ptr [rcx+r10]                                        ; +0x131, 0x180015aa1\nmov     [r9], al                                                       ; +0x136, 0x180015aa6\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x139, 0x180015aa9\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x13e, 0x180015aae\nadd     rsp, 30h                                                       ; +0x143, 0x180015ab3\npop     rdi                                                            ; +0x147, 0x180015ab7\nretn                                                                   ; +0x148, 0x180015ab8", "xrefs": ["fmt::BasicWriter<char>::operator<< @ 0x18001825e", "DS_Dictionary::setIntegerForKey @ 0x18001f11a", "<???> @ 0x1801ae4dc"], "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"}