Function at 0x140058cf0
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
mov rax, qword [rcx]
cmp rax, 3
je 0x14005963a
mov rdi, rdx
mov rsi, rcx
cmp eax, 2
jne 0x140058d24
lea rdx, [rsi + 8]
jmp 0x1400595ab
mov qword [rsp + 0x28], 0
lea rcx, [rsp + 0x28]
call sub.kernel32.dll_QueryPerformanceCounter
test eax, eax
je 0x140059805
mov rbx, qword [rsp + 0x28]
mov rcx, qword [0x140206100]
test rcx, rcx
jne 0x140058d80
mov qword [rsp + 0x28], 0
lea rcx, [rsp + 0x28]
call sub.kernel32.dll_QueryPerformanceFrequency
test eax, eax
je 0x140059805
mov rcx, qword [rsp + 0x28]
mov qword [0x140206100], rcx
test rcx, rcx
je 0x14005963a
mov rax, rbx
or rax, rcx
shr rax, 0x20
je 0x140058d96
mov rax, rbx
xor edx, edx
div rcx
jmp 0x140058d9c
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 0x140058dc0
xor edx, edx
div rcx
mov r14, rax
jmp 0x140058dc7
xor edx, edx
div ecx
mov r14d, eax
add r14, r8
mov rax, r14
shr rax, 9
movabs r12, 0x44b82fa09b5a53
mul r12
mov r15, rdx
mov r13, qword [rsi + 0x510]
lea rbx, [r13 + 0x10]
mov rcx, rbx
call sub.kernel32.dll_AcquireSRWLockExclusive
movzx eax, byte [r13 + 0x18]
test al, al
jne 0x14005963a
mov rax, qword [rsi + 0x510]
mov rbp, qword [rax]
mov r8d, dword [rsi + 0x4e8]
cmp r8d, 0x3b9aca00
je 0x140059037
movzx eax, byte [rsi + 0x509]
test rax, rax
je 0x140058e3c
cmp eax, 1
je 0x140058e4b
cmp dword [r13 + 0x38], 0x3b9aca00
jne 0x140058e4b
jmp 0x140058e55
cmp rbp, 2
ja 0x140058e55
cmp byte [rsi + 0x508], 0
jne 0x140058e55
cmp al, 1
jne 0x140059037
jmp 0x140058eb1
mov byte [rsi + 0x509], 1
mov eax, dword [r13 + 0x58]
cmp eax, 0x3b9aca00
je 0x14005963a
mov rdx, qword [r13 + 0x50]
add rdx, qword [rsi + 0x4e0]
jb 0x14005963a
add r8d, eax
cmp r8d, 0x3b9aca00
jb 0x140058ea5
inc rdx
je 0x14005963a
add r8d, 0xc4653600
cmp r8d, 0x3b9aca00
je 0x14005963a
mov rcx, qword [rsi + 0x500]
call fcn.140101780
mov rcx, qword [rsi + 0x500]
mov rdx, rdi
call fcn.1401018c0
test al, al
jne 0x140059037
mov eax, dword [r13 + 0x58]
cmp eax, 0x3b9aca00
je 0x14005963a
mov rcx, qword [r13 + 0x50]
add rcx, qword [rsi + 0x4e0]
jb 0x14005963a
add eax, dword [rsi + 0x4e8]
cmp eax, 0x3b9aca00
jb 0x140058f03
inc rcx
je 0x14005963a
add eax, 0xc4653600
mov rdx, qword [rsi + 0x500]
cmp rcx, qword [rdx + 0x10]
jb 0x140058f1f
jne 0x14005921c
cmp eax, dword [rdx + 0x18]
ja 0x14005921c
lea rcx, [r13 + 0x20]
call fcn.14003ac00
mov byte [rsi + 0x509], 2
mov qword [rsp + 0x28], 0
lea rcx, [rsp + 0x28]
call sub.kernel32.dll_QueryPerformanceCounter
test eax, eax
je 0x140059805
mov r12, qword [rsp + 0x28]
mov rcx, qword [0x140206100]
test rcx, rcx
jne 0x140058f8b
mov qword [rsp + 0x28], 0
lea rcx, [rsp + 0x28]
call sub.kernel32.dll_QueryPerformanceFrequency
test eax, eax
je 0x140059805
mov rcx, qword [rsp + 0x28]
mov qword [0x140206100], rcx
test rcx, rcx
je 0x14005963a
mov rax, r12
or rax, rcx
shr rax, 0x20
je 0x140058fa1
mov rax, r12
xor edx, edx
div rcx
jmp 0x140058fa8
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
movabs r12, 0x44b82fa09b5a53
je 0x140058fd6
xor edx, edx
div rcx
mov r8, rax
jmp 0x140058fdd
xor edx, edx
div ecx
mov r8d, eax
add r8, r9
mov rax, r8
shr rax, 9
mul r12
mov rax, rdx
shr rax, 0xb
mov rdx, qword [rsi + 0x4f0]
add rdx, rax
jb 0x14005963a
imul rax, rax, 0x3b9aca00
sub r8, rax
add r8d, dword [rsi + 0x4f8]
cmp r8d, 0x3b9aca00
jb 0x14005902b
inc rdx
je 0x14005963a
add r8d, 0xc4653600
mov rcx, qword [rsi + 0x500]
call fcn.140101780
cmp dword [r13 + 0x38], 0x3b9aca00
je 0x1400595a0
mov qword [rsp + 0xc0], rbp
mov rbp, r12
mov r12, qword [r13 + 0x60]
lea rcx, [r12 + 0x30]
mov rdx, qword [rdi]
call fcn.14001e2e0
xor ecx, ecx
mov eax, 3
lock cmpxchg qword [r12 + 0x10], rcx
cmp rax, 3
je 0x1400590fb
cmp rax, 4
je 0x1400595a0
cmp dword [rsi + 0x4e8], 0x3b9aca00
je 0x1400595a0
cmp byte [rsi + 0x509], 2
jb 0x1400595a0
mov rcx, qword [rsi + 0x500]
mov rdx, rdi
call fcn.1401018c0
test al, al
jne 0x1400595a0
cmp dword [rsi + 0x4e8], 0x3b9aca00
je 0x14005966f
mov rdi, qword [rsi + 0x500]
mov rcx, rdi
call fcn.140100990
lea rcx, [rdi + 8]
cmp qword [rdi], 0
je 0x14005963c
mov rax, qword [rcx]
lock dec qword [rax]
jne 0x14005964a
call fcn.140039210
jmp 0x14005964a
mov eax, dword [r13 + 0x38]
cmp eax, 0x3b9aca00
je 0x14005963a
shr r15, 0xb
imul ecx, r15d, 0x3b9aca00
sub r14d, ecx
mov rcx, qword [r13 + 0x30]
mov dword [r13 + 0x38], 0x3b9aca00
mov qword [rsp + 0xb8], r15
mov qword [rsp + 0xc8], r15
mov dword [rsp + 0xd0], r14d
mov qword [rsp + 0x28], rcx
mov dword [rsp + 0x30], eax
lea rcx, [rsp + 0xc8]
lea rdx, [rsp + 0x28]
call fcn.1400eadc0
mov r10, rax
mov r12d, edx
xor r15d, r15d
cmp edx, 0x3b9aca00
cmovne r15d, edx
cmp dword [rsi + 0x4e8], 0x3b9aca00
je 0x14005935c
mov r8d, 0x3b9aca00
cmp dword [r13 + 0x58], 0x3b9aca00
je 0x140059294
mov qword [rsp + 0x78], r10
mov qword [rsp + 0x28], 0
lea rcx, [rsp + 0x28]
call sub.kernel32.dll_QueryPerformanceCounter
test eax, eax
je 0x140059805
mov rax, qword [rsp + 0x28]
mov rcx, qword [0x140206100]
test rcx, rcx
mov r10, qword [rsp + 0x78]
jne 0x140059209
mov qword [rsp + 0xb0], rax
mov qword [rsp + 0x28], 0
lea rcx, [rsp + 0x28]
call sub.kernel32.dll_QueryPerformanceFrequency
test eax, eax
je 0x140059805
mov rcx, qword [rsp + 0x28]
mov qword [0x140206100], rcx
test rcx, rcx
mov r10, qword [rsp + 0x78]
mov rax, qword [rsp + 0xb0]
je 0x14005963a
mov rdx, rax
or rdx, rcx
shr rdx, 0x20
je 0x140059243
xor edx, edx
div rcx
jmp 0x140059247
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 0x140059045
jmp 0x1400595a0
xor edx, edx
div ecx
imul r9, rax, 0x3b9aca00
imul rax, rdx, 0x3b9aca00
mov rdx, rax
or rdx, rcx
shr rdx, 0x20
je 0x14005926b
xor edx, edx
div rcx
mov r8, rax
jmp 0x140059272
xor edx, edx
div ecx
mov r8d, eax
add r8, r9
mov rax, r8
shr rax, 9
mul rbp
shr rdx, 0xb
imul eax, edx, 0x3b9aca00
sub r8d, eax
mov qword [r13 + 0x50], rdx
mov dword [r13 + 0x58], r8d
movzx eax, byte [rsi + 0x509]
test rax, rax
je 0x1400592f1
cmp eax, 1
je 0x14005935c
cmp dword [r13 + 0x38], 0x3b9aca00
jne 0x14005935c
mov byte [rsi + 0x509], 1
cmp r8d, 0x3b9aca00
je 0x14005963a
mov rdx, qword [r13 + 0x50]
add rdx, qword [rsi + 0x4e0]
jb 0x14005963a
add r8d, dword [rsi + 0x4e8]
cmp r8d, 0x3b9aca00
jae 0x14005933a
mov rbp, r10
jmp 0x14005934d
cmp qword [rsp + 0xc0], 2
ja 0x140059305
cmp byte [rsi + 0x508], 0
je 0x14005935c
mov byte [rsi + 0x509], 1
cmp r8d, 0x3b9aca00
je 0x14005963a
mov rdx, qword [r13 + 0x50]
add rdx, qword [rsi + 0x4e0]
jb 0x14005963a
add r8d, dword [rsi + 0x4e8]
cmp r8d, 0x3b9aca00
jb 0x1400592ec
inc rdx
je 0x14005963a
mov rbp, r10
add r8d, 0xc4653600
mov rcx, qword [rsi + 0x500]
call fcn.140101780
mov r10, rbp
cmp dword [rsi + 0x4c0], 0x3b9aca00
mov r9, qword [rsp + 0xb8]
je 0x1400595a0
cmp qword [r13 + 0x20], 0
je 0x14005963a
mov rcx, qword [r13 + 0x28]
mov qword [r13 + 0x20], 1
mov qword [r13 + 0x28], 0
mov eax, dword [rsi + 0x4d8]
cmp rax, 0x1000000
je 0x14005947f
xorpd xmm0, xmm0
xorpd xmm1, xmm1
cmp r12d, 0x3b9aca00
je 0x1400593d7
movq xmm2, r10
punpckldq xmm2, xmmword [0x140199950]
subpd xmm2, xmmword [0x140199960]
movapd xmm1, xmm2
unpckhpd xmm1, xmm2
addsd xmm1, xmm2
mov edx, r15d
xorps xmm2, xmm2
cvtsi2sd xmm2, rdx
divsd xmm2, qword [0x140199970]
addsd xmm2, xmm1
movsd xmm1, qword [rsi + 0x4d0]
movapd xmm3, xmm2
subsd xmm3, xmm1
mulsd xmm3, qword [0x140199978]
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 [0x140199950]
subpd xmm2, xmmword [0x140199960]
movapd xmm1, xmm2
unpckhpd xmm1, xmm2
mulsd xmm0, qword [0x140199980]
addsd xmm1, xmm2
divsd xmm1, xmm0
ucomisd xmm4, xmm1
ja 0x14005947f
movsd qword [rsi + 0x4c8], xmm1
add rax, rax
movabs rdx, 0x5555555555555556
mul rdx
cmp rdx, rcx
jbe 0x1400595d9
mov rax, qword [rsi + 0x4b8]
cmp rax, 9
ja 0x1400594ee
mov ecx, dword [rsi + 0x4dc]
inc ecx
mov dword [rsi + 0x4dc], ecx
cmp ecx, 2
jb 0x1400594ee
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 0x14005963a
add r14d, dword [rsi + 0x4c0]
cmp r14d, 0x3b9aca00
jb 0x140059519
inc r9
je 0x14005963a
add r14d, 0xc4653600
mov qword [r13 + 0x40], r9
mov dword [r13 + 0x48], r14d
test cl, cl
je 0x1400595a0
mov rcx, rbx
call fcn.1401168fc
mov rcx, qword [rsi + 0x400]
mov edx, r12d
call fcn.14009d2d0
cmp dword [rsi + 0x438], 2
jb 0x1400595cd
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 0x1400595a8
mov rcx, rbx
call fcn.1401168fc
mov rdx, rsi
lea rcx, [rsp + 0x50]
mov r8, rdi
call fcn.14009f470
movzx ebx, byte [rsp + 0x50]
cmp bl, 6
jne 0x1400596ae
mov al, 2
jmp 0x1400597f1
mov byte [rsp + 0x51], 0xa
mov bl, 3
jmp 0x1400596ae
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 0x1400594f9
ud2
mov rax, qword [rcx]
lock dec qword [rax]
jne 0x14005964a
call fcn.140038e20
mov rax, qword [rdi + 0x48]
test rax, rax
je 0x14005965a
mov rcx, qword [rdi + 0x50]
call qword [rax + 0x18]
mov r8, qword [rsi + 0x500]
mov rcx, qword [0x140206128]
xor edx, edx
call sub.kernel32.dll_HeapFree
mov dword [rsi + 0x4e8], 0x3b9aca00
movupd xmm0, xmmword [rsp + 0x28]
movupd xmm1, xmmword [rsp + 0x38]
movupd xmmword [rsi + 0x4ec], xmm0
movupd xmmword [rsi + 0x4fc], xmm1
mov eax, dword [rsp + 0x48]
mov dword [rsi + 0x50c], eax
mov byte [r13 + 0x68], 1
mov rcx, rbx
call fcn.1401168fc
mov bl, 5
mov rax, qword [rsp + 0x70]
mov qword [rsp + 0x9f], rax
movzx eax, byte [rsp + 0x51]
mov rcx, qword [rsp + 0x52]
mov edx, dword [rsp + 0x5a]
movzx r8d, word [rsp + 0x5e]
movzx r9d, byte [rsp + 0x60]
movupd xmm0, xmmword [rsp + 0x61]
movapd xmmword [rsp + 0x90], xmm0
mov byte [rsp + 0x80], al
mov qword [rsp + 0x81], rcx
mov dword [rsp + 0x89], edx
mov word [rsp + 0x8d], r8w
mov byte [rsp + 0x8f], r9b
cmp dword [rsi], 3
je 0x14005980c
mov rcx, rsi
call fcn.14009b8f0
mov qword [rsi], 3
cmp bl, 5
je 0x1400597eb
mov byte [rsp + 0x50], bl
movapd xmm0, xmmword [rsp + 0x80]
movapd xmm1, xmmword [rsp + 0x90]
movupd xmmword [rsp + 0x51], xmm0
movupd xmmword [rsp + 0x61], xmm1
mov rax, qword [rsp + 0x9f]
mov qword [rsp + 0x70], rax
movzx eax, bl
lea ecx, [rax - 2]
cmp ecx, 2
jb 0x1400597eb
test eax, eax
je 0x1400597eb
cmp eax, 1
jne 0x14005978c
lea rcx, [rsp + 0x70]
mov rax, qword [rsp + 0x58]
mov rdx, qword [rsp + 0x60]
mov r8, qword [rsp + 0x68]
call qword [rax + 0x10]
jmp 0x1400597eb
mov rax, qword [rsp + 0x58]
mov ecx, eax
and ecx, 3
lea rdx, [rcx - 2]
cmp rdx, 2
jb 0x1400597eb
test rcx, rcx
je 0x1400597eb
lea rsi, [rax - 1]
mov rdi, qword [rax - 1]
mov r14, qword [rax + 7]
mov rcx, rdi
call qword [r14]
cmp qword [r14 + 8], 0
je 0x1400597da
cmp qword [r14 + 0x10], 0x11
jb 0x1400597c9
mov rdi, qword [rdi - 8]
mov rcx, qword [0x140206128]
xor edx, edx
mov r8, rdi
call sub.kernel32.dll_HeapFree
mov rcx, qword [0x140206128]
xor edx, edx
mov r8, rsi
call sub.kernel32.dll_HeapFree
cmp bl, 5
setne al
add rsp, 0xd8
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