; assembly | /* r2dec pseudo code output */ | /* bslstl_ostringstream.t/assume @ 0x4212d0 */ | #include | ; (fcn) method.bsl::basic_stringbuf_wchar_t__std::__1::char_traits_wchar_t___BloombergLP::bsltf::StdStatefulAllocator_wchar_t__true__true__true__true___.seekoff_long_long__std::__1::ios_base::seekdir__unsigned_int_ () | int64_t method_bsl::basic_stringbuf_wchar_t_std::_1::char_traits_wchar_t_BloombergLP::bsltf::StdStatefulAllocator_wchar_t_true_true_true_true_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, BloombergLP::bsltf::StdStatefulAllocator >::seekoff(long long, std::__1::ios_base::seekdir, unsigned int) */ 0x004212d0 push rbx | 0x004212d1 cmp edx, 1 | | if (edx == 1) { 0x004212d4 jne 0x4212eb | 0x004212d6 mov eax, ecx | eax = ecx; 0x004212d8 and eax, 0x18 | eax &= 0x18; 0x004212db mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x004212e2 cmp eax, 0x18 | | if (eax == 0x18) { 0x004212e5 je 0x421500 | goto label_0; | } | } 0x004212eb mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x004212f2 test cl, 8 | | if ((cl & 8) != 0) { 0x004212f5 je 0x4213aa | 0x004212fb test byte [rdi + 0x78], 8 | | if ((*((rdi + 0x78)) & 8) == 0) { 0x004212ff je 0x4213aa | goto label_1; | } 0x00421305 cmp edx, 2 | | if (edx != 2) { 0x00421308 je 0x421321 | 0x0042130a cmp edx, 1 | | if (edx == 1) { 0x0042130d jne 0x421346 | 0x0042130f lea r10, [rsi*4] | r10 = rsi*4; 0x00421317 add r10, qword [rdi + 0x18] | r10 += *((rdi + 0x18)); 0x0042131b mov r9, qword [rdi + 0x10] | r9 = *((rdi + 0x10)); 0x0042131f jmp 0x42134e | | } else { 0x00421321 mov rax, qword [rdi + 0x30] | rax = *((rdi + 0x30)); 0x00421325 sub rax, qword [rdi + 0x28] | rax -= *((rdi + 0x28)); 0x00421329 mov r9, qword [rdi + 0x10] | r9 = *((rdi + 0x10)); 0x0042132d sar rax, 2 | rax >>= 2; 0x00421331 mov r8, qword [rdi + 0x70] | r8 = *((rdi + 0x70)); 0x00421335 cmp r8, rax | | if (r8 >= rax) { 0x00421338 cmovge rax, r8 | rax = r8; | } 0x0042133c lea rax, [r9 + rax*4] | rax = r9 + rax*4; 0x00421340 lea r10, [rax + rsi*4] | r10 = rax + rsi*4; 0x00421344 jmp 0x42134e | | } else { 0x00421346 mov r9, qword [rdi + 0x10] | r9 = *((rdi + 0x10)); 0x0042134a lea r10, [r9 + rsi*4] | r10 = r9 + rsi*4; | } | } 0x0042134e mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x00421355 cmp r10, r9 | | if (r10 < r9) { 0x00421358 jb 0x421500 | goto label_0; | } 0x0042135e mov rbx, qword [rdi + 0x30] | rbx = *((rdi + 0x30)); 0x00421362 mov r11, qword [rdi + 0x70] | r11 = *((rdi + 0x70)); 0x00421366 sub rbx, qword [rdi + 0x28] | rbx -= *((rdi + 0x28)); 0x0042136a sar rbx, 2 | rbx >>= 2; 0x0042136e cmp r11, rbx | | if (r11 >= rbx) { 0x00421371 cmovge rbx, r11 | rbx = r11; | } 0x00421375 lea rax, [r9 + rbx*4] | rax = r9 + rbx*4; 0x00421379 cmp r10, rax | | if (r10 > rax) { 0x0042137c ja 0x421500 | goto label_0; | } 0x00421382 lea r8, [rdi + 0x40] | r8 = rdi + 0x40; 0x00421386 cmp qword [rdi + 0x60], 5 | | if (*((rdi + 0x60)) != 5) { 0x0042138b je 0x421390 | 0x0042138d mov r8, qword [r8] | r8 = *(r8); | } 0x00421390 lea rax, [r8 + rbx*4] | rax = r8 + rbx*4; 0x00421394 mov qword [rdi + 0x10], r8 | *((rdi + 0x10)) = r8; 0x00421398 mov qword [rdi + 0x18], r10 | *((rdi + 0x18)) = r10; 0x0042139c mov qword [rdi + 0x20], rax | *((rdi + 0x20)) = rax; 0x004213a0 sub r10, r8 | r10 -= r8; 0x004213a3 sar r10, 2 | r10 >>= 2; 0x004213a7 mov r8, r10 | r8 = r10; | } | label_1: 0x004213aa test cl, 0x10 | | if ((cl & 0x10) != 0) { 0x004213ad je 0x421500 | 0x004213b3 test byte [rdi + 0x78], 0x10 | | if ((*((rdi + 0x78)) & 0x10) == 0) { 0x004213b7 je 0x421500 | goto label_0; | } 0x004213bd cmp edx, 2 | | if (edx != 2) { 0x004213c0 je 0x4213d5 | 0x004213c2 cmp edx, 1 | | if (edx == 1) { 0x004213c5 jne 0x4213f9 | 0x004213c7 shl rsi, 2 | rsi <<= 2; 0x004213cb add rsi, qword [rdi + 0x30] | rsi += *((rdi + 0x30)); 0x004213cf mov rax, qword [rdi + 0x28] | rax = *((rdi + 0x28)); 0x004213d3 jmp 0x421401 | | } else { 0x004213d5 mov rax, qword [rdi + 0x28] | rax = *((rdi + 0x28)); 0x004213d9 mov rcx, qword [rdi + 0x30] | rcx = *((rdi + 0x30)); 0x004213dd sub rcx, rax | rcx -= rax; 0x004213e0 sar rcx, 2 | rcx >>= 2; 0x004213e4 mov rdx, qword [rdi + 0x70] | rdx = *((rdi + 0x70)); 0x004213e8 cmp rdx, rcx | | if (rdx >= rcx) { 0x004213eb cmovge rcx, rdx | rcx = rdx; | } 0x004213ef lea rcx, [rax + rcx*4] | rcx = rax + rcx*4; 0x004213f3 lea rsi, [rcx + rsi*4] | rsi = rcx + rsi*4; 0x004213f7 jmp 0x421401 | | } else { 0x004213f9 mov rax, qword [rdi + 0x28] | rax = *((rdi + 0x28)); 0x004213fd lea rsi, [rax + rsi*4] | rsi = rax + rsi*4; | } | } 0x00421401 mov r8, 0xffffffffffffffff | r8 = 0xffffffffffffffff; 0x00421408 cmp rsi, rax | | if (rsi < rax) { 0x0042140b jb 0x421500 | goto label_0; | } 0x00421411 mov rcx, qword [rdi + 0x30] | rcx = *((rdi + 0x30)); 0x00421415 mov rdx, qword [rdi + 0x70] | rdx = *((rdi + 0x70)); 0x00421419 sub rcx, rax | rcx -= rax; 0x0042141c sar rcx, 2 | rcx >>= 2; 0x00421420 cmp rdx, rcx | | if (rdx >= rcx) { 0x00421423 cmovge rcx, rdx | rcx = rdx; | } 0x00421427 lea rax, [rax + rcx*4] | rax = rax + rcx*4; 0x0042142b cmp rsi, rax | | if (rsi > rax) { 0x0042142e ja 0x421500 | goto label_0; | } 0x00421434 lea r9, [rdi + 0x40] | r9 = rdi + 0x40; 0x00421438 cmp qword [rdi + 0x60], 5 | | if (*((rdi + 0x60)) != 5) { 0x0042143d je 0x421442 | 0x0042143f mov r9, qword [r9] | r9 = *(r9); | } 0x00421442 mov rcx, qword [rdi + 0x58] | rcx = *((rdi + 0x58)); 0x00421446 mov rax, rsi | rax = rsi; 0x00421449 sub rax, r9 | rax -= r9; 0x0042144c mov r8, rax | r8 = rax; 0x0042144f sar r8, 2 | r8 >>= 2; 0x00421453 lea rcx, [r9 + rcx*4] | rcx = r9 + rcx*4; 0x00421457 mov qword [rdi + 0x30], r9 | *((rdi + 0x30)) = r9; 0x0042145b mov qword [rdi + 0x28], r9 | *((rdi + 0x28)) = r9; 0x0042145f mov qword [rdi + 0x38], rcx | *((rdi + 0x38)) = rcx; 0x00421463 movabs rcx, 0x1fffffffd | rcx = 0x1fffffffd; 0x0042146d cmp rax, rcx | | if (rax >= rcx) { 0x00421470 jl 0x4214ed | 0x00421472 mov rcx, r9 | rcx = r9; 0x00421475 sub rcx, rsi | rcx -= rsi; 0x00421478 cmp rcx, rax | | if (rcx <= rax) { 0x0042147b cmovle rcx, rax | rcx = rax; | } 0x0042147f mov rsi, rcx | rsi = rcx; 0x00421482 shr rsi, 2 | rsi >>= 2; 0x00421486 shr rcx, 3 | rcx >>= 3; 0x0042148a cmp rcx, 0x7fffffff | 0x00421491 mov eax, 0xfffffffe | eax = 0xfffffffe; | if (rcx < 0x7fffffff) { 0x00421496 cmovb rax, rsi | rax = rsi; | } 0x0042149a neg rax | rax = -rax; 0x0042149d lea rcx, [rsi + rax + 0x7ffffffe] | rcx = rsi + rax + 0x7ffffffe; 0x004214a5 movabs rdx, 0x200000005 | rdx = 0x200000005; 0x004214af mov rax, rcx | rax = rcx; 0x004214b2 mul rdx | rdx:rax = rax * rdx; 0x004214b5 sub rcx, rdx | rcx -= rdx; 0x004214b8 shr rcx, 1 | rcx >>= 1; 0x004214bb add rcx, rdx | rcx += rdx; 0x004214be shr rcx, 0x1e | rcx >>= 0x1e; 0x004214c2 mov rax, rcx | rax = rcx; 0x004214c5 shl rax, 0x1f | rax <<= 0x1f; 0x004214c9 sub rax, rcx | rax -= rcx; 0x004214cc lea rcx, [r9 + rax*4] | rcx = r9 + rax*4; 0x004214d0 movabs r9, 0x1fffffffc | r9 = 0x1fffffffc; 0x004214da add r9, rcx | r9 += rcx; 0x004214dd sub rsi, rax | rsi -= rax; 0x004214e0 add rsi, 0xffffffff80000001 | rsi += 0xffffffff80000001; 0x004214e7 mov qword [rdi + 0x30], r9 | *((rdi + 0x30)) = r9; 0x004214eb jmp 0x4214f0 | | } else { 0x004214ed mov rsi, r8 | rsi = r8; | } 0x004214f0 test rsi, rsi | | if (rsi == 0) { 0x004214f3 je 0x421500 | goto label_0; | } 0x004214f5 movsxd rax, esi | rax = (int64_t) esi; 0x004214f8 lea rax, [r9 + rax*4] | rax = r9 + rax*4; 0x004214fc mov qword [rdi + 0x30], rax | *((rdi + 0x30)) = rax; | } | label_0: 0x00421500 xor eax, eax | eax = 0; 0x00421502 mov rdx, r8 | rdx = r8; 0x00421505 pop rbx | 0x00421506 ret | return rax; | }