; assembly | /* r2dec pseudo code output */ | /* bslmt_barrier.t/none @ 0x408bc0 */ | #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&) */ 0x00408bc0 push rbp | 0x00408bc1 push r15 | 0x00408bc3 push r14 | 0x00408bc5 push r13 | 0x00408bc7 push r12 | 0x00408bc9 push rbx | 0x00408bca sub rsp, 0x28 | 0x00408bce mov rbp, rsi | 0x00408bd1 mov r13, rdi | r13 = rdi; 0x00408bd4 cmp dword [rdi + 0x58], 0 | | if (*((rdi + 0x58)) == 0) { 0x00408bd8 je 0x408cba | goto label_0; | } 0x00408bde call 0x403730 | rax = std::_1::chrono::system_clock::now() (); 0x00408be3 mov rbx, rax | rbx = rax; 0x00408be6 mov eax, 0xffffffff | eax = 0xffffffff; 0x00408beb cmp rbx, qword [rbp] | | if (rbx >= *(rbp)) { 0x00408bef jge 0x408d64 | goto label_1; | } 0x00408bf5 movabs r14, 0x431bde82d7b634db | r14 = 0x431bde82d7b634db; 0x00408bff lea r15, [rsp + 0x18] | r15 = rsp + 0x18; 0x00408c04 mov r12, rsp | r12 = rsp; 0x00408c07 nop word [rax + rax] | | do { 0x00408c10 mov eax, dword [r13 + 0x58] | eax = *((r13 + 0x58)); 0x00408c14 test eax, eax | | if (eax != 0) { 0x00408c16 je 0x408c30 | 0x00408c18 cmp eax, 1 | | if (eax != 1) { 0x00408c1b jne 0x408c40 | goto label_2; | } 0x00408c1d call 0x42f1e0 | BloombergLP::bsls::SystemTime::nowMonotonicClock() (); 0x00408c22 jmp 0x408c35 | | } else { 0x00408c30 call 0x42f270 | eax = BloombergLP::bsls::SystemTime::nowRealtimeClock() (); | } 0x00408c35 jmp 0x408c44 | goto label_3; | label_2: 0x00408c40 xor edx, edx | edx = 0; 0x00408c42 xor eax, eax | eax = 0; | label_3: 0x00408c44 mov qword [rsp + 0x18], rax | *((rsp + 0x18)) = rax; 0x00408c49 mov dword [rsp + 0x20], edx | *((rsp + 0x20)) = edx; 0x00408c4d mov rcx, qword [rbp] | rcx = *(rbp); 0x00408c51 sub rcx, rbx | rcx -= rbx; 0x00408c54 mov rax, rcx | rax = rcx; 0x00408c57 imul r14 | rdx:rax = rax * r14; 0x00408c5a mov rax, rdx | rax = rdx; 0x00408c5d shr rax, 0x3f | rax >>= 0x3f; 0x00408c61 sar rdx, 0x12 | rdx >>= 0x12; 0x00408c65 add rdx, rax | rdx += rax; 0x00408c68 imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x00408c6e add ecx, eax | ecx += eax; 0x00408c70 imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x00408c76 mov rdi, r15 | 0x00408c79 mov rsi, rdx | 0x00408c7c mov edx, eax | 0x00408c7e call 0x42f390 | rax = BloombergLP::bsls::TimeInterval::addInterval(long long,int) (r15, rdx, eax); 0x00408c83 movups xmm0, xmmword [rax] | __asm ("movups xmm0, xmmword [rax]"); 0x00408c86 movaps xmmword [rsp], xmm0 | *(rsp) = xmm0; 0x00408c8a mov rdi, r13 | 0x00408c8d mov rsi, r12 | 0x00408c90 call 0x4091d0 | eax = BloombergLP::bslmt::Barrier::timedWait(BloombergLP::bsls::TimeIntervalconst&) (r13, r12); 0x00408c95 cmp eax, 0xffffffff | | if (eax != 0xffffffff) { 0x00408c98 jne 0x408d64 | goto label_1; | } 0x00408c9e call 0x403730 | rax = std::_1::chrono::system_clock::now() (); 0x00408ca3 mov rbx, rax | rbx = rax; 0x00408ca6 cmp rax, qword [rbp] | 0x00408caa jl 0x408c10 | | } while (rax < *(rbp)); 0x00408cb0 mov eax, 0xffffffff | eax = 0xffffffff; 0x00408cb5 jmp 0x408d64 | goto label_1; | label_0: 0x00408cba mov rcx, qword [rbp] | rcx = *(rbp); 0x00408cbe movabs rdx, 0x431bde82d7b634db | rdx = 0x431bde82d7b634db; 0x00408cc8 mov rax, rcx | rax = rcx; 0x00408ccb imul rdx | rdx:rax = rax * rdx; 0x00408cce mov rax, rdx | rax = rdx; 0x00408cd1 shr rax, 0x3f | rax >>= 0x3f; 0x00408cd5 sar rdx, 0x12 | rdx >>= 0x12; 0x00408cd9 add rdx, rax | rdx += rax; 0x00408cdc imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x00408ce2 add ecx, eax | ecx += eax; 0x00408ce4 imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x00408cea mov qword [rsp], rdx | *(rsp) = rdx; 0x00408cee lea ecx, [rax + 0x3b9ac9ff] | ecx = rax + 0x3b9ac9ff; 0x00408cf4 cmp ecx, 0x773593ff | | if (ecx >= 0x773593ff) { 0x00408cfa jb 0x408d25 | 0x00408cfc movsxd rcx, eax | rcx = (int64_t) eax; 0x00408cff imul rcx, rcx, 0x44b82fa1 | rcx *= 0x44b82fa1; 0x00408d06 mov rsi, rcx | rsi = rcx; 0x00408d09 shr rsi, 0x3f | rsi >>= 0x3f; 0x00408d0d sar rcx, 0x3c | rcx >>= 0x3c; 0x00408d11 add ecx, esi | ecx += esi; 0x00408d13 movsxd rcx, ecx | rcx = (int64_t) ecx; 0x00408d16 add rdx, rcx | rdx += rcx; 0x00408d19 mov qword [rsp], rdx | *(rsp) = rdx; 0x00408d1d imul ecx, ecx, 0x3b9aca00 | ecx *= 0x3b9aca00; 0x00408d23 sub eax, ecx | eax -= ecx; | } 0x00408d25 mov dword [rsp + 8], eax | *((rsp + 8)) = eax; 0x00408d29 test rdx, rdx | | if (rdx > 0) { 0x00408d2c jle 0x408d40 | 0x00408d2e test eax, eax | | if (eax >= 0) { 0x00408d30 jns 0x408d59 | goto label_4; | } 0x00408d32 dec rdx | rdx--; 0x00408d35 mov qword [rsp], rdx | *(rsp) = rdx; 0x00408d39 add eax, 0x3b9aca00 | eax += 0x3b9aca00; 0x00408d3e jmp 0x408d55 | | } else { 0x00408d40 test eax, eax | | if (eax <= 0) { 0x00408d42 jle 0x408d59 | goto label_4; | } 0x00408d44 test rdx, rdx | | if (rdx == 0) { 0x00408d47 je 0x408d59 | goto label_4; | } 0x00408d49 inc rdx | rdx++; 0x00408d4c mov qword [rsp], rdx | *(rsp) = rdx; 0x00408d50 add eax, 0xc4653600 | eax += 0xc4653600; | } 0x00408d55 mov dword [rsp + 8], eax | *((rsp + 8)) = eax; | label_4: 0x00408d59 mov rsi, rsp | 0x00408d5c mov rdi, r13 | 0x00408d5f call 0x4091d0 | BloombergLP::bslmt::Barrier::timedWait(BloombergLP::bsls::TimeIntervalconst&) (r13, rsp); | label_1: 0x00408d64 add rsp, 0x28 | 0x00408d68 pop rbx | 0x00408d69 pop r12 | 0x00408d6b pop r13 | 0x00408d6d pop r14 | 0x00408d6f pop r15 | 0x00408d71 pop rbp | 0x00408d72 ret | return rax; | }