Function at 0x140058b50
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
push rsi
sub rsp, 0x20
mov rcx, qword [rcx]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov esi, eax
test eax, eax
jne 0x140057dd1
test esi, esi
sete al
add rsp, 0x20
pop rsi
ret
cmp esi, 0x102
je 0x140057dc6
mov ecx, esi
call fcn.1400f9030
jmp 0x140057dc6
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xb8
mov rsi, rcx
mov rax, qword [0x140140040]
xor rax, rsp
mov qword [rsp + 0xb0], rax
test rdx, rdx
jle 0x140058e17
mov rdi, rdx
movaps xmm0, xmmword [0x14011ea30]
movaps xmmword [rsp + 0x50], xmm0
movabs rax, 0xaaaaaaaaaaaaaaaa
mov qword [rsp + 0x90], rax
movaps xmmword [rsp + 0x80], xmm0
movaps xmmword [rsp + 0x70], xmm0
movaps xmmword [rsp + 0x60], xmm0
xor eax, eax
mov byte [rsp + 0x50], al
mov byte [rsp + 0x90], al
cmp byte [rsi + 8], al
je 0x140058d12
movabs r12, 0x7fffffffffffffff
movabs r13, 0x8637bd05af7
cmp rdi, r12
je 0x140058ce3
mov rax, qword [0x1401425c0]
lea rcx, [0x140094330]
cmp rax, rcx
jne 0x140058de9
lea rbx, [rsp + 0x30]
mov qword [rbx], 0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rbx]
cmp rax, r13
jge 0x140058e59
imul rax, rax, 0xf4240
cqo
idiv qword [0x140151bd8]
mov rbx, rax
lea rax, [rbx + rdi]
sar rax, 0x3f
btc rax, 0x3f
add rbx, rdi
cmovo rbx, rax
mov rbp, qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r14, qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
movabs r15, 0x20c49ba5e353f7cf
mov rcx, rdi
mov edx, 0xffffffff
cmp rcx, r12
je 0x140058c9d
mov rax, rcx
shr rax, 3
mul r15
mov rax, rdx
shr rax, 4
imul rdx, rax, 0x3e8
cmp rdx, rcx
adc rax, 0
mov rcx, rax
shr rcx, 0x20
neg rcx
mov edx, 0
sbb edx, edx
or edx, eax
mov rcx, qword [rsi]
call rbp
test eax, eax
jne 0x140058d7a
mov dil, 1
cmp byte [rsi + 8], 0
je 0x140058cf7
cmp byte [rsp + 0x90], 0
jne 0x140058ceb
mov rcx, qword [rsp + 0xb0]
xor rcx, rsp
call fcn.1400a4d90
mov eax, edi
add rsp, 0xb8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rbx, r12
jmp 0x140058c46
lea rcx, [rsp + 0x50]
call fcn.140058f60
jmp 0x140058cbd
mov qword [rsp + 0xa0], 0x164
mov al, byte [0x1401519c4]
test al, al
je 0x140058cb3
jmp 0x140058eb5
lea rdx, str.TimedWait
lea r8, str....._base_synchronizationwaitable_event.cc
lea rbx, [rsp + 0x30]
mov rcx, rbx
mov r9d, 0x24
call fcn.140058f40
cmp byte [rsp + 0x90], 0
jne 0x140058e42
lea rcx, [rsp + 0x50]
xor edx, edx
mov r8d, 1
call fcn.14005ad50
mov qword [rsp + 0x98], 0xa
mov al, byte [0x14015186a]
test al, al
jne 0x140058e83
mov byte [rsp + 0x90], 1
jmp 0x140058bca
cmp eax, 0x102
jne 0x140058ef8
mov rax, qword [0x1401425c0]
lea rcx, [0x140094330]
cmp rax, rcx
jne 0x140058e02
mov qword [rsp + 0x30], 0
lea rcx, [rsp + 0x30]
call r14
mov rax, qword [rsp + 0x30]
cmp rax, r13
jge 0x140058f0d
imul rax, rax, 0xf4240
cqo
idiv qword [0x140151bd8]
xor edx, edx
cmp rbx, rax
setns dl
add rdx, r12
mov rcx, rbx
sub rcx, rax
cmovo rcx, rdx
jg 0x140058c61
xor edi, edi
jmp 0x140058cb3
lea rbx, [rsp + 0xa8]
mov rcx, rbx
call qword [0x140134870]
mov rbx, qword [rbx]
jmp 0x140058c32
lea rcx, [rsp + 0x30]
call qword [0x140134870]
lea rax, [rsp + 0x30]
mov rax, qword [rax]
jmp 0x140058dc7
mov rcx, qword [rsp + 0xb0]
xor rcx, rsp
call fcn.1400a4d90
mov rcx, rsi
add rsp, 0xb8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
jmp 0x140057db0
lea r14, [rsp + 0x50]
mov rcx, r14
call fcn.140058f60
mov byte [r14 + 0x40], 0
jmp 0x140058d41
mov rcx, qword [0x140151bd8]
cqo
idiv rcx
imul r8, rax, 0xf4240
imul rax, rdx, 0xf4240
cqo
idiv rcx
mov rbx, rax
add rbx, r8
jmp 0x140058c32
movzx ecx, al
lea r9, [rsp + 0xa8]
mov qword [r9], rbx
lea rax, str.ScopedBlockingCallWithBaseSyncPrimitives
lea r8, [rsp + 0xa0]
mov qword [r8], rax
lea rdx, [rsp + 0x98]
call fcn.1400f8690
jmp 0x140058d6d
movzx ecx, al
xor rsi, qword [0x14014fe00]
mov qword [rsp + 0x30], rsi
lea rax, str.WaitableEvent::Wait_Complete
lea r8, [rsp + 0xa8]
mov qword [r8], rax
lea rax, [rsp + 0x30]
mov qword [rsp + 0x20], rax
lea rdx, [rsp + 0xa0]
mov r9d, 3
call fcn.1400886b0
jmp 0x140058cb3
cmp rdi, r12
jne 0x140058d85
mov ecx, eax
call fcn.1400f9030
jmp 0x140058d85
mov rcx, qword [0x140151bd8]
cqo
idiv rcx
imul r8, rax, 0xf4240
imul rax, rdx, 0xf4240
cqo
idiv rcx
add rax, r8
jmp 0x140058dc7