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

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x70
movaps xmmword [rsp + 0x60], xmm6
movaps xmmword [rsp + 0x50], xmm7
movaps xmmword [rsp + 0x40], xmm8
movaps xmmword [rsp + 0x30], xmm9
mov rsi, rcx
xor r8d, r8d
mov r12d, 1
mov edx, r12d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateWaitableTimerW]
mov rbx, rax
xor dil, dil
test rax, rax
jne 0x180039447
lea rcx, str.Cant_create_waitable_timer__will_use_Sleep_n__workaround
call fcn.1800358b0
movzx edi, r12b
mov edx, dword [0x180137b54]
mov rcx, qword gs:[0x58]
mov r15d, 4
mov r14, qword [rcx + rdx*8]
xor ebp, ebp
movsd xmm8, qword [0x180116188]
xorps xmm9, xmm9
movsd xmm7, qword [0x180116200]
nop word [rax + rax]
mov eax, dword [r14 + r15]
cmp dword [0x1801392d0], eax
jle 0x1800394bf
lea rcx, [0x1801392d0]
call fcn.180077e94
cmp dword [0x1801392d0], 0xffffffff
jne 0x1800394bf
call fcn.180029370
lea rcx, [0x1800fef40]
call fcn.1800783f0
nop
lea rcx, [0x1801392d0]
call fcn.180077e34
movzx eax, byte [0x1801392e2]
test al, al
je 0x180039734
mov eax, dword [r14 + r15]
cmp dword [0x1801392d0], eax
jle 0x18003950d
lea rcx, [0x1801392d0]
call fcn.180077e94
cmp dword [0x1801392d0], 0xffffffff
jne 0x18003950d
call fcn.180029370
lea rcx, [0x1800fef40]
call fcn.1800783f0
nop
lea rcx, [0x1801392d0]
call fcn.180077e34
lea rcx, [rsp + 0xb0]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rsp + 0xb0]
sub rax, qword [0x180139420]
imul rcx, rax, 0x3e8
mov qword [rsp + 0xb0], rcx
xorps xmm6, xmm6
cvtsi2sd xmm6, rcx
xorps xmm0, xmm0
cvtsi2sd xmm0, qword [0x180139418]
divsd xmm6, xmm0
mov eax, dword [r14 + r15]
cmp dword [0x1801392d0], eax
jle 0x180039590
lea rcx, [0x1801392d0]
call fcn.180077e94
cmp dword [0x1801392d0], 0xffffffff
jne 0x180039590
call fcn.180029370
lea rcx, [0x1800fef40]
call fcn.1800783f0
nop
lea rcx, [0x1801392d0]
call fcn.180077e34
mov rax, qword [0x180139398]
mov rax, qword [rax]
cmp byte [rax + 0x19], 0
jne 0x180039629
mov rdx, qword [rax + 0x28]
movaps xmm1, xmm6
subsd xmm1, qword [rdx + 0x30]
movsd qword [rdx + 0x30], xmm6
mov ecx, dword [rdx + 0x28]
test ecx, ecx
jle 0x1800395d4
movd xmm0, ecx
cvtdq2pd xmm0, xmm0
subsd xmm0, xmm1
cvttsd2si ecx, xmm0
test ecx, ecx
cmovs ecx, ebp
mov dword [rdx + 0x28], ecx
mov rcx, qword [rax + 0x10]
cmp byte [rcx + 0x19], 0
je 0x180039600
mov rcx, qword [rax + 8]
cmp byte [rcx + 0x19], 0
jne 0x1800395fb
cmp rax, qword [rcx + 0x10]
jne 0x1800395fb
mov rax, rcx
mov rcx, qword [rcx + 8]
cmp byte [rcx + 0x19], 0
je 0x1800395e8
mov rax, rcx
jmp 0x18003961f
mov rax, rcx
mov rdx, qword [rcx]
cmp byte [rdx + 0x19], 0
jne 0x18003961f
nop dword [rax]
mov rax, rdx
mov rcx, qword [rdx]
mov rdx, rcx
cmp byte [rcx + 0x19], 0
je 0x180039610
cmp byte [rax + 0x19], 0
je 0x1800395a4
mov rcx, rsi
call fcn.180039a90
mov eax, dword [r14 + r15]
cmp dword [0x1801392d0], eax
jle 0x180039670
lea rcx, [0x1801392d0]
call fcn.180077e94
cmp dword [0x1801392d0], 0xffffffff
jne 0x180039670
call fcn.180029370
lea rcx, [0x1800fef40]
call fcn.1800783f0
nop
lea rcx, [0x1801392d0]
call fcn.180077e34
lea rcx, [rsp + 0xb8]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rsp + 0xb8]
sub rax, qword [0x180139420]
imul rcx, rax, 0x3e8
mov qword [rsp + 0xb8], rcx
xorps xmm1, xmm1
cvtsi2sd xmm1, rcx
xorps xmm0, xmm0
cvtsi2sd xmm0, qword [0x180139418]
divsd xmm1, xmm0
subsd xmm1, xmm6
movaps xmm0, xmm8
subsd xmm0, xmm1
comisd xmm0, xmm9
jbe 0x180039480
test dil, dil
je 0x1800396e0
mov ecx, 3
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x180039480
mulsd xmm0, xmm7
cvttsd2si rax, xmm0
mov qword [rsp + 0xc0], rax
mov dword [rsp + 0x28], ebp
mov qword [rsp + 0x20], rbp
xor r9d, r9d
xor r8d, r8d
lea rdx, [rsp + 0xc0]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetWaitableTimer]
test eax, eax
je 0x180039728
mov edx, 0x1e
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x180039480
lea rcx, str.Cant_set_timer_in_main_loop._Exiting_
call fcn.1800359d0
test rbx, rbx
je 0x180039742
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rcx, str.System_shutting_down
call fcn.1800359d0
mov rsi, qword [rsi]
lea rcx, str.Shutting_down_features...
call fcn.1800359d0
mov rdi, qword [rsi + 0x10]
mov rbx, qword [rsi + 8]
cmp rbx, rdi
je 0x180039782
nop word [rax + rax]
mov rcx, qword [rbx]
mov rax, qword [rcx]
call qword [rax + 0x58]
add rbx, 8
cmp rbx, rdi
jne 0x180039770
mov rax, qword [rsi + 8]
cmp rax, qword [rsi + 0x10]
je 0x180039790
mov qword [rsi + 0x10], rax
lea rcx, str.Shutting_down_features_completed.
call fcn.1800359d0
lea rcx, str.Removing_input_hooks...
call fcn.1800359d0
xor edx, edx
xor ecx, ecx
call fcn.18003d480
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
call fcn.180034e80
lea rcx, str.user32
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test rax, rax
je 0x1800397f0
lea rdx, str.GetMessageA
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
je 0x1800397f0
mov rcx, rax
call fcn.18003d220
lea rcx, str.user32
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test rax, rax
je 0x18003981f
lea rdx, str.GetMessageW
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
je 0x18003981f
mov rcx, rax
call fcn.18003d220
lea rcx, str.user32
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test rax, rax
je 0x18003984e
lea rdx, str.PeekMessageA
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
je 0x18003984e
mov rcx, rax
call fcn.18003d220
lea rcx, str.user32
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test rax, rax
je 0x18003987d
lea rdx, str.PeekMessageW
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
je 0x18003987d
mov rcx, rax
call fcn.18003d220
mov rbx, qword [0x180139208]
test rbx, rbx
je 0x1800398a3
call fcn.1800298d0
mov r8, rbx
mov edx, 0xfffffffc
mov rcx, qword [rax + 0xb0]
call qword [sym.imp.USER32.dll_SetWindowLongPtrW]
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rcx, str.Removing_input_hooks...DONE
call fcn.1800359d0
mov rbx, rbp
xor eax, eax
lock cmpxchg dword [0x180139158], r12d
je 0x1800398f3
nop word [rax + rax]
cmp rbx, 0x20
jae 0x1800398da
xor ecx, ecx
jmp 0x1800398dd
mov ecx, r12d
call qword [sym.imp.KERNEL32.dll_Sleep]
inc rbx
xor eax, eax
lock cmpxchg dword [0x180139158], r12d
jne 0x1800398d0
cmp qword [0x180139160], 0
je 0x180039971
xor ecx, ecx
call fcn.18003cc00
test eax, eax
jne 0x180039971
mov rcx, qword [0x180139648]
mov qword [0x180139648], rbp
test rcx, rcx
je 0x180039939
nop dword [rax + rax]
mov rbx, qword [rcx]
xor edx, edx
mov r8d, 0x8000
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov rcx, rbx
test rbx, rbx
jne 0x180039920
mov r8, qword [0x180139650]
xor edx, edx
mov rcx, qword [0x180139160]
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [0x180139160]
call qword [sym.imp.KERNEL32.dll_HeapDestroy]
mov qword [0x180139160], rbp
mov qword [0x180139650], rbp
mov qword [0x180139658], rbp
mov eax, ebp
xchg dword [0x180139158], eax
mov ecx, dword [r14 + r15]
cmp dword [0x180139580], ecx
jle 0x1800399db
lea rcx, [0x180139580]
call fcn.180077e94
cmp dword [0x180139580], 0xffffffff
jne 0x1800399db
xorps xmm0, xmm0
movdqa xmmword [0x180139590], xmm0
mov qword [0x1801395a0], rbp
mov word [0x1801395a8], 0
mov qword [0x1801395e8], rbp
mov qword [0x180139628], rbp
lea rcx, [0x1800ff010]
call fcn.1800783f0
lea rcx, [0x180139580]
call fcn.180077e34
lea rcx, str.Disconnecting_from_named_pipes...
call fcn.1800359d0
cmp byte [0x1801395a8], 0
je 0x180039a0f
mov byte [0x1801395a8], 0
mov rcx, qword [0x180139590]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [0x180139590], 0xffffffffffffffff
cmp byte [0x1801395a9], 0
je 0x180039a4f
mov byte [0x1801395a9], 0
mov rcx, qword [0x180139598]
call qword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
mov ecx, 0x7d0
call qword [sym.imp.KERNEL32.dll_Sleep]
mov rcx, qword [0x180139598]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [0x180139598], 0xffffffffffffffff
mov ecx, 0x1f4
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rcx, str.Disconnecting_from_named_pipes...DONE
movaps xmm6, xmmword [rsp + 0x60]
movaps xmm7, xmmword [rsp + 0x50]
movaps xmm8, xmmword [rsp + 0x40]
movaps xmm9, xmmword [rsp + 0x30]
add rsp, 0x70
pop r15
pop r14
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
jmp fcn.1800359d0