Function at 0x1400d2480
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, 0xc8
movaps xmmword [rsp + 0xb0], xmm6
mov rsi, rdx
mov rdi, rcx
mov rax, qword [0x1401ff028]
xor rax, rsp
mov qword [rsp + 0xa8], rax
movabs r13, 0x7fffffffffffffff
mov dword [rsp + 0x9c], 4
mov dword [rsp + 0x98], 0xaaaaaaaa
mov rbx, qword [rdx]
movabs r15, 0xaaaaaaaaaaaaaaaa
movabs rbp, 0x20c49ba5e353f7cf
cmp rbx, r13
je 0x1400d2561
mov rax, qword [rsi + 8]
mov qword [rsp + 0xa0], r15
test rax, rax
je 0x1400d2731
sub rbx, rax
lea rax, [rbx + r13]
add rax, 2
cmp rax, 2
jb 0x1400d253e
mov rax, rbx
imul rbp
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
mov rax, rbx
sar rax, 0x3f
not eax
mov rcx, rbx
shr rcx, 0x20
cmovne ebx, eax
mov dword [rsp + 0x98], ebx
test ebx, ebx
jne 0x1400d256c
jmp 0x1400d2705
mov dword [rsp + 0x98], 0xffffffff
lea rcx, [0x1401029f0]
mov ebp, 1
lea rdx, [rsp + 0x98]
movaps xmm6, xmmword [0x1401d8770]
mov rax, qword [rdi + 0x10]
mov rbx, qword [rax]
mov rax, qword [rbx]
mov rax, qword [rax + 0x18]
mov r12, rcx
cmp rax, rcx
jne 0x1400d2799
mov rax, qword [rbx + 0x118]
mov ecx, dword [rax]
inc ecx
cmove ecx, ebp
mov dword [rax], ecx
cmp byte [rbx + 0x148], 0
jne 0x1400d27a9
mov rax, qword [rbx + 0xa8]
cmp qword [rbx + 0xa0], rax
je 0x1400d25f2
mov ecx, dword [rax - 4]
cmp ecx, 2
je 0x1400d27c7
mov dword [rax - 4], 0
test ecx, ecx
je 0x1400d25f2
test byte [0x140200f70], 0x19
jne 0x1400d2a74
mov r14, rdx
mov rcx, rdx
call fcn.1400c4160
lea rcx, [rsp + 0x9c]
call fcn.1400c4160
mov eax, dword [rsp + 0x9c]
mov r8d, dword [rsp + 0x98]
mov dword [rsp + 0x20], eax
xor ecx, ecx
xor edx, edx
mov r9d, 0x1cff
call qword [sym.imp.USER32.dll_MsgWaitForMultipleObjectsEx]
test eax, eax
jne 0x1400d2977
mov rax, qword [rdi + 0x10]
mov rbx, qword [rax]
mov rax, qword [rbx]
mov rax, qword [rax + 0x20]
lea rcx, [0x1400d3a30]
cmp rax, rcx
jne 0x1400d27ec
mov rax, qword [rbx + 0x118]
mov ecx, dword [rax]
inc ecx
cmove ecx, ebp
mov dword [rax], ecx
mov rax, qword [rbx + 0xa8]
cmp qword [rbx + 0xa0], rax
je 0x1400d2697
mov ecx, dword [rax - 4]
cmp ecx, 2
je 0x1400d27f6
mov dword [rax - 4], 2
test ecx, ecx
jne 0x1400d2697
test byte [0x140200f70], 0x19
jne 0x1400d2ad4
test byte [0x140201830], 0x19
jne 0x1400d2812
mov ecx, 0x40
call qword [sym.imp.USER32.dll_GetQueueStatus]
bt eax, 0x16
jb 0x1400d26f7
movaps xmmword [rsp + 0x80], xmm6
movaps xmmword [rsp + 0x70], xmm6
movaps xmmword [rsp + 0x60], xmm6
test byte [0x140201830], 0x19
jne 0x1400d28b3
mov dword [rsp + 0x20], 0
lea rcx, [rsp + 0x60]
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
je 0x1400d295e
test rbx, rbx
je 0x1400d2705
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x28]
mov rcx, qword [rsp + 0xa8]
xor rcx, rsp
call fcn.140106510
movaps xmm6, xmmword [rsp + 0xb0]
add rsp, 0xc8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rax, qword [fcn.1400f9c10]
lea rcx, [0x140103600]
cmp rax, rcx
jne 0x1400d2784
lea r14, [rsp + 0x60]
mov qword [r14], 0
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [r14]
movabs rcx, 0x8637bd05af7
cmp rax, rcx
jge 0x1400d2b5b
imul rax, rax, 0xf4240
cqo
idiv qword [0x1402070a0]
jmp 0x1400d2504
lea r14, [rsp + 0xa0]
mov rcx, r14
call rax
mov rax, qword [r14]
jmp 0x1400d2504
mov rcx, rbx
mov rbx, rdx
call rax
mov rdx, rbx
jmp 0x1400d25f2
lea rcx, [rbx + 0x150]
mov r14, rdx
call fcn.1400d3c30
mov rdx, r14
mov byte [rbx + 0x148], 0
jmp 0x1400d25be
add rbx, 0xa0
mov r14, rdx
lea rdx, [rsp + 0x60]
mov dword [rdx], 0
mov rcx, rbx
call fcn.1401758d0
mov rdx, r14
jmp 0x1400d25f2
mov rcx, rbx
call rax
jmp 0x1400d2697
lea rcx, [rbx + 0xa0]
lea rdx, [rsp + 0x60]
mov dword [rdx], 2
call fcn.1401758d0
jmp 0x1400d2697
call sub.KERNEL32.dll_GetCurrentThreadId
mov dword [rsp + 0x54], eax
mov qword [rsp + 0x60], r15
lea rcx, [rsp + 0x60]
call fcn.1400f9c10
lea rax, [rsp + 0x60]
mov qword [rsp + 0x38], rax
mov eax, dword [rsp + 0x54]
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, [0x140201830]
lea r8, str.MessagePumpForUI::WaitForWork_GetQueueStatus
mov cl, 0x58
xor r9d, r9d
call fcn.1400e3fb0
mov qword [rsp + 0x58], rax
mov ecx, 0x40
call qword [sym.imp.USER32.dll_GetQueueStatus]
mov dword [rsp + 0x54], eax
cmp byte [0x140201830], 0
je 0x1400d28a2
lea rcx, [0x140201830]
lea rdx, str.MessagePumpForUI::WaitForWork_GetQueueStatus
mov r8, qword [rsp + 0x58]
call fcn.1400fd870
bt dword [rsp + 0x54], 0x16
jae 0x1400d26b5
jmp 0x1400d26f7
call sub.KERNEL32.dll_GetCurrentThreadId
mov dword [rsp + 0x54], eax
lea rcx, [rsp + 0xa0]
mov qword [rcx], r15
call fcn.1400f9c10
xor eax, eax
mov dword [rsp + 0x48], eax
lea rax, [rsp + 0xa0]
mov qword [rsp + 0x38], rax
mov eax, dword [rsp + 0x54]
mov dword [rsp + 0x30], eax
xorps xmm0, xmm0
movups xmmword [rsp + 0x20], xmm0
mov qword [rsp + 0x40], 0
lea rdx, [0x140201830]
lea r8, str.MessagePumpForUI::WaitForWork_PeekMessage
mov cl, 0x58
xor r9d, r9d
call fcn.1400e3fb0
mov qword [rsp + 0x58], rax
xor eax, eax
mov dword [rsp + 0x20], eax
lea rcx, [rsp + 0x60]
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.USER32.dll_PeekMessageW]
mov dword [rsp + 0x54], eax
cmp byte [0x140201830], 0
je 0x1400d2953
lea rcx, [0x140201830]
lea rdx, str.MessagePumpForUI::WaitForWork_PeekMessage
mov r8, qword [rsp + 0x58]
call fcn.1400fd870
cmp dword [rsp + 0x54], 0
jne 0x1400d26f7
mov dword [rsp + 0x9c], 0
test rbx, rbx
je 0x1400d2977
mov rax, qword [rbx]
mov rcx, rbx
call qword [rax + 0x28]
mov rbx, qword [rsi]
mov eax, 0xffffffff
cmp rbx, r13
mov rcx, r12
je 0x1400d2a43
mov qword [rsp + 0xa0], r15
mov rax, qword [fcn.1400f9c10]
lea rcx, [0x140103600]
cmp rax, rcx
jne 0x1400d2a5a
mov qword [rsp + 0x60], 0
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rsp + 0x60]
movabs rcx, 0x8637bd05af7
cmp rax, rcx
jge 0x1400d2b34
imul rax, rax, 0xf4240
cqo
idiv qword [0x1402070a0]
sub rbx, rax
lea rax, [rbx + r13]
add rax, 2
cmp rax, 2
jb 0x1400d2a2a
mov rax, rbx
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 rbx, rax
setg cl
add rcx, rdx
mov rbx, rcx
mov rcx, rbx
shr rcx, 0x20
mov rax, rbx
sar rax, 0x3f
test rcx, rcx
not eax
cmove eax, ebx
mov rcx, r12
mov dword [rsp + 0x98], eax
test eax, eax
mov rdx, r14
jne 0x1400d2587
jmp 0x1400d2705
lea rcx, [rsp + 0xa0]
call rax
lea rax, [rsp + 0xa0]
mov rax, qword [rax]
jmp 0x1400d29e6
call sub.KERNEL32.dll_GetCurrentThreadId
mov ebx, eax
mov qword [rsp + 0x60], r15
lea r14, [rsp + 0x60]
mov rcx, r14
call fcn.1400f9c10
mov qword [rsp + 0x38], r14
mov dword [rsp + 0x30], ebx
xorps xmm0, xmm0
movups xmmword [rsp + 0x20], xmm0
mov dword [rsp + 0x48], 0
mov qword [rsp + 0x40], 0
lea rdx, [0x140200f70]
lea r8, str.ThreadController_active
mov cl, 0x45
xor r9d, r9d
call fcn.1400e3fb0
lea rdx, [rsp + 0x98]
jmp 0x1400d25f2
call sub.KERNEL32.dll_GetCurrentThreadId
mov dword [rsp + 0x54], eax
mov qword [rsp + 0x60], r15
lea rcx, [rsp + 0x60]
call fcn.1400f9c10
lea rax, [rsp + 0x60]
mov qword [rsp + 0x38], rax
mov eax, dword [rsp + 0x54]
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, [0x140200f70]
lea r8, str.ThreadController_active
mov cl, 0x42
xor r9d, r9d
call fcn.1400e3fb0
jmp 0x1400d2697
mov rcx, qword [0x1402070a0]
cqo
idiv rcx
imul r8, rax, 0xf4240
imul rax, rdx, 0xf4240
cqo
idiv rcx
add rax, r8
jmp 0x1400d29e6
mov rcx, qword [0x1402070a0]
cqo
idiv rcx
imul r8, rax, 0xf4240
imul rax, rdx, 0xf4240
cqo
idiv rcx
add rax, r8
jmp 0x1400d2504