; assembly | /* r2dec pseudo code output */ | /* bslmt_barrier.t/assume @ 0x408b40 */ | #include | ; (fcn) method.int_BloombergLP::bslmt::ChronoUtil::timedWait_BloombergLP::bslmt::Barrier__std::__1::chrono::system_clock__std::__1::chrono::duration_long_long__std::__1.ratio_1l__1000000l______BloombergLP::bslmt::Barrier__std::__1::chrono::time_point_std::__1:: () | uint64_t method_int_BloombergLP::bslmt::ChronoUtil::timedWait_BloombergLP::bslmt::Barrier_std::_1::chrono::system_clock_std::_1::chrono::duration_long_long_std::_1_ratio_1l_1000000l_BloombergLP::bslmt::Barrier_std::_1::chrono::time_point_std::_1:: (int64_t arg2, uint32_t arg1) { | int64_t var_8h; | int64_t var_18h; | int64_t var_20h; | rsi = arg2; | rdi = arg1; | /* int BloombergLP::bslmt::ChronoUtil::timedWait > >(BloombergLP::bslmt::Barrier*, std::__1::chrono::time_point > > const&) */ 0x00408b40 push rbp | 0x00408b41 push r15 | 0x00408b43 push r14 | 0x00408b45 push r13 | 0x00408b47 push r12 | 0x00408b49 push rbx | 0x00408b4a sub rsp, 0x28 | 0x00408b4e mov rbp, rsi | 0x00408b51 mov r13, rdi | r13 = rdi; 0x00408b54 cmp dword [rdi + 0x58], 0 | | if (*((rdi + 0x58)) == 0) { 0x00408b58 je 0x408c17 | goto label_0; | } 0x00408b5e call 0x403730 | rax = std::_1::chrono::system_clock::now() (); 0x00408b63 mov rbx, rax | rbx = rax; 0x00408b66 mov eax, 0xffffffff | eax = 0xffffffff; 0x00408b6b cmp rbx, qword [rbp] | | if (rbx >= *(rbp)) { 0x00408b6f jge 0x408cc1 | goto label_1; | } 0x00408b75 movabs r14, 0x431bde82d7b634db | r14 = 0x431bde82d7b634db; 0x00408b7f lea r15, [rsp + 0x18] | r15 = rsp + 0x18; 0x00408b84 mov r12, rsp | r12 = rsp; 0x00408b87 nop word [rax + rax] | | do { 0x00408b90 cmp dword [r13 + 0x58], 1 | | if (*((r13 + 0x58)) == 1) { 0x00408b95 jne 0x408ba0 | 0x00408b97 call 0x42f080 | BloombergLP::bsls::SystemTime::nowMonotonicClock() (); 0x00408b9c jmp 0x408ba5 | | } else { 0x00408ba0 call 0x42f110 | rax = BloombergLP::bsls::SystemTime::nowRealtimeClock() (); | } 0x00408ba5 mov qword [rsp + 0x18], rax | *((rsp + 0x18)) = rax; 0x00408baa mov dword [rsp + 0x20], edx | *((rsp + 0x20)) = edx; 0x00408bae mov rcx, qword [rbp] | rcx = *(rbp); 0x00408bb2 sub rcx, rbx | rcx -= rbx; 0x00408bb5 mov rax, rcx | rax = rcx; 0x00408bb8 imul r14 | rdx:rax = rax * r14; 0x00408bbb mov rax, rdx | rax = rdx; 0x00408bbe shr rax, 0x3f | rax >>= 0x3f; 0x00408bc2 sar rdx, 0x12 | rdx >>= 0x12; 0x00408bc6 add rdx, rax | rdx += rax; 0x00408bc9 imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x00408bcf add ecx, eax | ecx += eax; 0x00408bd1 imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x00408bd7 mov rdi, r15 | 0x00408bda mov rsi, rdx | 0x00408bdd mov edx, eax | 0x00408bdf call 0x42f230 | rax = BloombergLP::bsls::TimeInterval::addInterval(long long,int) (r15, rdx, eax); 0x00408be4 movups xmm0, xmmword [rax] | __asm ("movups xmm0, xmmword [rax]"); 0x00408be7 movaps xmmword [rsp], xmm0 | *(rsp) = xmm0; 0x00408beb mov rdi, r13 | 0x00408bee mov rsi, r12 | 0x00408bf1 call 0x4090b0 | eax = BloombergLP::bslmt::Barrier::timedWait(BloombergLP::bsls::TimeIntervalconst&) (r13, r12); 0x00408bf6 cmp eax, 0xffffffff | | if (eax != 0xffffffff) { 0x00408bf9 jne 0x408cc1 | goto label_1; | } 0x00408bff call 0x403730 | rax = std::_1::chrono::system_clock::now() (); 0x00408c04 mov rbx, rax | rbx = rax; 0x00408c07 cmp rax, qword [rbp] | 0x00408c0b jl 0x408b90 | | } while (rax < *(rbp)); 0x00408c0d mov eax, 0xffffffff | eax = 0xffffffff; 0x00408c12 jmp 0x408cc1 | goto label_1; | label_0: 0x00408c17 mov rcx, qword [rbp] | rcx = *(rbp); 0x00408c1b movabs rdx, 0x431bde82d7b634db | rdx = 0x431bde82d7b634db; 0x00408c25 mov rax, rcx | rax = rcx; 0x00408c28 imul rdx | rdx:rax = rax * rdx; 0x00408c2b mov rax, rdx | rax = rdx; 0x00408c2e shr rax, 0x3f | rax >>= 0x3f; 0x00408c32 sar rdx, 0x12 | rdx >>= 0x12; 0x00408c36 add rdx, rax | rdx += rax; 0x00408c39 imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x00408c3f add ecx, eax | ecx += eax; 0x00408c41 imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x00408c47 mov qword [rsp], rdx | *(rsp) = rdx; 0x00408c4b lea ecx, [rax + 0x3b9ac9ff] | ecx = rax + 0x3b9ac9ff; 0x00408c51 cmp ecx, 0x773593ff | | if (ecx >= 0x773593ff) { 0x00408c57 jb 0x408c82 | 0x00408c59 movsxd rcx, eax | rcx = (int64_t) eax; 0x00408c5c imul rcx, rcx, 0x44b82fa1 | rcx *= 0x44b82fa1; 0x00408c63 mov rsi, rcx | rsi = rcx; 0x00408c66 shr rsi, 0x3f | rsi >>= 0x3f; 0x00408c6a sar rcx, 0x3c | rcx >>= 0x3c; 0x00408c6e add ecx, esi | ecx += esi; 0x00408c70 movsxd rcx, ecx | rcx = (int64_t) ecx; 0x00408c73 add rdx, rcx | rdx += rcx; 0x00408c76 mov qword [rsp], rdx | *(rsp) = rdx; 0x00408c7a imul ecx, ecx, 0x3b9aca00 | ecx *= 0x3b9aca00; 0x00408c80 sub eax, ecx | eax -= ecx; | } 0x00408c82 mov dword [rsp + 8], eax | *((rsp + 8)) = eax; 0x00408c86 test rdx, rdx | | if (rdx > 0) { 0x00408c89 jle 0x408c9d | 0x00408c8b test eax, eax | | if (eax >= 0) { 0x00408c8d jns 0x408cb6 | goto label_2; | } 0x00408c8f dec rdx | rdx--; 0x00408c92 mov qword [rsp], rdx | *(rsp) = rdx; 0x00408c96 add eax, 0x3b9aca00 | eax += 0x3b9aca00; 0x00408c9b jmp 0x408cb2 | | } else { 0x00408c9d test eax, eax | | if (eax <= 0) { 0x00408c9f jle 0x408cb6 | goto label_2; | } 0x00408ca1 test rdx, rdx | | if (rdx == 0) { 0x00408ca4 je 0x408cb6 | goto label_2; | } 0x00408ca6 inc rdx | rdx++; 0x00408ca9 mov qword [rsp], rdx | *(rsp) = rdx; 0x00408cad add eax, 0xc4653600 | eax += 0xc4653600; | } 0x00408cb2 mov dword [rsp + 8], eax | *((rsp + 8)) = eax; | label_2: 0x00408cb6 mov rsi, rsp | 0x00408cb9 mov rdi, r13 | 0x00408cbc call 0x4090b0 | BloombergLP::bslmt::Barrier::timedWait(BloombergLP::bsls::TimeIntervalconst&) (r13, rsp); | label_1: 0x00408cc1 add rsp, 0x28 | 0x00408cc5 pop rbx | 0x00408cc6 pop r12 | 0x00408cc8 pop r13 | 0x00408cca pop r14 | 0x00408ccc pop r15 | 0x00408cce pop rbp | 0x00408ccf ret | return rax; | }