Function at 0x1400e1350
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, 0xd8
movaps xmmword [rsp + 0xc0], xmm6
mov rdi, rcx
mov rax, qword [0x14029b028]
xor rax, rsp
mov qword [rsp + 0xb8], rax
movabs r15, 0x7fffffffffffffff
mov dword [rsp + 0x74], 4
mov rbx, qword [rdx]
movabs r14, 0xaaaaaaaaaaaaaaaa
movabs r13, 0x20c49ba5e353f7cf
cmp rbx, r15
mov qword [rsp + 0x68], rdx
je 0x1400e1432
mov rsi, rdx
mov rax, qword [rdx + 8]
mov qword [rsp + 0x78], r14
test rax, rax
je 0x1400e18bc
xor ecx, ecx
cmp rbx, rax
setns cl
add rcx, r15
sub rbx, rax
cmovo rbx, rcx
lea rax, [r15 + rbx]
add rax, 2
cmp rax, 2
jb 0x1400e1411
mov rax, rbx
imul r13
mov rax, rdx
shr rax, 0x3f
sar rdx, 7
add rdx, rax
imul rax, rdx, 0x3e8
xor ecx, ecx
cmp rbx, rax
setg cl
add rcx, rdx
mov rbx, rcx
xor eax, eax
test rbx, rbx
setns al
neg eax
mov rcx, rbx
shr rcx, 0x20
cmovne ebx, eax
mov dword [rsp + 0x70], ebx
test ebx, ebx
jne 0x1400e143a
jmp 0x1400e1890
mov dword [rsp + 0x70], 0xffffffff
movabs r15, 0x4000000000000000
movabs rbx, 0xffffffffffffff
mov eax, dword [0x1402ab7ac]
mov rcx, qword gs:[0x58]
mov rax, qword [rcx + rax*8]
lea rbp, [rax + 0x190]
movaps xmm6, xmmword [0x1402724c0]
lea rsi, [rsp + 0x80]
mov rax, qword [rdi + 0x10]
mov r12, qword [rax]
mov rax, qword [r12]
mov rax, qword [rax + 0x18]
lea rcx, [0x14017ddc0]
cmp rax, rcx
jne 0x1400e195e
cmp byte [r12 + 0x128], 0
je 0x1400e152a
cmp byte [r12 + 0x130], 0
je 0x1400e1521
mov r13, qword [rbp]
test r13, r13
je 0x1400e1521
mov rax, qword [r13 + 0x10]
test rax, rax
js 0x1400e1925
cmp dword [r13 + 0x24], 1
jne 0x1400e1cab
cmp qword [r13 + 0x18], 0
jne 0x1400e1cee
mov rsi, rbp
movabs rax, 0xbfffffffffffffff
lock and qword [r13 + 0x10], rax
mov rbp, qword [r12 + 0x138]
cmp qword [r13 + 0x18], 0
jne 0x1400e1d2a
mov rax, qword [r13 + 0x10]
and rax, r15
and rbp, rbx
or rbp, rax
mov qword [r13 + 0x10], rbp
dec dword [r13 + 0x24]
mov rbp, rsi
lea rsi, [rsp + 0x80]
mov byte [r12 + 0x128], 0
mov rax, qword [r12 + 0xf0]
mov ecx, dword [rax]
lea edx, [rcx + 1]
cmp edx, 1
adc ecx, 1
mov dword [rax], ecx
mov qword [rsp + 0x90], r14
movaps xmmword [rsp + 0x80], xmm6
mov rax, qword [r12 - 0xe8]
mov byte [rsp + 0x80], 0
mov qword [rsp + 0x98], rax
add r12, 0xffffffffffffff20
mov rcx, r12
mov rdx, rsi
call fcn.1400e0f50
lea rcx, [rsp + 0x70]
call fcn.1400da320
lea rcx, [rsp + 0x74]
call fcn.1400da320
mov eax, dword [rsp + 0x74]
mov r8d, dword [rsp + 0x70]
mov dword [rsp + 0x20], eax
xor ecx, ecx
xor edx, edx
mov r9d, 0x1cff
call qword [sym.imp.USER32.dll_MsgWaitForMultipleObjectsEx]
mov ecx, eax
test eax, eax
mov dword [rsp + 0x58], eax
jne 0x1400e1b05
mov rax, qword [rdi + 0x10]
mov r12, qword [rax]
mov rax, qword [r12]
mov rax, qword [rax + 0x28]
lea rcx, [0x1400e4820]
cmp rax, rcx
jne 0x1400e196c
mov qword [rsp + 0x90], r14
movaps xmmword [rsp + 0x80], xmm6
mov rax, qword [r12 - 0xe8]
mov byte [rsp + 0x80], 0
mov qword [rsp + 0x98], rax
cmp byte [r12 + 0x128], 0
je 0x1400e16a4
cmp byte [r12 + 0x130], 0
je 0x1400e16a4
mov r13, qword [rbp]
test r13, r13
je 0x1400e16a4
mov qword [rsp + 0x60], rbp
mov rbp, rdi
mov rax, qword [r13 + 0x10]
test rax, rax
js 0x1400e194d
cmp dword [r13 + 0x24], 1
jne 0x1400e1d70
mov rsi, rbx
cmp qword [r13 + 0x18], 0
jne 0x1400e1d9a
mov rbx, r14
movabs rax, 0xbfffffffffffffff
lock and qword [r13 + 0x10], rax
mov r14, qword [r12 + 0x138]
cmp qword [r13 + 0x18], 0
jne 0x1400e1dc6
mov rax, qword [r13 + 0x10]
and rax, r15
and r14, rsi
or r14, rax
mov qword [r13 + 0x10], r14
dec dword [r13 + 0x24]
mov r14, rbx
mov rbx, rsi
mov rdi, rbp
mov rbp, qword [rsp + 0x60]
lea rsi, [rsp + 0x80]
mov qword [r12 + 0x138], 0
xor eax, eax
mov byte [r12 + 0x140], al
mov byte [r12 + 0x130], al
mov byte [r12 + 0x128], 1
mov rax, qword [r12 + 0xf0]
mov ecx, dword [rax]
lea edx, [rcx + 1]
cmp edx, 1
adc ecx, 1
mov dword [rax], ecx
lea rcx, [r12 - 0xe0]
mov rdx, rsi
call fcn.1400e0920
mov rax, qword [r12]
mov rax, qword [rax + 0x20]
lea rcx, [0x1400e3650]
cmp rax, rcx
jne 0x1400e197a
mov r13, qword [r12 - 0x10]
sub r13, qword [r12 - 0x18]
shr r13, 6
test byte [0x14029e290], 0x19
jne 0x1400e198b
mov ecx, 0x40
call qword [sym.imp.USER32.dll_GetQueueStatus]
bt eax, 0x16
jb 0x1400e177a
movaps xmmword [rsp + 0xa0], xmm6
movaps xmmword [rsp + 0x90], xmm6
movaps xmmword [rsp + 0x80], xmm6
test byte [0x14029e290], 0x19
jne 0x1400e1a34
mov dword [rsp + 0x20], 0
mov rcx, rsi
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
je 0x1400e1adc
test r12, r12
je 0x1400e1890
mov rax, qword [r12]
mov rax, qword [rax + 0x30]
lea rcx, [0x1400e4a10]
cmp rax, rcx
jne 0x1400e1a23
mov qword [rsp + 0x90], r14
movaps xmmword [rsp + 0x80], xmm6
mov rax, qword [r12 - 0xe8]
mov byte [rsp + 0x80], 0
mov qword [rsp + 0x98], rax
cmp byte [r12 + 0x128], 0
je 0x1400e183a
cmp byte [r12 + 0x130], 0
je 0x1400e183a
mov rsi, qword [rbp]
test rsi, rsi
je 0x1400e183a
mov rax, qword [rsi + 0x10]
test rax, rax
js 0x1400e1914
cmp dword [rsi + 0x24], 1
jne 0x1400e1c35
cmp qword [rsi + 0x18], 0
jne 0x1400e1c59
movabs rax, 0xbfffffffffffffff
lock and qword [rsi + 0x10], rax
mov rdi, qword [r12 + 0x138]
cmp qword [rsi + 0x18], 0
jne 0x1400e1c7f
mov rax, qword [rsi + 0x10]
and rax, r15
and rdi, rbx
or rdi, rax
mov qword [rsi + 0x10], rdi
dec dword [rsi + 0x24]
mov qword [r12 + 0x138], 0
xor eax, eax
mov byte [r12 + 0x140], al
mov byte [r12 + 0x130], al
mov byte [r12 + 0x128], 1
mov rax, qword [r12 + 0xf0]
mov ecx, dword [rax]
lea edx, [rcx + 1]
cmp edx, 1
adc ecx, 1
mov dword [rax], ecx
add r12, 0xffffffffffffff20
lea rdx, [rsp + 0x80]
mov rcx, r12
mov r8d, r13d
call fcn.1400e03e0
mov rcx, qword [rsp + 0xb8]
xor rcx, rsp
call fcn.1401874c0
movaps xmm6, xmmword [rsp + 0xc0]
add rsp, 0xd8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rax, qword [fcn.140105050]
lea rcx, [0x140182e50]
cmp rax, rcx
jne 0x1400e1936
lea r12, [rsp + 0x80]
mov qword [r12], 0
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [r12]
movabs rcx, 0x8637bd05af7
cmp rax, rcx
jge 0x1400e1e85
imul rax, rax, 0xf4240
cqo
idiv qword [0x1402b0aa0]
jmp 0x1400e13c8
mov rcx, qword [0x1402b4340]
call fcn.1401c1350
jmp 0x1400e17ef
mov rcx, qword [0x1402b4340]
call fcn.1401c1350
jmp 0x1400e14c6
lea r12, [rsp + 0x78]
mov rcx, r12
call qword [case.0x1401eda70.0]
mov rax, qword [r12]
jmp 0x1400e13c8
mov rcx, qword [0x1402b4340]
call fcn.1401c1350
jmp 0x1400e163b
mov rcx, r12
call qword [case.0x1401eda70.0]
jmp 0x1400e1579
mov rcx, r12
call qword [case.0x1401eda70.0]
jmp 0x1400e16f0
mov rcx, r12
call qword [case.0x1401eda70.0]
mov r13d, eax
jmp 0x1400e1716
mov qword [rsp + 0x60], rbp
mov rcx, rsi
call fcn.140105050
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov qword [rsp + 0x38], rsi
mov dword [rsp + 0x30], eax
xorps xmm0, xmm0
movups xmmword [rsp + 0x20], xmm0
mov dword [rsp + 0x48], 0
mov qword [rsp + 0x40], 0
lea rdx, [0x14029e290]
lea r8, str.MessagePumpForUI::WaitForWork_GetQueueStatus
mov cl, 0x58
xor r9d, r9d
call fcn.1401589f0
mov rsi, rax
mov ecx, 0x40
call qword [sym.imp.USER32.dll_GetQueueStatus]
mov ebp, eax
cmp byte [0x14029e290], 0
je 0x1400e1a07
lea rcx, [0x14029e290]
lea rdx, str.MessagePumpForUI::WaitForWork_GetQueueStatus
mov r8, rsi
call fcn.140143910
bt ebp, 0x16
mov rbp, qword [rsp + 0x60]
lea rsi, [rsp + 0x80]
jae 0x1400e1734
jmp 0x1400e177a
mov rcx, r12
mov edx, r13d
call qword [case.0x1401eda70.0]
jmp 0x1400e1890
lea rsi, [rsp + 0x78]
mov rcx, rsi
call fcn.140105050
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
xor r14d, r14d
mov dword [rsp + 0x48], r14d
mov qword [rsp + 0x38], rsi
mov dword [rsp + 0x30], eax
xorps xmm0, xmm0
movups xmmword [rsp + 0x20], xmm0
mov qword [rsp + 0x40], 0
lea rdx, [0x14029e290]
lea r8, str.MessagePumpForUI::WaitForWork_PeekMessage
mov cl, 0x58
xor r9d, r9d
call fcn.1401589f0
mov rsi, rax
mov dword [rsp + 0x20], r14d
lea rcx, [rsp + 0x80]
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.USER32.dll_PeekMessageW]
mov r14d, eax
cmp byte [0x14029e290], 0
je 0x1400e1ac1
lea rcx, [0x14029e290]
lea rdx, str.MessagePumpForUI::WaitForWork_PeekMessage
mov r8, rsi
call fcn.140143910
test r14d, r14d
movabs r14, 0xaaaaaaaaaaaaaaaa
lea rsi, [rsp + 0x80]
jne 0x1400e177a
mov dword [rsp + 0x74], 0
test r12, r12
mov ecx, dword [rsp + 0x58]
je 0x1400e1b05
mov rax, qword [r12]
mov rax, qword [rax + 0x30]
mov rcx, r12
mov edx, r13d
call qword [case.0x1401eda70.0]
mov ecx, dword [rsp + 0x58]
mov r13, rbx
mov rax, qword [rsp + 0x68]
mov r12, qword [rax]
movabs rbx, 0x7fffffffffffffff
cmp r12, rbx
je 0x1400e1bfd
mov qword [rsp + 0x78], r14
mov rax, qword [fcn.140105050]
lea rcx, [0x140182e50]
cmp rax, rcx
jne 0x1400e1c15
mov qword [rsp + 0x80], 0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rsp + 0x80]
movabs rcx, 0x8637bd05af7
cmp rax, rcx
jge 0x1400e1e12
imul rax, rax, 0xf4240
cqo
idiv qword [0x1402b0aa0]
xor ecx, ecx
cmp r12, rax
setns cl
add rcx, rbx
sub r12, rax
cmovo r12, rcx
lea rax, [rbx + r12]
add rax, 2
cmp rax, 2
jb 0x1400e1bd2
mov rax, r12
movabs rcx, 0x20c49ba5e353f7cf
imul rcx
mov rax, rdx
shr rax, 0x3f
sar rdx, 7
add rdx, rax
imul rax, rdx, 0x3e8
xor ecx, ecx
cmp r12, rax
setg cl
add rcx, rdx
mov r12, rcx
mov rbx, r13
xor eax, eax
test r12, r12
setns al
neg eax
mov rcx, r12
shr rcx, 0x20
cmovne r12d, eax
mov dword [rsp + 0x70], r12d
test r12d, r12d
mov ecx, dword [rsp + 0x58]
jne 0x1400e1c08
jmp 0x1400e1890
mov dword [rsp + 0x70], 0xffffffff
mov rbx, r13
test ecx, ecx
je 0x1400e1477
jmp 0x1400e1579
lea rbx, [rsp + 0x78]
mov rcx, rbx
call qword [case.0x1401eda70.0]
mov rax, qword [rbx]
movabs rbx, 0x7fffffffffffffff
jmp 0x1400e1b7f
cmp byte [r12 + 0x140], 0
je 0x1400e1813
cmp qword [rsi + 0x18], 0
jne 0x1400e1dec
lock or qword [rsi + 0x10], r15
jmp 0x1400e1813
lea rcx, [rsi + 0x18]
mov rdi, qword [rsi + 0x10]
call fcn.1401c13a0
movabs rcx, 0xff00000000000000
and rcx, rdi
or rcx, rax
mov qword [rsi + 0x10], rcx
jmp 0x1400e1804
lea rcx, [rsi + 0x18]
mov r14, rbx
mov rbx, qword [rsi + 0x10]
call fcn.1401c13a0
movabs rcx, 0xff00000000000000
and rcx, rbx
mov rbx, r14
or rcx, rax
mov qword [rsi + 0x10], rcx
jmp 0x1400e1826
mov rsi, rbp
cmp byte [r12 + 0x140], 0
je 0x1400e14ee
mov rbp, r15
mov qword [rsp + 0x58], rdi
mov r15, rbx
mov rbx, r14
cmp qword [r13 + 0x18], 0
jne 0x1400e1e39
lock or qword [r13 + 0x10], rbp
mov r14, rbx
mov rbx, r15
mov rdi, qword [rsp + 0x58]
mov r15, rbp
jmp 0x1400e14ee
lea rcx, [r13 + 0x18]
mov qword [rsp + 0x60], rbp
mov rsi, rbx
mov rbx, r14
mov r14, qword [r13 + 0x10]
call fcn.1401c13a0
movabs rcx, 0xff00000000000000
and rcx, r14
mov r14, rbx
mov rbx, rsi
mov rbp, qword [rsp + 0x60]
or rcx, rax
mov qword [r13 + 0x10], rcx
jmp 0x1400e14dc
lea rcx, [r13 + 0x18]
mov qword [rsp + 0x58], rdi
mov r15, rbx
mov rbx, r14
mov r14, qword [r13 + 0x10]
call fcn.1401c13a0
movabs rcx, 0xff00000000000000
and rcx, r14
mov r14, rbx
mov rbx, r15
mov rdi, qword [rsp + 0x58]
movabs r15, 0x4000000000000000
or rcx, rax
mov qword [r13 + 0x10], rcx
jmp 0x1400e1501
mov rsi, rbx
mov rbx, r14
cmp byte [r12 + 0x140], 0
je 0x1400e1666
cmp qword [r13 + 0x18], 0
jne 0x1400e1e5f
lock or qword [r13 + 0x10], r15
jmp 0x1400e1666
lea rcx, [r13 + 0x18]
mov rbx, r14
mov r14, qword [r13 + 0x10]
call fcn.1401c13a0
movabs rcx, 0xff00000000000000
and rcx, r14
mov r14, rbx
or rcx, rax
mov qword [r13 + 0x10], rcx
jmp 0x1400e1654
lea rcx, [r13 + 0x18]
mov rdi, qword [r13 + 0x10]
call fcn.1401c13a0
movabs rcx, 0xff00000000000000
and rcx, rdi
or rcx, rax
mov qword [r13 + 0x10], rcx
jmp 0x1400e1679
lea rcx, [rsi + 0x18]
mov rdi, qword [rsi + 0x10]
call fcn.1401c13a0
movabs rcx, 0xff00000000000000
and rcx, rdi
or rcx, rax
mov qword [rsi + 0x10], rcx
jmp 0x1400e1c4f
mov rcx, qword [0x1402b0aa0]
cqo
idiv rcx
imul r8, rax, 0xf4240
imul rax, rdx, 0xf4240
cqo
idiv rcx
add rax, r8
jmp 0x1400e1b7f
lea rcx, [r13 + 0x18]
mov r14, qword [r13 + 0x10]
call fcn.1401c13a0
movabs rcx, 0xff00000000000000
and rcx, r14
or rcx, rax
mov qword [r13 + 0x10], rcx
jmp 0x1400e1cd6
lea rcx, [r13 + 0x18]
mov r14, qword [r13 + 0x10]
call fcn.1401c13a0
movabs rcx, 0xff00000000000000
and rcx, r14
or rcx, rax
mov qword [r13 + 0x10], rcx
jmp 0x1400e1d90
mov rcx, qword [0x1402b0aa0]
cqo
idiv rcx
imul r8, rax, 0xf4240
imul rax, rdx, 0xf4240
cqo
idiv rcx
add rax, r8
jmp 0x1400e13c8