; assembly | /* r2dec pseudo code output */ | /* bslmt_fastpostsemaphore.t/assume @ 0x407480 */ | #include | ; (fcn) method.int_BloombergLP::bslmt::ChronoUtil::timedWait_BloombergLP::bslmt::FastPostSemaphore__std::__1::chrono::steady_clock__std::__1::chrono::duration_long_long__std::__1.ratio_1l__1000000000l______BloombergLP::bslmt::FastPostSemaphore__std::__1::chrono () | int64_t method_int_BloombergLP::bslmt::ChronoUtil::timedWait_BloombergLP::bslmt::FastPostSemaphore_std::_1::chrono::steady_clock_std::_1::chrono::duration_long_long_std::_1_ratio_1l_1000000000l_BloombergLP::bslmt::FastPostSemaphore_std::_1::chrono (int32_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::FastPostSemaphore*, std::__1::chrono::time_point > > const&) */ 0x00407480 push rbp | 0x00407481 push r15 | 0x00407483 push r14 | 0x00407485 push r13 | 0x00407487 push r12 | 0x00407489 push rbx | 0x0040748a sub rsp, 0x28 | 0x0040748e mov rbp, rsi | 0x00407491 mov r13, rdi | r13 = rdi; 0x00407494 cmp dword [rdi + 0x60], 1 | | if (*((rdi + 0x60)) == 1) { 0x00407498 jne 0x407529 | 0x0040749e mov rcx, qword [rbp] | rcx = *(rbp); 0x004074a2 movabs rdx, 0x112e0be826d694b3 | rdx = 0x112e0be826d694b3; 0x004074ac mov rax, rcx | rax = rcx; 0x004074af imul rdx | rdx:rax = rax * rdx; 0x004074b2 mov rax, rdx | rax = rdx; 0x004074b5 shr rax, 0x3f | rax >>= 0x3f; 0x004074b9 sar rdx, 0x1a | rdx >>= 0x1a; 0x004074bd add rdx, rax | rdx += rax; 0x004074c0 imul eax, edx, 0xc4653600 | eax = edx * 0xc4653600; 0x004074c6 mov qword [rsp], rdx | *(rsp) = rdx; 0x004074ca lea esi, [rax + rcx + 0x3b9ac9ff] | esi = rax + rcx + 0x3b9ac9ff; 0x004074d1 add eax, ecx | eax += ecx; 0x004074d3 cmp esi, 0x773593ff | | if (esi >= 0x773593ff) { 0x004074d9 jb 0x407503 | 0x004074db cdqe | rax = (int64_t) eax; 0x004074dd imul rcx, rax, 0x44b82fa1 | rcx = rax * 0x44b82fa1; 0x004074e4 mov rsi, rcx | rsi = rcx; 0x004074e7 shr rsi, 0x3f | rsi >>= 0x3f; 0x004074eb sar rcx, 0x3c | rcx >>= 0x3c; 0x004074ef add ecx, esi | ecx += esi; 0x004074f1 movsxd rcx, ecx | rcx = (int64_t) ecx; 0x004074f4 add rdx, rcx | rdx += rcx; 0x004074f7 mov qword [rsp], rdx | *(rsp) = rdx; 0x004074fb imul ecx, ecx, 0x3b9aca00 | ecx *= 0x3b9aca00; 0x00407501 sub eax, ecx | eax -= ecx; | } 0x00407503 mov dword [rsp + 8], eax | *((rsp + 8)) = eax; 0x00407507 test rdx, rdx | | if (rdx <= 0) { 0x0040750a jle 0x407600 | goto label_0; | } 0x00407510 test eax, eax | | if (eax >= 0) { 0x00407512 jns 0x407619 | goto label_1; | } 0x00407518 dec rdx | rdx--; 0x0040751b mov qword [rsp], rdx | *(rsp) = rdx; 0x0040751f add eax, 0x3b9aca00 | eax += 0x3b9aca00; 0x00407524 jmp 0x407615 | goto label_2; | } 0x00407529 call 0x4028a0 | rax = std::_1::chrono::steady_clock::now() (); 0x0040752e mov r14d, 0xfffffffe | r14d = 0xfffffffe; 0x00407534 cmp rax, qword [rbp] | | if (rax >= *(rbp)) { 0x00407538 jge 0x4076b6 | goto label_3; | } 0x0040753e mov rbx, rax | rbx = rax; 0x00407541 movabs r12, 0x112e0be826d694b3 | r12 = 0x112e0be826d694b3; 0x0040754b lea r15, [rsp + 0x18] | r15 = rsp + 0x18; | do { 0x00407550 cmp dword [r13 + 0x60], 1 | | if (*((r13 + 0x60)) == 1) { 0x00407555 jne 0x407560 | 0x00407557 call 0x422180 | BloombergLP::bsls::SystemTime::nowMonotonicClock() (); 0x0040755c jmp 0x407565 | | } else { 0x00407560 call 0x422210 | rax = BloombergLP::bsls::SystemTime::nowRealtimeClock() (); | } 0x00407565 mov qword [rsp + 0x18], rax | *((rsp + 0x18)) = rax; 0x0040756a mov dword [rsp + 0x20], edx | *((rsp + 0x20)) = edx; 0x0040756e mov rcx, qword [rbp] | rcx = *(rbp); 0x00407572 sub rcx, rbx | rcx -= rbx; 0x00407575 mov rax, rcx | rax = rcx; 0x00407578 imul r12 | rdx:rax = rax * r12; 0x0040757b mov rax, rdx | rax = rdx; 0x0040757e shr rax, 0x3f | rax >>= 0x3f; 0x00407582 sar rdx, 0x1a | rdx >>= 0x1a; 0x00407586 add rdx, rax | rdx += rax; 0x00407589 imul eax, edx, 0xc4653600 | eax = edx * 0xc4653600; 0x0040758f add ecx, eax | ecx += eax; 0x00407591 mov rdi, r15 | 0x00407594 mov rsi, rdx | 0x00407597 mov edx, ecx | 0x00407599 call 0x422330 | rax = BloombergLP::bsls::TimeInterval::addInterval(long long,int) (r15, rdx, ecx); 0x0040759e movups xmm0, xmmword [rax] | __asm ("movups xmm0, xmmword [rax]"); 0x004075a1 movaps xmmword [rsp], xmm0 | *(rsp) = xmm0; 0x004075a5 mov rax, 0xfffffffff0000000 | rax = 0xfffffffff0000000; 0x004075ac lock xadd qword [r13], rax | __asm ("lock xadd qword [r13], rax"); 0x004075b2 test eax, 0x1000000 | | if ((eax & 0x1000000) != 0) { 0x004075b7 jne 0x407658 | goto label_4; | } 0x004075bd lea rdx, [rax - 0x10000000] | rdx = rax - 0x10000000; 0x004075c4 mov rcx, rdx | rcx = rdx; 0x004075c7 sar rcx, 0x1c | rcx >>= 0x1c; 0x004075cb and eax, 0xffffff | eax &= 0xffffff; 0x004075d0 cmp rcx, rax | | if (rcx >= rax) { 0x004075d3 jge 0x4076b3 | goto label_5; | } 0x004075d9 mov rdi, r13 | 0x004075dc mov rsi, rsp | 0x004075df call 0x406df0 | eax = BloombergLP::bslmt::FastPostSemaphoreImpl::timedWaitSlowPath(BloombergLP::bsls::TimeIntervalconst&,long long) (r13, rsp, rdx); 0x004075e4 cmp eax, 0xfffffffe | | if (eax != 0xfffffffe) { 0x004075e7 jne 0x407653 | goto label_6; | } 0x004075e9 call 0x4028a0 | rax = std::_1::chrono::steady_clock::now() (); 0x004075ee mov rbx, rax | rbx = rax; 0x004075f1 cmp rax, qword [rbp] | 0x004075f5 jl 0x407550 | | } while (rax < *(rbp)); 0x004075fb jmp 0x4076b6 | goto label_3; | label_0: 0x00407600 test eax, eax | | if (eax > 0) { 0x00407602 jle 0x407619 | 0x00407604 test rdx, rdx | | if (rdx == 0) { 0x00407607 je 0x407619 | goto label_1; | } 0x00407609 inc rdx | rdx++; 0x0040760c mov qword [rsp], rdx | *(rsp) = rdx; 0x00407610 add eax, 0xc4653600 | eax += 0xc4653600; | label_2: 0x00407615 mov dword [rsp + 8], eax | *((rsp + 8)) = eax; | } | label_1: 0x00407619 mov rax, 0xfffffffff0000000 | rax = 0xfffffffff0000000; 0x00407620 lock xadd qword [r13], rax | __asm ("lock xadd qword [r13], rax"); 0x00407626 test eax, 0x1000000 | | if ((eax & 0x1000000) == 0) { 0x0040762b jne 0x407658 | 0x0040762d lea rdx, [rax - 0x10000000] | rdx = rax - 0x10000000; 0x00407634 mov rcx, rdx | rcx = rdx; 0x00407637 sar rcx, 0x1c | rcx >>= 0x1c; 0x0040763b and eax, 0xffffff | eax &= 0xffffff; 0x00407640 xor r14d, r14d | r14d = 0; 0x00407643 cmp rcx, rax | | if (rcx >= rax) { 0x00407646 jge 0x4076b6 | goto label_3; | } 0x00407648 mov rsi, rsp | 0x0040764b mov rdi, r13 | 0x0040764e call 0x406df0 | eax = BloombergLP::bslmt::FastPostSemaphoreImpl::timedWaitSlowPath(BloombergLP::bsls::TimeIntervalconst&,long long) (r13, rsp, rdx); | label_6: 0x00407653 mov r14d, eax | r14d = eax; 0x00407656 jmp 0x4076b6 | | } else { | label_4: 0x00407658 mov eax, 0x10000000 | eax = 0x10000000; 0x0040765d lock xadd qword [r13], rax | __asm ("lock xadd qword [r13], rax"); 0x00407663 mov r14d, 0xffffffff | r14d = 0xffffffff; 0x00407669 test eax, 0xffffff | | if ((eax & 0xffffff) == 0) { 0x0040766e je 0x4076b6 | goto label_3; | } 0x00407670 mov ecx, eax | ecx = eax; 0x00407672 and ecx, 0x1000000 | ecx &= 0x1000000; 0x00407678 test rcx, rcx | | if (rcx != 0) { 0x0040767b jne 0x4076b6 | goto label_3; | } 0x0040767d add rax, 0x10000000 | rax += 0x10000000; 0x00407683 and rax, 0xfffffffff0000000 | rax &= 0xfffffffff0000000; 0x00407689 cmp rax, 0x10000000 | | if (rax != 0x10000000) { 0x0040768f jne 0x4076b6 | goto label_3; | } 0x00407691 lea rbx, [r13 + 8] | rbx = r13 + 8; 0x00407695 mov rdi, rbx | rdi = rbx; 0x00407698 call 0x402970 | pthread_mutex_lock (); 0x0040769d mov rdi, rbx | rdi = rbx; 0x004076a0 call 0x4029e0 | pthread_mutex_unlock (); 0x004076a5 add r13, 0x30 | r13 += 0x30; 0x004076a9 mov rdi, r13 | rdi = r13; 0x004076ac call 0x4026b0 | pthread_cond_signal (); 0x004076b1 jmp 0x4076b6 | goto label_3; | label_5: 0x004076b3 xor r14d, r14d | r14d = 0; | } | label_3: 0x004076b6 mov eax, r14d | eax = r14d; 0x004076b9 add rsp, 0x28 | 0x004076bd pop rbx | 0x004076be pop r12 | 0x004076c0 pop r13 | 0x004076c2 pop r14 | 0x004076c4 pop r15 | 0x004076c6 pop rbp | 0x004076c7 ret | return rax; | }