; assembly | /* r2dec pseudo code output */ | /* bslmt_latch.t/none @ 0x409380 */ | #include | ; (fcn) method.int_BloombergLP::bslmt::ChronoUtil::timedWait_BloombergLP::bslmt::Latch__std::__1::chrono::system_clock__std::__1::chrono::duration_long_long__std::__1.ratio_1l__1000000l______BloombergLP::bslmt::Latch__std::__1::chrono::time_point_std::__1::chro () | uint64_t method_int_BloombergLP::bslmt::ChronoUtil::timedWait_BloombergLP::bslmt::Latch_std::_1::chrono::system_clock_std::_1::chrono::duration_long_long_std::_1_ratio_1l_1000000l_BloombergLP::bslmt::Latch_std::_1::chrono::time_point_std::_1::chro (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::Latch*, std::__1::chrono::time_point > > const&) */ 0x00409380 push rbp | 0x00409381 push r15 | 0x00409383 push r14 | 0x00409385 push r13 | 0x00409387 push r12 | 0x00409389 push rbx | 0x0040938a sub rsp, 0x28 | 0x0040938e mov rbp, rsi | 0x00409391 mov r13, rdi | r13 = rdi; 0x00409394 cmp dword [rdi + 0x58], 0 | | if (*((rdi + 0x58)) == 0) { 0x00409398 je 0x40947a | goto label_0; | } 0x0040939e call 0x403e10 | rax = std::_1::chrono::system_clock::now() (); 0x004093a3 mov rbx, rax | rbx = rax; 0x004093a6 mov eax, 0xffffffff | eax = 0xffffffff; 0x004093ab cmp rbx, qword [rbp] | | if (rbx >= *(rbp)) { 0x004093af jge 0x409524 | goto label_1; | } 0x004093b5 movabs r14, 0x431bde82d7b634db | r14 = 0x431bde82d7b634db; 0x004093bf lea r15, [rsp + 0x18] | r15 = rsp + 0x18; 0x004093c4 mov r12, rsp | r12 = rsp; 0x004093c7 nop word [rax + rax] | | do { 0x004093d0 mov eax, dword [r13 + 0x58] | eax = *((r13 + 0x58)); 0x004093d4 test eax, eax | | if (eax != 0) { 0x004093d6 je 0x4093f0 | 0x004093d8 cmp eax, 1 | | if (eax != 1) { 0x004093db jne 0x409400 | goto label_2; | } 0x004093dd call 0x431140 | BloombergLP::bsls::SystemTime::nowMonotonicClock() (); 0x004093e2 jmp 0x4093f5 | | } else { 0x004093f0 call 0x4311d0 | eax = BloombergLP::bsls::SystemTime::nowRealtimeClock() (); | } 0x004093f5 jmp 0x409404 | goto label_3; | label_2: 0x00409400 xor edx, edx | edx = 0; 0x00409402 xor eax, eax | eax = 0; | label_3: 0x00409404 mov qword [rsp + 0x18], rax | *((rsp + 0x18)) = rax; 0x00409409 mov dword [rsp + 0x20], edx | *((rsp + 0x20)) = edx; 0x0040940d mov rcx, qword [rbp] | rcx = *(rbp); 0x00409411 sub rcx, rbx | rcx -= rbx; 0x00409414 mov rax, rcx | rax = rcx; 0x00409417 imul r14 | rdx:rax = rax * r14; 0x0040941a mov rax, rdx | rax = rdx; 0x0040941d shr rax, 0x3f | rax >>= 0x3f; 0x00409421 sar rdx, 0x12 | rdx >>= 0x12; 0x00409425 add rdx, rax | rdx += rax; 0x00409428 imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x0040942e add ecx, eax | ecx += eax; 0x00409430 imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x00409436 mov rdi, r15 | 0x00409439 mov rsi, rdx | 0x0040943c mov edx, eax | 0x0040943e call 0x4312f0 | rax = BloombergLP::bsls::TimeInterval::addInterval(long long,int) (r15, rdx, eax); 0x00409443 movups xmm0, xmmword [rax] | __asm ("movups xmm0, xmmword [rax]"); 0x00409446 movaps xmmword [rsp], xmm0 | *(rsp) = xmm0; 0x0040944a mov rdi, r13 | 0x0040944d mov rsi, r12 | 0x00409450 call 0x409d30 | eax = BloombergLP::bslmt::Latch::timedWait(BloombergLP::bsls::TimeIntervalconst&) (r13, r12); 0x00409455 cmp eax, 0xffffffff | | if (eax != 0xffffffff) { 0x00409458 jne 0x409524 | goto label_1; | } 0x0040945e call 0x403e10 | rax = std::_1::chrono::system_clock::now() (); 0x00409463 mov rbx, rax | rbx = rax; 0x00409466 cmp rax, qword [rbp] | 0x0040946a jl 0x4093d0 | | } while (rax < *(rbp)); 0x00409470 mov eax, 0xffffffff | eax = 0xffffffff; 0x00409475 jmp 0x409524 | goto label_1; | label_0: 0x0040947a mov rcx, qword [rbp] | rcx = *(rbp); 0x0040947e movabs rdx, 0x431bde82d7b634db | rdx = 0x431bde82d7b634db; 0x00409488 mov rax, rcx | rax = rcx; 0x0040948b imul rdx | rdx:rax = rax * rdx; 0x0040948e mov rax, rdx | rax = rdx; 0x00409491 shr rax, 0x3f | rax >>= 0x3f; 0x00409495 sar rdx, 0x12 | rdx >>= 0x12; 0x00409499 add rdx, rax | rdx += rax; 0x0040949c imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x004094a2 add ecx, eax | ecx += eax; 0x004094a4 imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x004094aa mov qword [rsp], rdx | *(rsp) = rdx; 0x004094ae lea ecx, [rax + 0x3b9ac9ff] | ecx = rax + 0x3b9ac9ff; 0x004094b4 cmp ecx, 0x773593ff | | if (ecx >= 0x773593ff) { 0x004094ba jb 0x4094e5 | 0x004094bc movsxd rcx, eax | rcx = (int64_t) eax; 0x004094bf imul rcx, rcx, 0x44b82fa1 | rcx *= 0x44b82fa1; 0x004094c6 mov rsi, rcx | rsi = rcx; 0x004094c9 shr rsi, 0x3f | rsi >>= 0x3f; 0x004094cd sar rcx, 0x3c | rcx >>= 0x3c; 0x004094d1 add ecx, esi | ecx += esi; 0x004094d3 movsxd rcx, ecx | rcx = (int64_t) ecx; 0x004094d6 add rdx, rcx | rdx += rcx; 0x004094d9 mov qword [rsp], rdx | *(rsp) = rdx; 0x004094dd imul ecx, ecx, 0x3b9aca00 | ecx *= 0x3b9aca00; 0x004094e3 sub eax, ecx | eax -= ecx; | } 0x004094e5 mov dword [rsp + 8], eax | *((rsp + 8)) = eax; 0x004094e9 test rdx, rdx | | if (rdx > 0) { 0x004094ec jle 0x409500 | 0x004094ee test eax, eax | | if (eax >= 0) { 0x004094f0 jns 0x409519 | goto label_4; | } 0x004094f2 dec rdx | rdx--; 0x004094f5 mov qword [rsp], rdx | *(rsp) = rdx; 0x004094f9 add eax, 0x3b9aca00 | eax += 0x3b9aca00; 0x004094fe jmp 0x409515 | | } else { 0x00409500 test eax, eax | | if (eax <= 0) { 0x00409502 jle 0x409519 | goto label_4; | } 0x00409504 test rdx, rdx | | if (rdx == 0) { 0x00409507 je 0x409519 | goto label_4; | } 0x00409509 inc rdx | rdx++; 0x0040950c mov qword [rsp], rdx | *(rsp) = rdx; 0x00409510 add eax, 0xc4653600 | eax += 0xc4653600; | } 0x00409515 mov dword [rsp + 8], eax | *((rsp + 8)) = eax; | label_4: 0x00409519 mov rsi, rsp | 0x0040951c mov rdi, r13 | 0x0040951f call 0x409d30 | BloombergLP::bslmt::Latch::timedWait(BloombergLP::bsls::TimeIntervalconst&) (r13, rsp); | label_1: 0x00409524 add rsp, 0x28 | 0x00409528 pop rbx | 0x00409529 pop r12 | 0x0040952b pop r13 | 0x0040952d pop r14 | 0x0040952f pop r15 | 0x00409531 pop rbp | 0x00409532 ret | return rax; | }