; assembly | /* r2dec pseudo code output */ | /* bdldfp_decimal.t/none @ 0x47ef10 */ | #include | ; (fcn) method.bsl::basic_stringbuf_wchar_t__std::__1::char_traits_wchar_t___bsl::allocator_wchar_t___.seekoff_long_long__std::__1::ios_base::seekdir__unsigned_int_ () | int64_t method_bsl::basic_stringbuf_wchar_t_std::_1::char_traits_wchar_t_bsl::allocator_wchar_t_seekoff_long_long_std::_1::ios_base::seekdir_unsigned_int_ (int64_t arg4, uint32_t arg3, int64_t arg2, uint32_t arg1) { | rcx = arg4; | rdx = arg3; | rsi = arg2; | rdi = arg1; | /* bsl::basic_stringbuf, bsl::allocator >::seekoff(long long, std::__1::ios_base::seekdir, unsigned int) */ 0x0047ef10 push rbx | 0x0047ef11 cmp edx, 1 | | if (edx == 1) { 0x0047ef14 jne 0x47ef2b | 0x0047ef16 mov eax, ecx | eax = ecx; 0x0047ef18 and eax, 0x18 | eax &= 0x18; 0x0047ef1b mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x0047ef22 cmp eax, 0x18 | | if (eax == 0x18) { 0x0047ef25 je 0x47f155 | goto label_0; | } | } 0x0047ef2b mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x0047ef32 test cl, 8 | | if ((cl & 8) != 0) { 0x0047ef35 je 0x47eff7 | 0x0047ef3b test byte [rdi + 0x78], 8 | | if ((*((rdi + 0x78)) & 8) == 0) { 0x0047ef3f je 0x47eff7 | goto label_1; | } 0x0047ef45 cmp edx, 2 | | if (edx != 2) { 0x0047ef48 je 0x47ef61 | 0x0047ef4a cmp edx, 1 | | if (edx != 1) { 0x0047ef4d je 0x47ef86 | 0x0047ef4f test edx, edx | | if (edx == 0) { 0x0047ef51 jne 0x47ef94 | 0x0047ef53 lea r9, [rsi*4] | r9 = rsi*4; 0x0047ef5b add r9, qword [rdi + 0x10] | r9 += *((rdi + 0x10)); 0x0047ef5f jmp 0x47ef97 | | } else { 0x0047ef61 mov rax, qword [rdi + 0x30] | rax = *((rdi + 0x30)); 0x0047ef65 mov r8, qword [rdi + 0x70] | r8 = *((rdi + 0x70)); 0x0047ef69 sub rax, qword [rdi + 0x28] | rax -= *((rdi + 0x28)); 0x0047ef6d sar rax, 2 | rax >>= 2; 0x0047ef71 cmp r8, rax | | if (r8 >= rax) { 0x0047ef74 cmovge rax, r8 | rax = r8; | } 0x0047ef78 shl rax, 2 | rax <<= 2; 0x0047ef7c add rax, qword [rdi + 0x10] | rax += *((rdi + 0x10)); 0x0047ef80 lea r9, [rax + rsi*4] | r9 = rax + rsi*4; 0x0047ef84 jmp 0x47ef97 | 0x0047ef86 lea r9, [rsi*4] | r9 = rsi*4; 0x0047ef8e add r9, qword [rdi + 0x18] | r9 += *((rdi + 0x18)); 0x0047ef92 jmp 0x47ef97 | | } else { | } else { 0x0047ef94 xor r9d, r9d | r9d = 0; | } | } | } 0x0047ef97 mov r10, qword [rdi + 0x10] | r10 = *((rdi + 0x10)); 0x0047ef9b mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x0047efa2 cmp r9, r10 | | if (r9 < r10) { 0x0047efa5 jb 0x47f155 | goto label_0; | } 0x0047efab mov rbx, qword [rdi + 0x30] | rbx = *((rdi + 0x30)); 0x0047efaf mov r11, qword [rdi + 0x70] | r11 = *((rdi + 0x70)); 0x0047efb3 sub rbx, qword [rdi + 0x28] | rbx -= *((rdi + 0x28)); 0x0047efb7 sar rbx, 2 | rbx >>= 2; 0x0047efbb cmp r11, rbx | | if (r11 >= rbx) { 0x0047efbe cmovge rbx, r11 | rbx = r11; | } 0x0047efc2 lea rax, [r10 + rbx*4] | rax = r10 + rbx*4; 0x0047efc6 cmp r9, rax | | if (r9 > rax) { 0x0047efc9 ja 0x47f155 | goto label_0; | } 0x0047efcf lea r8, [rdi + 0x40] | r8 = rdi + 0x40; 0x0047efd3 cmp qword [rdi + 0x60], 5 | | if (*((rdi + 0x60)) != 5) { 0x0047efd8 je 0x47efdd | 0x0047efda mov r8, qword [r8] | r8 = *(r8); | } 0x0047efdd lea rax, [r8 + rbx*4] | rax = r8 + rbx*4; 0x0047efe1 mov qword [rdi + 0x10], r8 | *((rdi + 0x10)) = r8; 0x0047efe5 mov qword [rdi + 0x18], r9 | *((rdi + 0x18)) = r9; 0x0047efe9 mov qword [rdi + 0x20], rax | *((rdi + 0x20)) = rax; 0x0047efed sub r9, r8 | r9 -= r8; 0x0047eff0 sar r9, 2 | r9 >>= 2; 0x0047eff4 mov r8, r9 | r8 = r9; | } | label_1: 0x0047eff7 test cl, 0x10 | | if ((cl & 0x10) != 0) { 0x0047effa je 0x47f155 | 0x0047f000 test byte [rdi + 0x78], 0x10 | | if ((*((rdi + 0x78)) & 0x10) == 0) { 0x0047f004 je 0x47f155 | goto label_0; | } 0x0047f00a cmp edx, 2 | | if (edx != 2) { 0x0047f00d je 0x47f022 | 0x0047f00f cmp edx, 1 | | if (edx != 1) { 0x0047f012 je 0x47f046 | 0x0047f014 test edx, edx | | if (edx == 0) { 0x0047f016 jne 0x47f050 | 0x0047f018 shl rsi, 2 | rsi <<= 2; 0x0047f01c add rsi, qword [rdi + 0x28] | rsi += *((rdi + 0x28)); 0x0047f020 jmp 0x47f052 | | } else { 0x0047f022 mov rax, qword [rdi + 0x28] | rax = *((rdi + 0x28)); 0x0047f026 mov rcx, qword [rdi + 0x30] | rcx = *((rdi + 0x30)); 0x0047f02a sub rcx, rax | rcx -= rax; 0x0047f02d sar rcx, 2 | rcx >>= 2; 0x0047f031 mov rdx, qword [rdi + 0x70] | rdx = *((rdi + 0x70)); 0x0047f035 cmp rdx, rcx | | if (rdx >= rcx) { 0x0047f038 cmovge rcx, rdx | rcx = rdx; | } 0x0047f03c lea rax, [rax + rcx*4] | rax = rax + rcx*4; 0x0047f040 lea rsi, [rax + rsi*4] | rsi = rax + rsi*4; 0x0047f044 jmp 0x47f052 | 0x0047f046 shl rsi, 2 | rsi <<= 2; 0x0047f04a add rsi, qword [rdi + 0x30] | rsi += *((rdi + 0x30)); 0x0047f04e jmp 0x47f052 | | } else { | } else { 0x0047f050 xor esi, esi | esi = 0; | } | } | } 0x0047f052 mov rax, qword [rdi + 0x28] | rax = *((rdi + 0x28)); 0x0047f056 mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x0047f05d cmp rsi, rax | | if (rsi < rax) { 0x0047f060 jb 0x47f155 | goto label_0; | } 0x0047f066 mov rcx, qword [rdi + 0x30] | rcx = *((rdi + 0x30)); 0x0047f06a mov rdx, qword [rdi + 0x70] | rdx = *((rdi + 0x70)); 0x0047f06e sub rcx, rax | rcx -= rax; 0x0047f071 sar rcx, 2 | rcx >>= 2; 0x0047f075 cmp rdx, rcx | | if (rdx >= rcx) { 0x0047f078 cmovge rcx, rdx | rcx = rdx; | } 0x0047f07c lea rax, [rax + rcx*4] | rax = rax + rcx*4; 0x0047f080 cmp rsi, rax | | if (rsi > rax) { 0x0047f083 ja 0x47f155 | goto label_0; | } 0x0047f089 lea r9, [rdi + 0x40] | r9 = rdi + 0x40; 0x0047f08d cmp qword [rdi + 0x60], 5 | | if (*((rdi + 0x60)) != 5) { 0x0047f092 je 0x47f097 | 0x0047f094 mov r9, qword [r9] | r9 = *(r9); | } 0x0047f097 mov rcx, qword [rdi + 0x58] | rcx = *((rdi + 0x58)); 0x0047f09b mov rax, rsi | rax = rsi; 0x0047f09e sub rax, r9 | rax -= r9; 0x0047f0a1 mov r8, rax | r8 = rax; 0x0047f0a4 sar r8, 2 | r8 >>= 2; 0x0047f0a8 lea rcx, [r9 + rcx*4] | rcx = r9 + rcx*4; 0x0047f0ac mov qword [rdi + 0x30], r9 | *((rdi + 0x30)) = r9; 0x0047f0b0 mov qword [rdi + 0x28], r9 | *((rdi + 0x28)) = r9; 0x0047f0b4 mov qword [rdi + 0x38], rcx | *((rdi + 0x38)) = rcx; 0x0047f0b8 movabs rcx, 0x1fffffffd | rcx = 0x1fffffffd; 0x0047f0c2 cmp rax, rcx | | if (rax >= rcx) { 0x0047f0c5 jl 0x47f142 | 0x0047f0c7 mov rcx, r9 | rcx = r9; 0x0047f0ca sub rcx, rsi | rcx -= rsi; 0x0047f0cd cmp rcx, rax | | if (rcx <= rax) { 0x0047f0d0 cmovle rcx, rax | rcx = rax; | } 0x0047f0d4 mov rsi, rcx | rsi = rcx; 0x0047f0d7 shr rsi, 2 | rsi >>= 2; 0x0047f0db shr rcx, 3 | rcx >>= 3; 0x0047f0df cmp rcx, 0x7fffffff | 0x0047f0e6 mov eax, 0xfffffffe | eax = 0xfffffffe; | if (rcx < 0x7fffffff) { 0x0047f0eb cmovb rax, rsi | rax = rsi; | } 0x0047f0ef neg rax | rax = -rax; 0x0047f0f2 lea rcx, [rsi + rax + 0x7ffffffe] | rcx = rsi + rax + 0x7ffffffe; 0x0047f0fa movabs rdx, 0x200000005 | rdx = 0x200000005; 0x0047f104 mov rax, rcx | rax = rcx; 0x0047f107 mul rdx | rdx:rax = rax * rdx; 0x0047f10a sub rcx, rdx | rcx -= rdx; 0x0047f10d shr rcx, 1 | rcx >>= 1; 0x0047f110 add rcx, rdx | rcx += rdx; 0x0047f113 shr rcx, 0x1e | rcx >>= 0x1e; 0x0047f117 mov rax, rcx | rax = rcx; 0x0047f11a shl rax, 0x1f | rax <<= 0x1f; 0x0047f11e sub rax, rcx | rax -= rcx; 0x0047f121 lea rcx, [r9 + rax*4] | rcx = r9 + rax*4; 0x0047f125 movabs r9, 0x1fffffffc | r9 = 0x1fffffffc; 0x0047f12f add r9, rcx | r9 += rcx; 0x0047f132 sub rsi, rax | rsi -= rax; 0x0047f135 add rsi, 0xffffffff80000001 | rsi += 0xffffffff80000001; 0x0047f13c mov qword [rdi + 0x30], r9 | *((rdi + 0x30)) = r9; 0x0047f140 jmp 0x47f145 | | } else { 0x0047f142 mov rsi, r8 | rsi = r8; | } 0x0047f145 test rsi, rsi | | if (rsi == 0) { 0x0047f148 je 0x47f155 | goto label_0; | } 0x0047f14a movsxd rax, esi | rax = (int64_t) esi; 0x0047f14d lea rax, [r9 + rax*4] | rax = r9 + rax*4; 0x0047f151 mov qword [rdi + 0x30], rax | *((rdi + 0x30)) = rax; | } | label_0: 0x0047f155 xor eax, eax | eax = 0; 0x0047f157 mov rdx, r8 | rdx = r8; 0x0047f15a pop rbx | 0x0047f15b ret | return rax; | }