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

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xb8
mov rax, qword [0x140145040]
xor rax, rsp
mov qword [rsp + 0xb0], rax
lea r15, [rcx + 8]
test rdx, rdx
jle 0x1400860c8
mov rdi, rdx
mov rsi, rcx
movaps xmm0, xmmword [0x1401213c0]
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 [rcx + 0x10], al
je 0x140085e90
movabs r14, 0x7fffffffffffffff
movabs r12, 0x8637bd05af7
cmp rdi, r14
je 0x140085deb
mov rax, qword [0x140147780]
lea rcx, [0x1400b3080]
cmp rax, rcx
jne 0x1400860a5
lea rbx, [rsp + 0x30]
mov qword [rbx], 0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rbx]
mov rcx, qword [0x140157648]
cmp rax, r12
jge 0x1400860de
imul rax, rax, 0xf4240
cqo
idiv rcx
mov qword [rsp + 0xa8], rax
mov r13, qword [rsp + 0xa8]
lea rax, [rdi + r13]
sar rax, 0x3f
btc rax, 0x3f
add r13, rdi
cmovo r13, rax
mov rbp, qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
movabs rbx, 0x20c49ba5e353f7cf
cmp rdi, r14
je 0x140085de4
mov rax, rdi
shr rax, 3
mul rbx
mov rax, rdx
shr rax, 4
imul rcx, rax, 0x3e8
cmp rcx, rdi
adc rax, 0
mov rcx, rax
shr rcx, 0x20
neg rcx
mov edx, 0
sbb edx, edx
or edx, eax
mov rcx, qword [r15]
call rbp
test eax, eax
jne 0x140085e1a
mov dil, 1
cmp byte [rsi + 0x10], 0
je 0x140085dff
cmp byte [rsp + 0x90], 0
jne 0x140085df3
mov rcx, qword [rsp + 0xb0]
xor rcx, rsp
call fcn.1400b7310
mov eax, edi
add rsp, 0xb8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov edx, 0xffffffff
jmp 0x140085da2
mov r13, r14
jmp 0x140085d5a
lea rcx, [rsp + 0x50]
call fcn.140077b10
jmp 0x140085dbe
mov qword [rsp + 0xa0], 0x9b
mov al, byte [0x1401576eb]
test al, al
je 0x140085db4
jmp 0x140086115
mov rax, qword [0x140147780]
lea rcx, [0x1400b3080]
cmp rax, rcx
jne 0x1400860b8
mov qword [rsp + 0x30], 0
lea rcx, [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rsp + 0x30]
mov rcx, qword [0x140157648]
cmp rax, r12
jge 0x140086158
imul rax, rax, 0xf4240
cqo
idiv rcx
mov qword [rsp + 0x30], rax
mov rax, qword [rsp + 0x30]
xor ecx, ecx
cmp r13, rax
setns cl
add rcx, r14
mov rdi, r13
sub rdi, rax
cmovo rdi, rcx
jg 0x140085d6b
jmp 0x140086055
lea rdx, str.TimedWait
lea r8, str....._base_synchronizationwaitable_event.cc
lea rbx, [rsp + 0x30]
mov rcx, rbx
mov r9d, 0x24
call fcn.1400754d0
cmp byte [rsp + 0x90], 0
jne 0x1400860fe
mov eax, dword [0x140153d98]
mov rcx, qword gs:[0x58]
mov rax, qword [rcx + rax*8]
mov r14, qword [rax + 0x140]
mov rax, qword [0x140147c20]
and rax, r14
cmp rax, qword [0x140147c08]
jne 0x140085ef4
mov rcx, r14
call fcn.140086860
mov qword [rsp + 0x50], r14
mov eax, dword [0x140153d98]
mov rcx, qword gs:[0x58]
mov rax, qword [rcx + rax*8]
lea r12, [rax + 0x148]
mov r14, qword [r12]
mov rax, qword [0x140147c20]
and rax, r14
cmp rax, qword [0x140147c08]
jne 0x140085f32
mov rcx, r14
call fcn.140086860
lea rax, [rsp + 0x50]
mov qword [rax + 8], r14
mov qword [rax + 0x10], r12
mov rcx, qword [r12]
mov qword [r12], rax
mov qword [rax + 0x18], rcx
mov rax, qword [rax + 8]
test rax, rax
je 0x140085fbc
mov al, byte [rax + 0x20]
mov byte [rsp + 0x70], al
xor eax, eax
mov byte [rsp + 0x78], al
mov byte [rsp + 0x88], al
mov ecx, dword [0x140153d98]
mov rdx, qword gs:[0x58]
mov rcx, qword [rdx + rcx*8]
cmp byte [rcx + 0x168], al
je 0x140085fc0
mov rax, qword [rsp + 0x58]
test rax, rax
je 0x140085fea
cmp byte [rax + 0x38], 0
je 0x140085fea
mov r14, qword [rax + 0x30]
mov qword [rax + 0x30], 0
test r14, r14
je 0x140085fea
lock dec dword [r14]
jne 0x140085fea
mov rcx, r14
call fcn.14000c830
mov rcx, r14
call fcn.1400b4d44
jmp 0x140085fea
xor eax, eax
jmp 0x140085f57
mov eax, dword [0x14015aa4c]
mov ecx, dword [0x140153d98]
mov rdx, qword gs:[0x58]
mov rcx, qword [rdx + rcx*8]
cmp eax, dword [rcx + 4]
jg 0x14008605c
cmp byte [0x14015aa48], 0
je 0x140085f83
mov rcx, qword [rsp + 0x50]
test rcx, rcx
je 0x140086003
cmp qword [rsp + 0x58], 0
jne 0x140086003
xor edx, edx
call fcn.140078570
mov qword [rsp + 0x98], 0xa
mov al, byte [0x14015765a]
test al, al
jne 0x140086026
mov byte [rsp + 0x90], 1
jmp 0x140085cce
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.140012110
jmp 0x140086019
xor edi, edi
jmp 0x140085db4
lea rcx, [0x14015aa4c]
call fcn.1400b4df4
cmp dword [0x14015aa4c], 0xffffffff
jne 0x140085fe1
mov rcx, qword [0x140156d40]
test rcx, rcx
je 0x14008608d
lea rdx, str.enable_background_thread_pool
call fcn.14000c8e0
mov byte [0x14015aa48], 1
lea rcx, [0x14015aa4c]
call fcn.1400b4d88
jmp 0x140085fe1
lea rcx, [rsp + 0xa8]
call qword [0x14013a9a8]
jmp 0x140085d3e
lea rcx, [rsp + 0x30]
call qword [0x14013a9a8]
jmp 0x140085e6b
mov rcx, qword [r15]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
sete dil
jmp 0x140085dbe
cqo
idiv rcx
imul r8, rax, 0xf4240
imul rax, rdx, 0xf4240
cqo
idiv rcx
add rax, r8
jmp 0x140085d36
lea r14, [rsp + 0x50]
mov rcx, r14
call fcn.140077b10
mov byte [r14 + 0x40], 0
jmp 0x140085ebf
movzx ecx, al
xor r15, qword [0x1401552b0]
mov qword [rsp + 0x30], r15
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.14008bf10
jmp 0x140085db4
cqo
idiv rcx
imul r8, rax, 0xf4240
imul rax, rdx, 0xf4240
cqo
idiv rcx
add rax, r8
jmp 0x140085e66