; assembly | /* r2dec pseudo code output */ | /* bslmt_fastpostsemaphore.t/assume @ 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 0x407330 | 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 0x40746c | 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 cmp dword [r13 + 0x60], 1 | | if (*((r13 + 0x60)) == 1) { 0x00407275 jne 0x407280 | 0x00407277 call 0x422180 | BloombergLP::bsls::SystemTime::nowMonotonicClock() (); 0x0040727c jmp 0x407285 | | } else { 0x00407280 call 0x422210 | rax = BloombergLP::bsls::SystemTime::nowRealtimeClock() (); | } 0x00407285 mov qword [rsp + 0x18], rax | *((rsp + 0x18)) = rax; 0x0040728a mov dword [rsp + 0x20], edx | *((rsp + 0x20)) = edx; 0x0040728e mov rcx, qword [rbp] | rcx = *(rbp); 0x00407292 sub rcx, rbx | rcx -= rbx; 0x00407295 mov rax, rcx | rax = rcx; 0x00407298 imul r14 | rdx:rax = rax * r14; 0x0040729b mov rax, rdx | rax = rdx; 0x0040729e shr rax, 0x3f | rax >>= 0x3f; 0x004072a2 sar rdx, 0x12 | rdx >>= 0x12; 0x004072a6 add rdx, rax | rdx += rax; 0x004072a9 imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x004072af add ecx, eax | ecx += eax; 0x004072b1 imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x004072b7 mov rdi, r15 | 0x004072ba mov rsi, rdx | 0x004072bd mov edx, eax | 0x004072bf call 0x422330 | rax = BloombergLP::bsls::TimeInterval::addInterval(long long,int) (r15, rdx, eax); 0x004072c4 movups xmm0, xmmword [rax] | __asm ("movups xmm0, xmmword [rax]"); 0x004072c7 movaps xmmword [rsp], xmm0 | *(rsp) = xmm0; 0x004072cb mov rax, 0xfffffffff0000000 | rax = 0xfffffffff0000000; 0x004072d2 lock xadd qword [r13], rax | __asm ("lock xadd qword [r13], rax"); 0x004072d8 test eax, 0x1000000 | | if ((eax & 0x1000000) != 0) { 0x004072dd jne 0x40740e | goto label_2; | } 0x004072e3 lea rdx, [rax - 0x10000000] | rdx = rax - 0x10000000; 0x004072ea mov rcx, rdx | rcx = rdx; 0x004072ed sar rcx, 0x1c | rcx >>= 0x1c; 0x004072f1 and eax, 0xffffff | eax &= 0xffffff; 0x004072f6 cmp rcx, rax | | if (rcx >= rax) { 0x004072f9 jge 0x407469 | goto label_3; | } 0x004072ff mov rdi, r13 | 0x00407302 mov rsi, r12 | 0x00407305 call 0x406df0 | eax = BloombergLP::bslmt::FastPostSemaphoreImpl::timedWaitSlowPath(BloombergLP::bsls::TimeIntervalconst&,long long) (r13, r12, rdx); 0x0040730a cmp eax, 0xfffffffe | | if (eax != 0xfffffffe) { 0x0040730d jne 0x407409 | goto label_4; | } 0x00407313 call 0x402920 | rax = std::_1::chrono::system_clock::now() (); 0x00407318 mov rbx, rax | rbx = rax; 0x0040731b cmp rax, qword [rbp] | 0x0040731f jl 0x407270 | | } while (rax < *(rbp)); 0x00407325 mov r14d, 0xfffffffe | r14d = 0xfffffffe; 0x0040732b jmp 0x40746c | goto label_1; | label_0: 0x00407330 mov rcx, qword [rbp] | rcx = *(rbp); 0x00407334 movabs rdx, 0x431bde82d7b634db | rdx = 0x431bde82d7b634db; 0x0040733e mov rax, rcx | rax = rcx; 0x00407341 imul rdx | rdx:rax = rax * rdx; 0x00407344 mov rax, rdx | rax = rdx; 0x00407347 shr rax, 0x3f | rax >>= 0x3f; 0x0040734b sar rdx, 0x12 | rdx >>= 0x12; 0x0040734f add rdx, rax | rdx += rax; 0x00407352 imul eax, edx, 0xfff0bdc0 | eax = edx * 0xfff0bdc0; 0x00407358 add ecx, eax | ecx += eax; 0x0040735a imul eax, ecx, 0x3e8 | eax = ecx * 0x3e8; 0x00407360 mov qword [rsp], rdx | *(rsp) = rdx; 0x00407364 lea ecx, [rax + 0x3b9ac9ff] | ecx = rax + 0x3b9ac9ff; 0x0040736a cmp ecx, 0x773593ff | | if (ecx >= 0x773593ff) { 0x00407370 jb 0x40739b | 0x00407372 movsxd rcx, eax | rcx = (int64_t) eax; 0x00407375 imul rcx, rcx, 0x44b82fa1 | rcx *= 0x44b82fa1; 0x0040737c mov rsi, rcx | rsi = rcx; 0x0040737f shr rsi, 0x3f | rsi >>= 0x3f; 0x00407383 sar rcx, 0x3c | rcx >>= 0x3c; 0x00407387 add ecx, esi | ecx += esi; 0x00407389 movsxd rcx, ecx | rcx = (int64_t) ecx; 0x0040738c add rdx, rcx | rdx += rcx; 0x0040738f mov qword [rsp], rdx | *(rsp) = rdx; 0x00407393 imul ecx, ecx, 0x3b9aca00 | ecx *= 0x3b9aca00; 0x00407399 sub eax, ecx | eax -= ecx; | } 0x0040739b mov dword [rsp + 8], eax | *((rsp + 8)) = eax; 0x0040739f test rdx, rdx | | if (rdx > 0) { 0x004073a2 jle 0x4073b6 | 0x004073a4 test eax, eax | | if (eax >= 0) { 0x004073a6 jns 0x4073cf | goto label_5; | } 0x004073a8 dec rdx | rdx--; 0x004073ab mov qword [rsp], rdx | *(rsp) = rdx; 0x004073af add eax, 0x3b9aca00 | eax += 0x3b9aca00; 0x004073b4 jmp 0x4073cb | | } else { 0x004073b6 test eax, eax | | if (eax <= 0) { 0x004073b8 jle 0x4073cf | goto label_5; | } 0x004073ba test rdx, rdx | | if (rdx == 0) { 0x004073bd je 0x4073cf | goto label_5; | } 0x004073bf inc rdx | rdx++; 0x004073c2 mov qword [rsp], rdx | *(rsp) = rdx; 0x004073c6 add eax, 0xc4653600 | eax += 0xc4653600; | } 0x004073cb mov dword [rsp + 8], eax | *((rsp + 8)) = eax; | label_5: 0x004073cf mov rax, 0xfffffffff0000000 | rax = 0xfffffffff0000000; 0x004073d6 lock xadd qword [r13], rax | __asm ("lock xadd qword [r13], rax"); 0x004073dc test eax, 0x1000000 | | if ((eax & 0x1000000) == 0) { 0x004073e1 jne 0x40740e | 0x004073e3 lea rdx, [rax - 0x10000000] | rdx = rax - 0x10000000; 0x004073ea mov rcx, rdx | rcx = rdx; 0x004073ed sar rcx, 0x1c | rcx >>= 0x1c; 0x004073f1 and eax, 0xffffff | eax &= 0xffffff; 0x004073f6 xor r14d, r14d | r14d = 0; 0x004073f9 cmp rcx, rax | | if (rcx >= rax) { 0x004073fc jge 0x40746c | goto label_1; | } 0x004073fe mov rsi, rsp | 0x00407401 mov rdi, r13 | 0x00407404 call 0x406df0 | eax = BloombergLP::bslmt::FastPostSemaphoreImpl::timedWaitSlowPath(BloombergLP::bsls::TimeIntervalconst&,long long) (r13, rsp, rdx); | label_4: 0x00407409 mov r14d, eax | r14d = eax; 0x0040740c jmp 0x40746c | | } else { | label_2: 0x0040740e mov eax, 0x10000000 | eax = 0x10000000; 0x00407413 lock xadd qword [r13], rax | __asm ("lock xadd qword [r13], rax"); 0x00407419 mov r14d, 0xffffffff | r14d = 0xffffffff; 0x0040741f test eax, 0xffffff | | if ((eax & 0xffffff) == 0) { 0x00407424 je 0x40746c | goto label_1; | } 0x00407426 mov ecx, eax | ecx = eax; 0x00407428 and ecx, 0x1000000 | ecx &= 0x1000000; 0x0040742e test rcx, rcx | | if (rcx != 0) { 0x00407431 jne 0x40746c | goto label_1; | } 0x00407433 add rax, 0x10000000 | rax += 0x10000000; 0x00407439 and rax, 0xfffffffff0000000 | rax &= 0xfffffffff0000000; 0x0040743f cmp rax, 0x10000000 | | if (rax != 0x10000000) { 0x00407445 jne 0x40746c | goto label_1; | } 0x00407447 lea rbx, [r13 + 8] | rbx = r13 + 8; 0x0040744b mov rdi, rbx | rdi = rbx; 0x0040744e call 0x402970 | pthread_mutex_lock (); 0x00407453 mov rdi, rbx | rdi = rbx; 0x00407456 call 0x4029e0 | pthread_mutex_unlock (); 0x0040745b add r13, 0x30 | r13 += 0x30; 0x0040745f mov rdi, r13 | rdi = r13; 0x00407462 call 0x4026b0 | pthread_cond_signal (); 0x00407467 jmp 0x40746c | goto label_1; | label_3: 0x00407469 xor r14d, r14d | r14d = 0; | } | label_1: 0x0040746c mov eax, r14d | eax = r14d; 0x0040746f add rsp, 0x28 | 0x00407473 pop rbx | 0x00407474 pop r12 | 0x00407476 pop r13 | 0x00407478 pop r14 | 0x0040747a pop r15 | 0x0040747c pop rbp | 0x0040747d ret | return rax; | }