Function at 0x140176940
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
mov rax, qword [rcx]
cmp rax, 3
je 0x140177507
mov rdi, rdx
mov rsi, rcx
cmp eax, 2
jne 0x1401769b0
lea rbx, [rsi + 8]
mov rcx, rbx
call fcn.140152800
lea rcx, [rsp + 0x60]
mov rdx, rbx
mov r8, rdi
call fcn.1401529c0
movzx eax, byte [rsp + 0x60]
cmp eax, 4
je 0x14017741c
cmp eax, 3
jne 0x1401773bc
mov bpl, 5
cmp bpl, 6
je 0x140177491
jmp 0x140177589
mov qword [rsp + 0x20], 0
lea rcx, [rsp + 0x20]
call sub.kernel32.dll_QueryPerformanceCounter
test eax, eax
je 0x14017768d
mov rbx, qword [rsp + 0x20]
mov rcx, qword [0x1402d9130]
test rcx, rcx
jne 0x140176a0c
mov qword [rsp + 0x20], 0
lea rcx, [rsp + 0x20]
call sub.kernel32.dll_QueryPerformanceFrequency
test eax, eax
je 0x14017768d
mov rcx, qword [rsp + 0x20]
mov qword [0x1402d9130], rcx
test rcx, rcx
je 0x140177507
mov rax, rbx
or rax, rcx
shr rax, 0x20
je 0x140176a22
mov rax, rbx
xor edx, edx
div rcx
jmp 0x140176a28
mov eax, ebx
xor edx, edx
div ecx
imul r8, rax, 0x3b9aca00
imul rax, rdx, 0x3b9aca00
mov rdx, rax
or rdx, rcx
shr rdx, 0x20
je 0x140176a4c
xor edx, edx
div rcx
mov r14, rax
jmp 0x140176a53
xor edx, edx
div ecx
mov r14d, eax
add r14, r8
mov rax, r14
shr rax, 9
movabs rcx, 0x44b82fa09b5a53
mul rcx
mov r12, rdx
mov r13, qword [rsi + 0x510]
lea r15, [r13 + 0x10]
mov rcx, r15
call sub.kernel32.dll_AcquireSRWLockExclusive
movzx eax, byte [r13 + 0x18]
test al, al
jne 0x140177507
mov rax, qword [rsi + 0x510]
mov rax, qword [rax]
mov qword [rsp + 0x88], rax
mov r8d, dword [rsi + 0x4e8]
cmp r8d, 0x3b9aca00
je 0x140176dc6
movzx eax, byte [rsi + 0x509]
test rax, rax
je 0x140176ad0
cmp eax, 1
je 0x140176ae4
cmp dword [r13 + 0x38], 0x3b9aca00
jne 0x140176ae4
jmp 0x140176aee
cmp qword [rsp + 0x88], 2
ja 0x140176aee
cmp byte [rsi + 0x508], 0
jne 0x140176aee
cmp al, 1
jne 0x140176dc6
jmp 0x140176b4a
mov byte [rsi + 0x509], 1
mov eax, dword [r13 + 0x58]
cmp eax, 0x3b9aca00
je 0x140177507
mov rdx, qword [r13 + 0x50]
add rdx, qword [rsi + 0x4e0]
jb 0x140177507
add r8d, eax
cmp r8d, 0x3b9aca00
jb 0x140176b3e
inc rdx
je 0x140177507
add r8d, 0xc4653600
cmp r8d, 0x3b9aca00
je 0x140177507
mov rcx, qword [rsi + 0x500]
call fcn.1401daea0
mov qword [rsp + 0x50], r12
mov r12, qword [rsi + 0x500]
mov rbx, qword [rdi]
xor ecx, ecx
call fcn.1401d91c0
test rax, rax
je 0x140176bb0
mov qword [rsp + 0x58], r13
mov r13, r14
mov r14, r15
movzx r15d, byte [rax + 0x4c]
movzx ebp, byte [rax + 0x4d]
test r15b, r15b
je 0x140176bd5
test bpl, bpl
jne 0x140176bd5
mov rax, qword [rbx]
mov rcx, qword [rbx + 8]
call qword [rax + 0x10]
mov r15, r14
mov r14, r13
mov r13, qword [rsp + 0x58]
mov r12, qword [rsp + 0x50]
cmp dword [r13 + 0x38], 0x3b9aca00
jne 0x140176dd4
jmp 0x140177389
mov rcx, r12
mov rdx, rdi
call fcn.1401d9550
mov r12, qword [rsp + 0x50]
test al, al
je 0x140176c42
movzx eax, al
cmp eax, 4
je 0x140176dc6
jmp 0x140177507
xor ecx, ecx
mov edx, ebp
sub dl, 1
movzx edx, dl
cmovb edx, ecx
test r15b, r15b
movzx ecx, bpl
cmovne ecx, edx
mov byte [rax + 0x4d], cl
mov rcx, r12
mov rdx, rdi
call fcn.1401d9550
test r15b, r15b
je 0x140176d1b
cmp al, 4
mov r15, r14
mov r14, r13
mov r13, qword [rsp + 0x58]
mov r12, qword [rsp + 0x50]
jne 0x140176bc0
xor ecx, ecx
call fcn.1401d91c0
test rax, rax
je 0x140176dc6
mov byte [rax + 0x4c], 1
mov byte [rax + 0x4d], bpl
cmp dword [r13 + 0x38], 0x3b9aca00
jne 0x140176dd4
jmp 0x140177389
mov eax, dword [r13 + 0x58]
cmp eax, 0x3b9aca00
je 0x140177507
mov rcx, qword [r13 + 0x50]
add rcx, qword [rsi + 0x4e0]
jb 0x140177507
add eax, dword [rsi + 0x4e8]
cmp eax, 0x3b9aca00
jb 0x140176c7d
inc rcx
je 0x140177507
add eax, 0xc4653600
mov rdx, qword [rsi + 0x500]
cmp rcx, qword [rdx + 0x10]
jb 0x140176c99
jne 0x140176feb
cmp eax, dword [rdx + 0x18]
ja 0x140176feb
lea rcx, [r13 + 0x20]
call fcn.140068d20
mov byte [rsi + 0x509], 2
mov qword [rsp + 0x20], 0
lea rcx, [rsp + 0x20]
call sub.kernel32.dll_QueryPerformanceCounter
test eax, eax
je 0x14017768d
mov r12, qword [rsp + 0x20]
mov rcx, qword [0x1402d9130]
test rcx, rcx
jne 0x140176d05
mov qword [rsp + 0x20], 0
lea rcx, [rsp + 0x20]
call sub.kernel32.dll_QueryPerformanceFrequency
test eax, eax
je 0x14017768d
mov rcx, qword [rsp + 0x20]
mov qword [0x1402d9130], rcx
test rcx, rcx
je 0x140177507
mov rax, r12
or rax, rcx
shr rax, 0x20
je 0x140176d2b
mov rax, r12
xor edx, edx
div rcx
jmp 0x140176d32
mov r15, r14
mov r14, r13
mov r13, qword [rsp + 0x58]
jmp 0x140176bbb
mov eax, r12d
xor edx, edx
div ecx
imul r9, rax, 0x3b9aca00
imul rax, rdx, 0x3b9aca00
mov rdx, rax
or rdx, rcx
shr rdx, 0x20
mov r12, qword [rsp + 0x50]
je 0x140176d5b
xor edx, edx
div rcx
mov r8, rax
jmp 0x140176d62
xor edx, edx
div ecx
mov r8d, eax
add r8, r9
mov rax, r8
shr rax, 9
movabs rcx, 0x44b82fa09b5a53
mul rcx
mov rax, rdx
shr rax, 0xb
mov rdx, qword [rsi + 0x4f0]
add rdx, rax
jb 0x140177507
imul rax, rax, 0x3b9aca00
sub r8, rax
add r8d, dword [rsi + 0x4f8]
cmp r8d, 0x3b9aca00
jb 0x140176dba
inc rdx
je 0x140177507
add r8d, 0xc4653600
mov rcx, qword [rsi + 0x500]
call fcn.1401daea0
cmp dword [r13 + 0x38], 0x3b9aca00
je 0x140177389
mov rbx, qword [r13 + 0x60]
lea rcx, [rbx + 0x30]
mov rdx, qword [rdi]
call fcn.140046a30
xor ecx, ecx
mov eax, 3
lock cmpxchg qword [rbx + 0x10], rcx
cmp rax, 3
je 0x140176e6e
cmp rax, 4
je 0x140177389
cmp dword [rsi + 0x4e8], 0x3b9aca00
je 0x140177389
cmp byte [rsi + 0x509], 2
jb 0x140177389
mov r14, qword [rsi + 0x500]
mov rbx, qword [rdi]
xor ecx, ecx
call fcn.1401d91c0
test rax, rax
je 0x140176f72
mov r12, rdi
mov rdi, r15
movzx r15d, byte [rax + 0x4c]
movzx ebp, byte [rax + 0x4d]
test r15b, r15b
je 0x140176f96
test bpl, bpl
jne 0x140176f96
mov rax, qword [rbx]
mov rcx, qword [rbx + 8]
call qword [rax + 0x10]
mov r15, rdi
mov rdi, r12
jmp 0x140177389
mov eax, dword [r13 + 0x38]
cmp eax, 0x3b9aca00
je 0x140177507
shr r12, 0xb
imul ecx, r12d, 0x3b9aca00
sub r14d, ecx
mov rcx, qword [r13 + 0x30]
mov dword [r13 + 0x38], 0x3b9aca00
mov qword [rsp + 0x60], r12
mov dword [rsp + 0x68], r14d
mov qword [rsp + 0x20], rcx
mov dword [rsp + 0x28], eax
lea rcx, [rsp + 0x60]
lea rdx, [rsp + 0x20]
call fcn.1401c9ca0
mov r9, rax
mov ebp, edx
xor ebx, ebx
cmp edx, 0x3b9aca00
cmovne ebx, edx
cmp dword [rsi + 0x4e8], 0x3b9aca00
je 0x14017714c
mov r8d, 0x3b9aca00
cmp dword [r13 + 0x58], 0x3b9aca00
je 0x1401770c0
mov qword [rsp + 0x50], r9
mov dword [rsp + 0x58], ebx
mov rbx, r12
mov qword [rsp + 0x20], 0
lea rcx, [rsp + 0x20]
call sub.kernel32.dll_QueryPerformanceCounter
test eax, eax
je 0x14017768d
mov r12, qword [rsp + 0x20]
mov rcx, qword [0x1402d9130]
test rcx, rcx
jne 0x140176f55
mov qword [rsp + 0x20], 0
lea rcx, [rsp + 0x20]
call sub.kernel32.dll_QueryPerformanceFrequency
test eax, eax
je 0x14017768d
mov rcx, qword [rsp + 0x20]
mov qword [0x1402d9130], rcx
test rcx, rcx
je 0x140177507
mov rax, r12
or rax, rcx
shr rax, 0x20
je 0x140177056
mov rax, r12
xor edx, edx
div rcx
jmp 0x14017705d
mov rcx, r14
mov rdx, rdi
call fcn.1401d9550
test al, al
je 0x140177012
movzx eax, al
cmp eax, 4
je 0x140177389
jmp 0x140177507
xor ecx, ecx
mov edx, ebp
sub dl, 1
movzx edx, dl
cmovb edx, ecx
test r15b, r15b
movzx ecx, bpl
cmovne ecx, edx
mov byte [rax + 0x4d], cl
mov rcx, r14
mov rdx, r12
call fcn.1401d9550
test r15b, r15b
je 0x14017750b
cmp al, 4
mov r15, rdi
mov rdi, r12
jne 0x140176f7d
xor ecx, ecx
call fcn.1401d91c0
test rax, rax
je 0x140177389
mov byte [rax + 0x4c], 1
mov byte [rax + 0x4d], bpl
jmp 0x140177389
mov byte [rsi + 0x509], 0
mov rax, qword [rdi]
mov rdx, qword [rax]
mov rcx, qword [rax + 8]
call qword [rdx + 0x10]
cmp dword [r13 + 0x38], 0x3b9aca00
jne 0x140176dd4
jmp 0x140177389
cmp dword [rsi + 0x4e8], 0x3b9aca00
je 0x140177549
mov rdi, qword [rsi + 0x500]
mov rcx, rdi
call fcn.1401d9770
lea rcx, [rdi + 8]
cmp qword [rdi], 0
je 0x140177516
mov rax, qword [rcx]
lock dec qword [rax]
jne 0x140177524
call fcn.140063210
jmp 0x140177524
mov eax, r12d
xor edx, edx
div ecx
imul r9, rax, 0x3b9aca00
imul rax, rdx, 0x3b9aca00
mov rdx, rax
or rdx, rcx
shr rdx, 0x20
mov r12, rbx
je 0x140177084
xor edx, edx
div rcx
mov r8, rax
jmp 0x14017708b
xor edx, edx
div ecx
mov r8d, eax
mov ebx, dword [rsp + 0x58]
add r8, r9
mov rax, r8
shr rax, 9
movabs rcx, 0x44b82fa09b5a53
mul rcx
shr rdx, 0xb
imul eax, edx, 0x3b9aca00
sub r8d, eax
mov qword [r13 + 0x50], rdx
mov dword [r13 + 0x58], r8d
mov r9, qword [rsp + 0x50]
movzx eax, byte [rsi + 0x509]
test rax, rax
je 0x1401770dd
cmp eax, 1
je 0x14017714c
cmp dword [r13 + 0x38], 0x3b9aca00
je 0x1401770f1
jmp 0x14017714c
cmp qword [rsp + 0x88], 2
ja 0x1401770f1
cmp byte [rsi + 0x508], 0
je 0x14017714c
mov byte [rsi + 0x509], 1
cmp r8d, 0x3b9aca00
je 0x140177507
mov rdx, qword [r13 + 0x50]
add rdx, qword [rsi + 0x4e0]
jb 0x140177507
add r8d, dword [rsi + 0x4e8]
cmp r8d, 0x3b9aca00
mov qword [rsp + 0x50], r9
jb 0x14017713b
inc rdx
je 0x140177507
add r8d, 0xc4653600
mov rcx, qword [rsi + 0x500]
call fcn.1401daea0
mov r9, qword [rsp + 0x50]
cmp dword [rsi + 0x4c0], 0x3b9aca00
je 0x140177389
cmp qword [r13 + 0x20], 0
je 0x140177507
mov rcx, qword [r13 + 0x28]
mov qword [r13 + 0x20], 1
mov qword [r13 + 0x28], 0
mov eax, dword [rsi + 0x4d8]
cmp rax, 0x1000000
je 0x140177265
xorpd xmm0, xmm0
xorpd xmm1, xmm1
cmp ebp, 0x3b9aca00
je 0x1401771be
movq xmm2, r9
punpckldq xmm2, xmmword [0x1401fd300]
subpd xmm2, xmmword [0x1401fd310]
movapd xmm1, xmm2
unpckhpd xmm1, xmm2
addsd xmm1, xmm2
mov edx, ebx
xorps xmm2, xmm2
cvtsi2sd xmm2, rdx
divsd xmm2, qword [0x1401fd320]
addsd xmm2, xmm1
movsd xmm1, qword [rsi + 0x4d0]
movapd xmm3, xmm2
subsd xmm3, xmm1
mulsd xmm3, qword [0x1401fd328]
movsd xmm4, qword [rsi + 0x4c8]
addsd xmm3, xmm1
cmpeqsd xmm0, xmm1
andpd xmm2, xmm0
andnpd xmm0, xmm3
orpd xmm0, xmm2
movlpd qword [rsi + 0x4d0], xmm0
movq xmm2, rcx
punpckldq xmm2, xmmword [0x1401fd300]
subpd xmm2, xmmword [0x1401fd310]
movapd xmm1, xmm2
unpckhpd xmm1, xmm2
mulsd xmm0, qword [0x1401fd330]
addsd xmm1, xmm2
divsd xmm1, xmm0
ucomisd xmm4, xmm1
ja 0x140177265
movsd qword [rsi + 0x4c8], xmm1
add rax, rax
movabs rdx, 0x5555555555555556
mul rdx
cmp rdx, rcx
jbe 0x1401774a3
mov rax, qword [rsi + 0x4b8]
mov r9, r12
cmp rax, 9
ja 0x1401772d7
mov ecx, dword [rsi + 0x4dc]
inc ecx
mov dword [rsi + 0x4dc], ecx
cmp ecx, 2
jb 0x1401772d7
mov ecx, dword [rsi + 0x4c0]
lea edx, [rcx*4]
mov r8d, edx
shr r8d, 9
imul r8, r8, 0x44b83
shr r8, 0x27
imul r8d, r8d, 0x3b9aca00
sub edx, r8d
imul rcx, rcx, 0x44b82fa1
shr rcx, 0x3a
lea rax, [rcx + rax*4]
mov qword [rsi + 0x4b8], rax
mov dword [rsi + 0x4c0], edx
mov dword [rsi + 0x4dc], 0
xor ecx, ecx
add r9, rax
jb 0x140177507
add r14d, dword [rsi + 0x4c0]
cmp r14d, 0x3b9aca00
jb 0x140177302
inc r9
je 0x140177507
add r14d, 0xc4653600
mov qword [r13 + 0x40], r9
mov dword [r13 + 0x48], r14d
test cl, cl
je 0x140177389
mov rcx, r15
call fcn.1401f2d54
mov rcx, qword [rsi + 0x400]
mov edx, r12d
call fcn.14019ba90
cmp dword [rsi + 0x438], 2
jb 0x140177498
mov qword [rsi + 0x438], 0
mov dword [rsi + 0x444], 0
mov dword [rsi + 0x44c], 0
mov dword [rsi + 0x454], 1
mov dword [rsi + 0x458], r12d
mov dword [rsi + 0x45c], 0
mov dword [rsi + 0x464], 0
mov dword [rsi + 0x46c], 0
mov byte [rsi + 0x474], 0
jmp 0x140177391
mov rcx, r15
call fcn.1401f2d54
mov rcx, rsi
call fcn.140152800
lea rcx, [rsp + 0x60]
mov rdx, rsi
mov r8, rdi
call fcn.1401529c0
movzx eax, byte [rsp + 0x60]
cmp eax, 4
je 0x14017741c
cmp eax, 3
je 0x14017699e
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0x40], rax
movups xmm0, xmmword [rsp + 0x60]
movupd xmm1, xmmword [rsp + 0x70]
movapd xmmword [rsp + 0x30], xmm1
movaps xmmword [rsp + 0x20], xmm0
movzx eax, byte [rsp + 0x20]
test rax, rax
je 0x14017742a
cmp eax, 1
jne 0x14017743c
mov rdi, qword [rsp + 0x28]
movaps xmm0, xmmword [rsp + 0x30]
movaps xmmword [rsp + 0x90], xmm0
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0xa0], rax
mov ebx, dword [rsp + 0x24]
mov bpl, 1
movzx r14d, byte [rsp + 0x21]
jmp 0x140177465
mov bpl, 6
cmp bpl, 6
je 0x140177491
jmp 0x140177589
mov ebx, dword [rsp + 0x24]
mov edi, dword [rsp + 0x28]
movzx r14d, byte [rsp + 0x21]
xor ebp, ebp
jmp 0x140177465
movzx edi, byte [rsp + 0x21]
cmp qword [rsp + 0x28], 0
je 0x14017745a
lea rdx, [rsp + 0x28]
mov ecx, edi
call fcn.14004ac20
mov rdi, rax
jmp 0x140177462
shl rdi, 0x20
or rdi, 3
mov bpl, 4
mov rax, qword [rsp + 0xa0]
mov qword [rsp + 0xc0], rax
movapd xmm0, xmmword [rsp + 0x90]
movapd xmmword [rsp + 0xb0], xmm0
cmp bpl, 6
jne 0x140177589
mov al, 2
jmp 0x140177679
mov bpl, 3
mov r14b, 0xa
jmp 0x140177589
mov r9, r12
add rcx, rcx
cmp rcx, 0x1000000
mov r12d, 0x1000000
cmovb r12, rcx
mov dword [rsi + 0x4d8], r12d
mov dword [rsi + 0x4dc], 0
mov rcx, qword [rsi + 0x4b8]
mov edx, dword [rsi + 0x4c0]
mov rax, rcx
shr rax, 1
shr edx, 1
lea r8d, [rdx + 0x1dcd6500]
test cl, 1
cmove r8d, edx
mov qword [rsi + 0x4b8], rax
mov dword [rsi + 0x4c0], r8d
mov cl, 1
add r9, rax
jae 0x1401772e2
ud2
mov r15, rdi
mov rdi, r12
jmp 0x140176f7d
mov rax, qword [rcx]
lock dec qword [rax]
jne 0x140177524
call fcn.140062fd0
mov rax, qword [rdi + 0x48]
test rax, rax
je 0x140177534
mov rcx, qword [rdi + 0x50]
call qword [rax + 0x18]
mov r8, qword [rsi + 0x500]
mov rcx, qword [0x1402d9150]
xor edx, edx
call sub.kernel32.dll_HeapFree
mov dword [rsi + 0x4e8], 0x3b9aca00
movupd xmm0, xmmword [rsp + 0x20]
movupd xmm1, xmmword [rsp + 0x30]
movupd xmmword [rsi + 0x4ec], xmm0
movupd xmmword [rsi + 0x4fc], xmm1
mov eax, dword [rsp + 0x40]
mov dword [rsi + 0x50c], eax
mov byte [r13 + 0x68], 1
mov rcx, r15
call fcn.1401f2d54
mov bpl, 5
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0x70], rax
movapd xmm0, xmmword [rsp + 0xb0]
movapd xmmword [rsp + 0x60], xmm0
cmp dword [rsi], 3
je 0x140177696
mov rcx, rsi
call fcn.140187a90
mov qword [rsi], 3
cmp bpl, 5
je 0x140177672
mov byte [rsp + 0x20], bpl
mov byte [rsp + 0x21], r14b
mov dword [rsp + 0x24], ebx
mov qword [rsp + 0x28], rdi
movapd xmm0, xmmword [rsp + 0x60]
movupd xmmword [rsp + 0x30], xmm0
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x40], rax
movzx eax, bpl
lea ecx, [rax - 2]
cmp ecx, 2
jb 0x140177672
test eax, eax
je 0x140177672
cmp eax, 1
jne 0x140177619
lea rcx, [rsp + 0x40]
mov rdx, qword [rsp + 0x30]
mov r8, qword [rsp + 0x38]
call qword [rdi + 0x10]
jmp 0x140177672
mov eax, edi
and eax, 3
lea rcx, [rax - 2]
cmp rcx, 2
jb 0x140177672
test rax, rax
je 0x140177672
lea rsi, [rdi - 1]
mov rbx, qword [rdi - 1]
mov rdi, qword [rdi + 7]
mov rcx, rbx
call qword [rdi]
cmp qword [rdi + 8], 0
je 0x140177661
cmp qword [rdi + 0x10], 0x11
jb 0x140177650
mov rbx, qword [rbx - 8]
mov rcx, qword [0x1402d9150]
xor edx, edx
mov r8, rbx
call sub.kernel32.dll_HeapFree
mov rcx, qword [0x1402d9150]
xor edx, edx
mov r8, rsi
call sub.kernel32.dll_HeapFree
cmp bpl, 5
setne al
add rsp, 0xc8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
call sub.kernel32.dll_GetLastError
ud2
mov qword [rsi], 3
ud2