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

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x138
movaps xmmword [rsp + 0x120], xmm6
lea rbp, [rsp + 0x170]
xorps xmm4, xmm4
movaps xmmword [rbp - 0x80], xmm4
movaps xmmword [rbp - 0x70], xmm4
mov qword [rbp + 0x10], rcx
mov rbx, rcx
mov esi, edx
mov edi, r8d
test edi, edi
jne 0x180164b1e
call fcn.1801645c0
mov edi, eax
mov eax, dword [rbx + 0x14]
mov dword [rbp - 0xf8], eax
test al, 3
je 0x180164b36
test esi, esi
jne 0x180164b51
xor eax, eax
jmp 0x1801655fc
cmp dword [rbx + 0x10], edi
jne 0x180164b12
mov eax, dword [rbx + 0x18]
inc eax
je 0x180165618
mov dword [rbx + 0x18], eax
jmp 0x180164fb8
lea ecx, [rax + 1]
lea r14, [rbx + 0x14]
lock cmpxchg dword [r14], ecx
mov ecx, dword [rbp - 0xf8]
cmp eax, ecx
jne 0x180164b12
jmp 0x180164fb5
mov r14d, dword [0x18047fb40]
cmp r14d, 1
je 0x180164bfc
cmp r14d, 3
jne 0x180164bef
cmp word [rbx + 0x1c], 0x8000
jne 0x180164b84
lea rax, [0x18047fb40]
movsx rax, word [rax + 6]
mov word [rbx + 0x1c], ax
lea rax, [0x18047fb40]
movsx r15, word [rax + 6]
test r15d, r15d
je 0x180164bbb
lea rax, [0x18047fb40]
movsx r13, word [rax + 8]
movsx r12, word [rbx + 0x1c]
test r12d, r12d
jge 0x180164c9b
inc r12d
mov word [rbx + 0x1c], r12w
mov rbx, qword [rbp + 0x10]
lea rax, [0x1802984c0]
cmp qword [rax - 8], 0
jne 0x180165657
mov r12, qword [0x18047da20]
mov rcx, qword [r12 + 8]
movzx edx, byte [rcx + 0x9d]
test edx, edx
jne 0x180164eff
xor edx, edx
jmp 0x180164f38
call fcn.180164720
test eax, eax
jne 0x180164b6c
mov r12d, 1
xor ecx, ecx
mov dword [rbp - 0x134], ecx
lea rcx, [rbp - 0xf0]
call fcn.180007330
mov ecx, dword [rbp - 0x134]
call sub.KERNEL32.dll_Sleep
lea rcx, [rbp - 0xf0]
call fcn.180007380
mov r14d, dword [0x18047fb40]
cmp r14d, 3
mov rbx, qword [rbp + 0x10]
je 0x180164b6c
test r14d, r14d
je 0x180164bef
mov eax, dword [rbx + 0x14]
mov dword [rbp - 0xfc], eax
test al, 3
je 0x180164c7c
test r12d, r12d
sete r12b
movzx r12d, r12b
test r12d, r12d
jne 0x180164c02
mov ecx, 1
call fcn.180004850
cmp dword [0x180488648], 0
je 0x180164c2d
jmp 0x180165643
lea ecx, [rax + 1]
mov rbx, qword [rbp + 0x10]
lea r14, [rbx + 0x14]
lock cmpxchg dword [r14], ecx
mov ecx, dword [rbp - 0xfc]
cmp eax, ecx
jne 0x180164c54
jmp 0x180164fb5
xor r14d, r14d
mov eax, dword [rbx + 0x14]
jmp 0x180164cac
mov r11d, eax
mov eax, r11d
mov rbx, r10
mov dword [rbp - 0x100], eax
mov dword [rbp - 0x98], eax
mov dword [rbp - 0x9c], 1
cmp dword [rbp - 0x98], 0x80
jb 0x180164d28
test byte [rbp - 0x98], 2
je 0x180164ce1
mov edx, 2
jmp 0x180164d90
movzx r8d, word [rbx + 0x1e]
mov dword [rbp - 0xa0], r8d
test r8d, r8d
je 0x180164d28
cmp dword [0x180488648], 0
jne 0x18016564d
call sub.KERNEL32.dll_GetTickCount64
sub eax, dword [rbp - 0xa0]
movzx eax, ax
cmp eax, 0x64
jl 0x180164d28
mov eax, dword [rbp - 0x98]
add eax, 2
mov dword [rbp - 0x98], eax
mov ebx, 2
jmp 0x180164d4d
mov rbx, qword [rbp + 0x10]
test byte [rbp - 0x98], 1
jne 0x180164de4
mov ecx, dword [rbp - 0x98]
inc ecx
mov dword [rbp - 0x98], ecx
xor ecx, ecx
xor edx, edx
mov ebx, edx
mov ecx, dword [rbp - 0x98]
mov r10, qword [rbp + 0x10]
lea rdx, [r10 + 0x14]
mov r9, rdx
mov eax, dword [rbp - 0x100]
lock cmpxchg dword [r9], ecx
mov r11d, dword [rbp - 0x100]
cmp eax, r11d
jne 0x180164ca3
cmp ebx, 1
jne 0x180164d8b
mov ecx, 1
test r11b, 0x1c
cmove r14d, ecx
mov edx, ebx
mov rbx, r10
cmp edx, 1
jne 0x180164ef1
test r14d, r14d
cmovne r12d, r15d
xor eax, eax
mov dword [rbp - 0x54], eax
mov ecx, eax
mov edx, 0xa
xor r8d, r8d
call fcn.180168a40
mov ecx, dword [rbp - 0x54]
inc ecx
movsx rcx, cx
mov eax, ecx
mov dword [rbp - 0x54], eax
cmp eax, r12d
jge 0x180164e77
mov edx, dword [rbx + 0x14]
jmp 0x180164dd2
mov edx, eax
test dl, 3
je 0x180164e15
test dl, 2
jne 0x180164e30
mov r8d, 1
jmp 0x180164e36
test byte [rbp - 0x98], 0x1c
je 0x180164df6
test r12d, r12d
je 0x180164cd7
lea rcx, [rbp - 0x98]
call fcn.1801d0cc0
test eax, eax
je 0x180164cd7
mov ebx, dword [rbp - 0x9c]
jmp 0x180164d4d
lea r9d, [rdx - 3]
lea r8, [rbx + 0x14]
mov r10, r8
mov eax, edx
lock cmpxchg dword [r10], r9d
cmp eax, edx
jne 0x180164dd0
xor r8d, r8d
jmp 0x180164e36
mov r8d, 2
cmp r8d, 1
mov eax, dword [rbp - 0x54]
je 0x180164da2
test r8d, r8d
jne 0x180164e77
test r14d, r14d
je 0x180164fb5
test r13d, r13d
jg 0x180164fb5
movsx r12, word [rbx + 0x1c]
cmp r12d, r15d
jge 0x180164fb5
lea r10d, [r12 + 1]
mov word [rbx + 0x1c], r10w
jmp 0x180164fb5
lea r10, [rbx + 0x14]
mov r12, r10
mov eax, 0xfffffffc
lock xadd dword [r12], eax
add eax, 0xfffffffc
jmp 0x180164e92
mov edx, eax
mov eax, edx
test al, 1
je 0x180164e9d
mov edx, 2
jmp 0x180164eb8
lea edx, [rax + 1]
mov dword [rbp - 0x104], eax
lock cmpxchg dword [r12], edx
mov edx, dword [rbp - 0x104]
cmp eax, edx
jne 0x180164e8e
xor edx, edx
test r14d, r14d
je 0x180164ef1
test r13d, r13d
jg 0x180164ef1
movsx r12, word [rbx + 0x1c]
test edx, edx
jne 0x180164edc
cmp r12d, r15d
jge 0x180164ef1
lea r9d, [r12 + 1]
mov word [rbx + 0x1c], r9w
jmp 0x180164ef1
lea r9d, [r12 - 1]
movsx r9, r9w
test r12d, r12d
cmovle r9d, r13d
mov word [rbx + 0x1c], r9w
cmp edx, 2
je 0x180164bbb
jmp 0x180164fb5
mov dword [rsp + 0x20], 4
mov qword [rsp + 0x28], 0x4000
xor r9d, r9d
mov dword [rsp + 0x30], r9d
mov r9, qword [rcx + 0x80]
mov r8d, dword [rcx + 0x98]
call fcn.1801ae130
test eax, eax
je 0x180164be8
mov edx, 1
mov r14d, edx
mov r13, qword [rbx + 8]
test r13, r13
jne 0x180164f4f
mov rcx, rbx
call fcn.180165710
mov r13, rax
mov edx, dword [rbx + 0x14]
xor r8d, r8d
mov dword [rbp - 0xa4], r8d
jmp 0x180164f60
mov edx, eax
mov dword [rbp - 0xb0], edx
test byte [rbp - 0xb0], 3
jne 0x180164fbf
mov eax, dword [rbp - 0xb0]
inc eax
mov dword [rbp - 0xb0], eax
mov ecx, dword [rbp - 0xb0]
lea rax, [rbx + 0x14]
mov r10, rax
mov eax, edx
lock cmpxchg dword [r10], ecx
cmp eax, edx
jne 0x180164f5e
mov dword [rbp - 0x108], edx
test dl, 3
mov qword [rbp - 0x130], r10
mov qword [rbp - 0x120], r13
mov qword [rbp - 0x128], r12
jne 0x180165016
mov dword [rbx + 0x10], edi
mov eax, edi
jmp 0x1801655fc
mov dword [rbp - 0x108], edx
lea rcx, [rbp - 0xb0]
call fcn.1801d0ce0
test eax, eax
je 0x180165661
mov edx, dword [rbp - 0x108]
cmp edx, 0x80
jae 0x180164f7d
mov r8d, dword [rbp - 0xa4]
test r8d, r8d
mov dword [rbp - 0xa4], r8d
jne 0x180164f7d
mov r8d, 1
mov word [rbx + 0x1e], 0
mov dword [rbp - 0xa4], r8d
mov rbx, qword [rbp + 0x10]
jmp 0x180164f7d
mov edx, dword [rbp - 0x108]
mov r8d, dword [rbp - 0xa4]
cmp edx, 0x80
setb cl
movzx ecx, cl
or ecx, r8d
je 0x18016504a
call sub.KERNEL32.dll_GetTickCount64
movzx ebx, ax
cmp dword [0x180488648], 0
je 0x180165053
jmp 0x180165667
mov r13, qword [rbp - 0x120]
jmp 0x180165071
lea ecx, [rbx - 1]
movzx ecx, cx
test ebx, ebx
cmove ebx, ecx
mov r13, qword [rbp + 0x10]
mov word [r13 + 0x1e], bx
mov rbx, r13
mov r13, qword [rbp - 0x120]
lea rcx, [0x18047fb40]
add rcx, 0x10
lock inc qword [rcx]
xor r8d, r8d
test r14d, r14d
je 0x1801650d8
mov qword [rbp - 0x120], r13
mov r12, qword [rbp - 0x128]
mov rcx, qword [r12 + 8]
mov rdx, rbx
cmp dword [rcx], ecx
call fcn.1801b81f0
lea rcx, [rbp - 0xb8]
call sub.KERNEL32.dll_QueryPerformanceCounter
mov r8, qword [rbp - 0xb8]
mov qword [rbp - 0x60], r8
cmp dword [0x180488648], 0
mov rbx, qword [rbp + 0x10]
mov r13, qword [rbp - 0x120]
jne 0x1801655ae
mov r8, qword [rbp - 0x60]
xorps xmm0, xmm0
movups xmmword [rbp - 0x78], xmm0
movups xmmword [rbp - 0x70], xmm0
mov qword [rbp - 0x80], rbx
lea rcx, [rbp - 0x80]
mov qword [rbp - 0x78], rcx
mov dword [rbp - 0x70], 2
mov dword [rbp - 0x6c], esi
mov rcx, qword gs:[0x58]
mov edx, dword [0x180492ef8]
mov r10d, 0x10
add r10, qword [rcx + rdx*8]
mov rcx, r10
mov rdx, qword [rcx]
test rdx, rdx
je 0x1801655bc
mov rcx, rdx
mov rdx, qword [rcx + 0x48]
mov qword [rbp - 0x68], rdx
lea rdx, [rbp - 0x78]
mov qword [rcx + 0x48], rdx
xor r12d, r12d
test esi, esi
jl 0x18016515f
mov qword [rbp - 0x120], r13
mov qword [rbp - 0x60], r8
call sub.KERNEL32.dll_GetTickCount64
mov ebx, eax
cmp dword [0x180488648], 0
mov r13, qword [rbp - 0x120]
je 0x18016516e
jmp 0x180165169
xor ecx, ecx
mov qword [rbp - 0x60], r8
mov ebx, ecx
jmp 0x18016516e
call fcn.180006480
mov eax, esi
jmp 0x180165185
mov r8d, esi
sub r8d, r13d
mov r13d, r8d
mov eax, r13d
mov r13, qword [rbp - 0x120]
mov r10, qword [rbp + 0x10]
mov r8d, dword [r10 + 0x14]
xor ecx, ecx
mov dword [rsp + 0x20], ecx
test r8b, 0x40
setne r8b
movzx r8d, r8b
mov qword [rbp - 0x120], r13
mov rcx, r13
mov dword [rbp - 0x84], eax
mov edx, eax
xor r9d, r9d
cmp dword [rcx], ecx
call fcn.180169b10
test eax, eax
je 0x1801654f8
xor eax, eax
test r15d, r15d
jle 0x180165214
xor r10d, r10d
mov r9, qword [rbp + 0x10]
mov r11d, dword [r9 + 0x14]
jmp 0x1801651e7
mov r11d, eax
mov qword [rbp - 0x130], rdx
mov eax, dword [rbp - 0x88]
test r11b, 1
je 0x18016528b
mov dword [rbp - 0x88], eax
mov ecx, eax
mov edx, 0xa
xor r8d, r8d
call fcn.180168a40
mov eax, dword [rbp - 0x88]
inc eax
cwde
cmp eax, r15d
jl 0x1801651ca
test r12d, r12d
jne 0x1801654f8
mov eax, 0xffffffe0
mov rcx, qword [rbp - 0x130]
lock xadd dword [rcx], eax
add eax, 0xffffffe0
xor edx, edx
jmp 0x180165241
mov r10d, eax
mov qword [rbp - 0x130], rcx
mov eax, r10d
test al, 1
je 0x180165418
mov r8d, dword [rbp - 0x84]
test r8d, r8d
mov eax, r8d
jl 0x180165271
call sub.KERNEL32.dll_GetTickCount64
mov r13d, eax
sub r13d, ebx
cmp dword [0x180488648], 0
je 0x18016527d
jmp 0x18016552b
mov r13, qword [rbp - 0x120]
jmp 0x180165185
cmp r13d, esi
jae 0x1801654f8
jmp 0x180165172
mov dword [rbp - 0x10c], r11d
lea ecx, [r11 - 0x9f]
test cl, 2
mov r11d, dword [rbp - 0x10c]
je 0x1801652ff
add ecx, 0xfffffffe
mov dword [rbp - 0x110], ecx
cmp ecx, 0x80
jb 0x1801652f1
test r10d, r10d
mov dword [rbp - 0x88], eax
jne 0x1801652e9
mov dword [rbp - 0x10c], r11d
mov dword [rbp - 0xbc], 1
call sub.KERNEL32.dll_GetTickCount64
movzx r13d, ax
cmp dword [0x180488648], 0
je 0x180165307
jmp 0x180165506
mov ecx, dword [rbp - 0x110]
jmp 0x180165330
mov dword [rbp - 0x88], eax
mov ecx, dword [rbp - 0x110]
jmp 0x180165330
mov dword [rbp - 0x88], eax
jmp 0x180165330
test r13d, r13d
jne 0x180165313
dec r13d
movzx r13d, r13w
mov rcx, qword [rbp + 0x10]
mov word [rcx + 0x1e], r13w
mov ecx, dword [rbp - 0x110]
mov r10d, dword [rbp - 0xbc]
mov r11d, dword [rbp - 0x10c]
mov rdx, qword [rbp - 0x130]
mov eax, r11d
lock cmpxchg dword [rdx], ecx
cmp eax, r11d
jne 0x1801651d7
cmp ecx, 0x80
jb 0x18016537a
test r10d, r10d
jne 0x18016537a
call sub.KERNEL32.dll_GetTickCount64
movzx ebx, ax
cmp dword [0x180488648], 0
jne 0x180165510
test ebx, ebx
jne 0x180165372
dec ebx
movzx ebx, bx
mov rsi, qword [rbp + 0x10]
mov word [rsi + 0x1e], bx
mov r9, qword [rbp + 0x10]
mov dword [r9 + 0x10], edi
test r14d, r14d
je 0x18016540d
lea rcx, [rbp - 0xc8]
call sub.KERNEL32.dll_QueryPerformanceCounter
mov rcx, qword [rbp - 0xc8]
sub rcx, qword [rbp - 0x60]
xorps xmm6, xmm6
cvtsi2sd xmm6, rcx
mulsd xmm6, qword [case.0x18015e015.121]
cmp dword [0x180488648], 0
jne 0x180165535
lea rsi, [0x180298470]
cmp qword [rsi - 8], 0
jne 0x18016553f
xorps xmm1, xmm1
cvtsi2sd xmm1, qword [rsi]
divsd xmm6, xmm1
movaps xmm1, xmm6
movsd qword [rbp - 0x90], xmm1
lea rcx, [0x1802984c0]
cmp qword [rcx - 8], 0
jne 0x180165549
mov r12, qword [0x18047da20]
mov rcx, qword [r12 + 8]
cmp dword [rcx], ecx
call fcn.1801b82f0
mov dword [rbp - 0xf4], edi
jmp 0x1801655a0
mov dword [rbp - 0x114], eax
lea r8d, [rax - 0x7f]
test r8b, 2
je 0x180165495
add r8d, 0xfffffffe
mov dword [rbp - 0x118], r8d
cmp r8d, 0x80
jb 0x18016546a
test edx, edx
jne 0x180165461
mov dword [rbp - 0xc0], 1
call sub.KERNEL32.dll_GetTickCount64
movzx r13d, ax
cmp dword [0x180488648], 0
je 0x180165473
jmp 0x18016551a
mov r8d, dword [rbp - 0x118]
jmp 0x180165495
mov r8d, dword [rbp - 0x118]
jmp 0x180165495
test r13d, r13d
jne 0x18016547f
dec r13d
movzx r13d, r13w
mov rcx, qword [rbp + 0x10]
mov word [rcx + 0x1e], r13w
mov edx, dword [rbp - 0xc0]
mov r8d, dword [rbp - 0x118]
mov rcx, qword [rbp - 0x130]
mov eax, dword [rbp - 0x114]
lock cmpxchg dword [rcx], r8d
mov r10d, dword [rbp - 0x114]
cmp eax, r10d
jne 0x180165234
cmp r8d, 0x80
jb 0x18016537a
test edx, edx
jne 0x18016537a
call sub.KERNEL32.dll_GetTickCount64
movzx r12d, ax
cmp dword [0x180488648], 0
jne 0x180165524
test r12d, r12d
jne 0x1801654ea
dec r12d
movzx r12d, r12w
mov rbx, qword [rbp + 0x10]
mov word [rbx + 0x1e], r12w
jmp 0x18016537a
mov rbx, qword [rbp + 0x10]
test r12d, r12d
je 0x18016555b
jmp 0x18016537a
call fcn.180006480
jmp 0x180165307
call fcn.180006480
jmp 0x180165369
call fcn.180006480
jmp 0x180165473
call fcn.180006480
jmp 0x1801654de
call fcn.180006480
jmp 0x18016527d
call fcn.180006480
jmp 0x1801653bf
call fcn.180001227
jmp 0x1801653d1
call fcn.18000196f
movsd xmm1, qword [rbp - 0x90]
jmp 0x1801653fa
mov r9, rbx
cmp qword [rbp - 0x80], 0
je 0x1801655ea
mov rcx, qword gs:[0x58]
mov eax, dword [0x180492ef8]
mov edx, 0x10
add rdx, qword [rcx + rax*8]
mov rbx, qword [rdx]
test rbx, rbx
je 0x1801655d5
mov rcx, rbx
mov rax, qword [rbp - 0x68]
mov qword [rcx + 0x48], rax
xor ecx, ecx
mov qword [rbp - 0x78], rcx
mov qword [rbp - 0x80], rcx
jmp 0x1801655ea
mov r9, qword [rbp + 0x10]
mov rcx, rsp
call fcn.180165671
jmp 0x1801655f6
call fcn.180006480
mov r8, qword [rbp - 0x60]
jmp 0x1801650d8
mov qword [rbp - 0x60], r8
lea rdx, [0x1801c5650]
call rdx
mov rdx, rax
mov r8, qword [rbp - 0x60]
jmp 0x180165121
mov rcx, rdx
lea rax, [0x1801c5650]
call rax
mov rbx, rax
mov r9, qword [rbp + 0x10]
jmp 0x180165589
mov rcx, r9
call fcn.1801d0d00
xor eax, eax
jmp 0x1801655fc
mov eax, dword [rbp - 0xf4]
movaps xmm6, xmmword [rsp + 0x120]
add rsp, 0x138
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
lea rcx, [0x1802a31d8]
call fcn.180005620
mov rsi, rax
mov rcx, rsi
call fcn.180130ec0
lea rcx, [0x180287760]
mov qword [rsi + 8], rcx
mov rcx, rsi
call fcn.180005b90
int3
call fcn.180006480
jmp 0x180164c2d
call fcn.180006480
jmp 0x180164cff
call fcn.18000196f
jmp 0x180164bcd
call fcn.18014ded0
int3
call fcn.180006480
jmp 0x180165053