; assembly | /* r2dec pseudo code output */ | /* bdldfp_decimal.t/assume @ 0x47ef00 */ | #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) */ 0x0047ef00 push rbx | 0x0047ef01 cmp edx, 1 | | if (edx == 1) { 0x0047ef04 jne 0x47ef1b | 0x0047ef06 mov eax, ecx | eax = ecx; 0x0047ef08 and eax, 0x18 | eax &= 0x18; 0x0047ef0b mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x0047ef12 cmp eax, 0x18 | | if (eax == 0x18) { 0x0047ef15 je 0x47f130 | goto label_0; | } | } 0x0047ef1b mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x0047ef22 test cl, 8 | | if ((cl & 8) != 0) { 0x0047ef25 je 0x47efda | 0x0047ef2b test byte [rdi + 0x78], 8 | | if ((*((rdi + 0x78)) & 8) == 0) { 0x0047ef2f je 0x47efda | goto label_1; | } 0x0047ef35 cmp edx, 2 | | if (edx != 2) { 0x0047ef38 je 0x47ef51 | 0x0047ef3a cmp edx, 1 | | if (edx == 1) { 0x0047ef3d jne 0x47ef76 | 0x0047ef3f lea r10, [rsi*4] | r10 = rsi*4; 0x0047ef47 add r10, qword [rdi + 0x18] | r10 += *((rdi + 0x18)); 0x0047ef4b mov r9, qword [rdi + 0x10] | r9 = *((rdi + 0x10)); 0x0047ef4f jmp 0x47ef7e | | } else { 0x0047ef51 mov rax, qword [rdi + 0x30] | rax = *((rdi + 0x30)); 0x0047ef55 sub rax, qword [rdi + 0x28] | rax -= *((rdi + 0x28)); 0x0047ef59 mov r9, qword [rdi + 0x10] | r9 = *((rdi + 0x10)); 0x0047ef5d sar rax, 2 | rax >>= 2; 0x0047ef61 mov r8, qword [rdi + 0x70] | r8 = *((rdi + 0x70)); 0x0047ef65 cmp r8, rax | | if (r8 >= rax) { 0x0047ef68 cmovge rax, r8 | rax = r8; | } 0x0047ef6c lea rax, [r9 + rax*4] | rax = r9 + rax*4; 0x0047ef70 lea r10, [rax + rsi*4] | r10 = rax + rsi*4; 0x0047ef74 jmp 0x47ef7e | | } else { 0x0047ef76 mov r9, qword [rdi + 0x10] | r9 = *((rdi + 0x10)); 0x0047ef7a lea r10, [r9 + rsi*4] | r10 = r9 + rsi*4; | } | } 0x0047ef7e mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x0047ef85 cmp r10, r9 | | if (r10 < r9) { 0x0047ef88 jb 0x47f130 | goto label_0; | } 0x0047ef8e mov rbx, qword [rdi + 0x30] | rbx = *((rdi + 0x30)); 0x0047ef92 mov r11, qword [rdi + 0x70] | r11 = *((rdi + 0x70)); 0x0047ef96 sub rbx, qword [rdi + 0x28] | rbx -= *((rdi + 0x28)); 0x0047ef9a sar rbx, 2 | rbx >>= 2; 0x0047ef9e cmp r11, rbx | | if (r11 >= rbx) { 0x0047efa1 cmovge rbx, r11 | rbx = r11; | } 0x0047efa5 lea rax, [r9 + rbx*4] | rax = r9 + rbx*4; 0x0047efa9 cmp r10, rax | | if (r10 > rax) { 0x0047efac ja 0x47f130 | goto label_0; | } 0x0047efb2 lea r8, [rdi + 0x40] | r8 = rdi + 0x40; 0x0047efb6 cmp qword [rdi + 0x60], 5 | | if (*((rdi + 0x60)) != 5) { 0x0047efbb je 0x47efc0 | 0x0047efbd mov r8, qword [r8] | r8 = *(r8); | } 0x0047efc0 lea rax, [r8 + rbx*4] | rax = r8 + rbx*4; 0x0047efc4 mov qword [rdi + 0x10], r8 | *((rdi + 0x10)) = r8; 0x0047efc8 mov qword [rdi + 0x18], r10 | *((rdi + 0x18)) = r10; 0x0047efcc mov qword [rdi + 0x20], rax | *((rdi + 0x20)) = rax; 0x0047efd0 sub r10, r8 | r10 -= r8; 0x0047efd3 sar r10, 2 | r10 >>= 2; 0x0047efd7 mov r8, r10 | r8 = r10; | } | label_1: 0x0047efda test cl, 0x10 | | if ((cl & 0x10) != 0) { 0x0047efdd je 0x47f130 | 0x0047efe3 test byte [rdi + 0x78], 0x10 | | if ((*((rdi + 0x78)) & 0x10) == 0) { 0x0047efe7 je 0x47f130 | goto label_0; | } 0x0047efed cmp edx, 2 | | if (edx != 2) { 0x0047eff0 je 0x47f005 | 0x0047eff2 cmp edx, 1 | | if (edx == 1) { 0x0047eff5 jne 0x47f029 | 0x0047eff7 shl rsi, 2 | rsi <<= 2; 0x0047effb add rsi, qword [rdi + 0x30] | rsi += *((rdi + 0x30)); 0x0047efff mov rax, qword [rdi + 0x28] | rax = *((rdi + 0x28)); 0x0047f003 jmp 0x47f031 | | } else { 0x0047f005 mov rax, qword [rdi + 0x28] | rax = *((rdi + 0x28)); 0x0047f009 mov rcx, qword [rdi + 0x30] | rcx = *((rdi + 0x30)); 0x0047f00d sub rcx, rax | rcx -= rax; 0x0047f010 sar rcx, 2 | rcx >>= 2; 0x0047f014 mov rdx, qword [rdi + 0x70] | rdx = *((rdi + 0x70)); 0x0047f018 cmp rdx, rcx | | if (rdx >= rcx) { 0x0047f01b cmovge rcx, rdx | rcx = rdx; | } 0x0047f01f lea rcx, [rax + rcx*4] | rcx = rax + rcx*4; 0x0047f023 lea rsi, [rcx + rsi*4] | rsi = rcx + rsi*4; 0x0047f027 jmp 0x47f031 | | } else { 0x0047f029 mov rax, qword [rdi + 0x28] | rax = *((rdi + 0x28)); 0x0047f02d lea rsi, [rax + rsi*4] | rsi = rax + rsi*4; | } | } 0x0047f031 mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x0047f038 cmp rsi, rax | | if (rsi < rax) { 0x0047f03b jb 0x47f130 | goto label_0; | } 0x0047f041 mov rcx, qword [rdi + 0x30] | rcx = *((rdi + 0x30)); 0x0047f045 mov rdx, qword [rdi + 0x70] | rdx = *((rdi + 0x70)); 0x0047f049 sub rcx, rax | rcx -= rax; 0x0047f04c sar rcx, 2 | rcx >>= 2; 0x0047f050 cmp rdx, rcx | | if (rdx >= rcx) { 0x0047f053 cmovge rcx, rdx | rcx = rdx; | } 0x0047f057 lea rax, [rax + rcx*4] | rax = rax + rcx*4; 0x0047f05b cmp rsi, rax | | if (rsi > rax) { 0x0047f05e ja 0x47f130 | goto label_0; | } 0x0047f064 lea r9, [rdi + 0x40] | r9 = rdi + 0x40; 0x0047f068 cmp qword [rdi + 0x60], 5 | | if (*((rdi + 0x60)) != 5) { 0x0047f06d je 0x47f072 | 0x0047f06f mov r9, qword [r9] | r9 = *(r9); | } 0x0047f072 mov rcx, qword [rdi + 0x58] | rcx = *((rdi + 0x58)); 0x0047f076 mov rax, rsi | rax = rsi; 0x0047f079 sub rax, r9 | rax -= r9; 0x0047f07c mov r8, rax | r8 = rax; 0x0047f07f sar r8, 2 | r8 >>= 2; 0x0047f083 lea rcx, [r9 + rcx*4] | rcx = r9 + rcx*4; 0x0047f087 mov qword [rdi + 0x30], r9 | *((rdi + 0x30)) = r9; 0x0047f08b mov qword [rdi + 0x28], r9 | *((rdi + 0x28)) = r9; 0x0047f08f mov qword [rdi + 0x38], rcx | *((rdi + 0x38)) = rcx; 0x0047f093 movabs rcx, 0x1fffffffd | rcx = 0x1fffffffd; 0x0047f09d cmp rax, rcx | | if (rax >= rcx) { 0x0047f0a0 jl 0x47f11d | 0x0047f0a2 mov rcx, r9 | rcx = r9; 0x0047f0a5 sub rcx, rsi | rcx -= rsi; 0x0047f0a8 cmp rcx, rax | | if (rcx <= rax) { 0x0047f0ab cmovle rcx, rax | rcx = rax; | } 0x0047f0af mov rsi, rcx | rsi = rcx; 0x0047f0b2 shr rsi, 2 | rsi >>= 2; 0x0047f0b6 shr rcx, 3 | rcx >>= 3; 0x0047f0ba cmp rcx, 0x7fffffff | 0x0047f0c1 mov eax, 0xfffffffe | eax = 0xfffffffe; | if (rcx < 0x7fffffff) { 0x0047f0c6 cmovb rax, rsi | rax = rsi; | } 0x0047f0ca neg rax | rax = -rax; 0x0047f0cd lea rcx, [rsi + rax + 0x7ffffffe] | rcx = rsi + rax + 0x7ffffffe; 0x0047f0d5 movabs rdx, 0x200000005 | rdx = 0x200000005; 0x0047f0df mov rax, rcx | rax = rcx; 0x0047f0e2 mul rdx | rdx:rax = rax * rdx; 0x0047f0e5 sub rcx, rdx | rcx -= rdx; 0x0047f0e8 shr rcx, 1 | rcx >>= 1; 0x0047f0eb add rcx, rdx | rcx += rdx; 0x0047f0ee shr rcx, 0x1e | rcx >>= 0x1e; 0x0047f0f2 mov rax, rcx | rax = rcx; 0x0047f0f5 shl rax, 0x1f | rax <<= 0x1f; 0x0047f0f9 sub rax, rcx | rax -= rcx; 0x0047f0fc lea rcx, [r9 + rax*4] | rcx = r9 + rax*4; 0x0047f100 movabs r9, 0x1fffffffc | r9 = 0x1fffffffc; 0x0047f10a add r9, rcx | r9 += rcx; 0x0047f10d sub rsi, rax | rsi -= rax; 0x0047f110 add rsi, 0xffffffff80000001 | rsi += 0xffffffff80000001; 0x0047f117 mov qword [rdi + 0x30], r9 | *((rdi + 0x30)) = r9; 0x0047f11b jmp 0x47f120 | | } else { 0x0047f11d mov rsi, r8 | rsi = r8; | } 0x0047f120 test rsi, rsi | | if (rsi == 0) { 0x0047f123 je 0x47f130 | goto label_0; | } 0x0047f125 movsxd rax, esi | rax = (int64_t) esi; 0x0047f128 lea rax, [r9 + rax*4] | rax = r9 + rax*4; 0x0047f12c mov qword [rdi + 0x30], rax | *((rdi + 0x30)) = rax; | } | label_0: 0x0047f130 xor eax, eax | eax = 0; 0x0047f132 mov rdx, r8 | rdx = r8; 0x0047f135 pop rbx | 0x0047f136 ret | return rax; | }