; assembly | /* r2dec pseudo code output */ | /* bslmt_fastpostsemaphore.t/none @ 0x407220 */ | #include | ; (fcn) method.int_BloombergLP::bslmt::ChronoUtil::timedWait_BloombergLP::bslmt::FastPostSemaphore__std::__1::chrono::system_clock__std::__1::chrono::duration_long_long__std::__1.ratio_1l__1000000l______BloombergLP::bslmt::FastPostSemaphore__std::__1::chrono::t () | uint64_t method_int_BloombergLP::bslmt::ChronoUtil::timedWait_BloombergLP::bslmt::FastPostSemaphore_std::_1::chrono::system_clock_std::_1::chrono::duration_long_long_std::_1_ratio_1l_1000000l_BloombergLP::bslmt::FastPostSemaphore_std::_1::chrono::t (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&) */ 0x00407220 push rbp | 0x00407221 push r15 | 0x00407223 push r14 | 0x00407225 push r13 | 0x00407227 push r12 | 0x00407229 push rbx | 0x0040722a sub rsp, 0x28 | 0x0040722e mov rbp, rsi | 0x00407231 mov r13, rdi | r13 = rdi; 0x00407234 cmp dword [rdi + 0x60], 0 | | if (*((rdi + 0x60)) == 0) { 0x00407238 je 0x40734f | goto label_0; | } 0x0040723e call 0x402920 | rax = std::_1::chrono::system_clock::now() (); 0x00407243 mov r14d, 0xfffffffe | r14d = 0xfffffffe; 0x00407249 cmp rax, qword [rbp] | | if (rax >= *(rbp)) { 0x0040724d jge 0x40748b | goto label_1; | } 0x00407253 mov rbx, rax | rbx = rax; 0x00407256 movabs r14, 0x431bde82d7b634db | r14 = 0x431bde82d7b634db; 0x00407260 lea r15, [rsp + 0x18] | r15 = rsp + 0x18; 0x00407265 mov r12, rsp | r12 = rsp; 0x00407268 nop dword [rax + rax] | | do { 0x00407270 mov eax, dword [r13 + 0x60] | eax = *((r13 + 0x60)); 0x00407274 test eax, eax | | if (eax != 0) { 0x00407276 je 0x407290 | 0x00407278 cmp eax, 1 | | if (eax != 1) { 0x0040727b jne 0x4072a0 | goto label_2; | } 0x0040727d call 0x422240 | BloombergLP::bsls::SystemTime::nowMonotonicClock() (); 0x00407282 jmp 0x407295 | | } else { 0x00407290 call 0x4222d0 | eax = BloombergLP::bsls::SystemTime::nowRealtimeClock() (); | } 0x00407295 jmp 0x4072a4 | goto label_3; | label_2: 0x004072a0 xor edx, edx | edx = 0; 0x004072a2 xor eax, eax | eax = 0; | label_3: 0x004072a4 mov qword [rsp + 0x18], rax | *((rsp + 0x18)) = rax; 0x004072a9 mov dword [rsp + 0x20], edx | *((rsp + 0x20)) = edx; 0x004072ad mov rcx, qword [rbp] | rcx = *(rbp); 0x004072b1 sub rcx, rbx | rcx -= rbx; 0x004072b4 mov rax, rcx | rax = rcx; 0x004072b7 imul r14 | rdx:rax = rax * r14; 0x004072ba mov rax, rdx | rax = rdx; 0x004072bd shr rax, 0x3f | rax >>= 0x3f; 0x004072c1 sar rdx, 0x12 | rdx >>= 0x12; 0x004072c5 add rdx, rax | rdx += rax; 0x004072c8 imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x004072ce add ecx, eax | ecx += eax; 0x004072d0 imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x004072d6 mov rdi, r15 | 0x004072d9 mov rsi, rdx | 0x004072dc mov edx, eax | 0x004072de call 0x4223f0 | rax = BloombergLP::bsls::TimeInterval::addInterval(long long,int) (r15, rdx, eax); 0x004072e3 movups xmm0, xmmword [rax] | __asm ("movups xmm0, xmmword [rax]"); 0x004072e6 movaps xmmword [rsp], xmm0 | *(rsp) = xmm0; 0x004072ea mov rax, 0xfffffffff0000000 | rax = 0xfffffffff0000000; 0x004072f1 lock xadd qword [r13], rax | __asm ("lock xadd qword [r13], rax"); 0x004072f7 test eax, 0x1000000 | | if ((eax & 0x1000000) != 0) { 0x004072fc jne 0x40742d | goto label_4; | } 0x00407302 lea rdx, [rax - 0x10000000] | rdx = rax - 0x10000000; 0x00407309 mov rcx, rdx | rcx = rdx; 0x0040730c sar rcx, 0x1c | rcx >>= 0x1c; 0x00407310 and eax, 0xffffff | eax &= 0xffffff; 0x00407315 cmp rcx, rax | | if (rcx >= rax) { 0x00407318 jge 0x407488 | goto label_5; | } 0x0040731e mov rdi, r13 | 0x00407321 mov rsi, r12 | 0x00407324 call 0x406df0 | eax = BloombergLP::bslmt::FastPostSemaphoreImpl::timedWaitSlowPath(BloombergLP::bsls::TimeIntervalconst&,long long) (r13, r12, rdx); 0x00407329 cmp eax, 0xfffffffe | | if (eax != 0xfffffffe) { 0x0040732c jne 0x407428 | goto label_6; | } 0x00407332 call 0x402920 | rax = std::_1::chrono::system_clock::now() (); 0x00407337 mov rbx, rax | rbx = rax; 0x0040733a cmp rax, qword [rbp] | 0x0040733e jl 0x407270 | | } while (rax < *(rbp)); 0x00407344 mov r14d, 0xfffffffe | r14d = 0xfffffffe; 0x0040734a jmp 0x40748b | goto label_1; | label_0: 0x0040734f mov rcx, qword [rbp] | rcx = *(rbp); 0x00407353 movabs rdx, 0x431bde82d7b634db | rdx = 0x431bde82d7b634db; 0x0040735d mov rax, rcx | rax = rcx; 0x00407360 imul rdx | rdx:rax = rax * rdx; 0x00407363 mov rax, rdx | rax = rdx; 0x00407366 shr rax, 0x3f | rax >>= 0x3f; 0x0040736a sar rdx, 0x12 | rdx >>= 0x12; 0x0040736e add rdx, rax | rdx += rax; 0x00407371 imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x00407377 add ecx, eax | ecx += eax; 0x00407379 imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x0040737f mov qword [rsp], rdx | *(rsp) = rdx; 0x00407383 lea ecx, [rax + 0x3b9ac9ff] | ecx = rax + 0x3b9ac9ff; 0x00407389 cmp ecx, 0x773593ff | | if (ecx >= 0x773593ff) { 0x0040738f jb 0x4073ba | 0x00407391 movsxd rcx, eax | rcx = (int64_t) eax; 0x00407394 imul rcx, rcx, 0x44b82fa1 | rcx *= 0x44b82fa1; 0x0040739b mov rsi, rcx | rsi = rcx; 0x0040739e shr rsi, 0x3f | rsi >>= 0x3f; 0x004073a2 sar rcx, 0x3c | rcx >>= 0x3c; 0x004073a6 add ecx, esi | ecx += esi; 0x004073a8 movsxd rcx, ecx | rcx = (int64_t) ecx; 0x004073ab add rdx, rcx | rdx += rcx; 0x004073ae mov qword [rsp], rdx | *(rsp) = rdx; 0x004073b2 imul ecx, ecx, 0x3b9aca00 | ecx *= 0x3b9aca00; 0x004073b8 sub eax, ecx | eax -= ecx; | } 0x004073ba mov dword [rsp + 8], eax | *((rsp + 8)) = eax; 0x004073be test rdx, rdx | | if (rdx > 0) { 0x004073c1 jle 0x4073d5 | 0x004073c3 test eax, eax | | if (eax >= 0) { 0x004073c5 jns 0x4073ee | goto label_7; | } 0x004073c7 dec rdx | rdx--; 0x004073ca mov qword [rsp], rdx | *(rsp) = rdx; 0x004073ce add eax, 0x3b9aca00 | eax += 0x3b9aca00; 0x004073d3 jmp 0x4073ea | | } else { 0x004073d5 test eax, eax | | if (eax <= 0) { 0x004073d7 jle 0x4073ee | goto label_7; | } 0x004073d9 test rdx, rdx | | if (rdx == 0) { 0x004073dc je 0x4073ee | goto label_7; | } 0x004073de inc rdx | rdx++; 0x004073e1 mov qword [rsp], rdx | *(rsp) = rdx; 0x004073e5 add eax, 0xc4653600 | eax += 0xc4653600; | } 0x004073ea mov dword [rsp + 8], eax | *((rsp + 8)) = eax; | label_7: 0x004073ee mov rax, 0xfffffffff0000000 | rax = 0xfffffffff0000000; 0x004073f5 lock xadd qword [r13], rax | __asm ("lock xadd qword [r13], rax"); 0x004073fb test eax, 0x1000000 | | if ((eax & 0x1000000) == 0) { 0x00407400 jne 0x40742d | 0x00407402 lea rdx, [rax - 0x10000000] | rdx = rax - 0x10000000; 0x00407409 mov rcx, rdx | rcx = rdx; 0x0040740c sar rcx, 0x1c | rcx >>= 0x1c; 0x00407410 and eax, 0xffffff | eax &= 0xffffff; 0x00407415 xor r14d, r14d | r14d = 0; 0x00407418 cmp rcx, rax | | if (rcx >= rax) { 0x0040741b jge 0x40748b | goto label_1; | } 0x0040741d mov rsi, rsp | 0x00407420 mov rdi, r13 | 0x00407423 call 0x406df0 | eax = BloombergLP::bslmt::FastPostSemaphoreImpl::timedWaitSlowPath(BloombergLP::bsls::TimeIntervalconst&,long long) (r13, rsp, rdx); | label_6: 0x00407428 mov r14d, eax | r14d = eax; 0x0040742b jmp 0x40748b | | } else { | label_4: 0x0040742d mov eax, 0x10000000 | eax = 0x10000000; 0x00407432 lock xadd qword [r13], rax | __asm ("lock xadd qword [r13], rax"); 0x00407438 mov r14d, 0xffffffff | r14d = 0xffffffff; 0x0040743e test eax, 0xffffff | | if ((eax & 0xffffff) == 0) { 0x00407443 je 0x40748b | goto label_1; | } 0x00407445 mov ecx, eax | ecx = eax; 0x00407447 and ecx, 0x1000000 | ecx &= 0x1000000; 0x0040744d test rcx, rcx | | if (rcx != 0) { 0x00407450 jne 0x40748b | goto label_1; | } 0x00407452 add rax, 0x10000000 | rax += 0x10000000; 0x00407458 and rax, 0xfffffffff0000000 | rax &= 0xfffffffff0000000; 0x0040745e cmp rax, 0x10000000 | | if (rax != 0x10000000) { 0x00407464 jne 0x40748b | goto label_1; | } 0x00407466 lea rbx, [r13 + 8] | rbx = r13 + 8; 0x0040746a mov rdi, rbx | rdi = rbx; 0x0040746d call 0x402970 | pthread_mutex_lock (); 0x00407472 mov rdi, rbx | rdi = rbx; 0x00407475 call 0x4029e0 | pthread_mutex_unlock (); 0x0040747a add r13, 0x30 | r13 += 0x30; 0x0040747e mov rdi, r13 | rdi = r13; 0x00407481 call 0x4026b0 | pthread_cond_signal (); 0x00407486 jmp 0x40748b | goto label_1; | label_5: 0x00407488 xor r14d, r14d | r14d = 0; | } | label_1: 0x0040748b mov eax, r14d | eax = r14d; 0x0040748e add rsp, 0x28 | 0x00407492 pop rbx | 0x00407493 pop r12 | 0x00407495 pop r13 | 0x00407497 pop r14 | 0x00407499 pop r15 | 0x0040749b pop rbp | 0x0040749c ret | return rax; | }