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

Disassembly:
mov rax, rsp
push rbp
push rdi
push r14
lea rbp, [rax - 0x5f]
sub rsp, 0xe0
mov qword [rbp - 0x29], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
movaps xmmword [rax - 0x28], xmm6
mov rax, qword [0x1400e7708]
xor rax, rsp
mov qword [rbp + 0x27], rax
mov rbx, rdx
mov rdi, rcx
lea rcx, [rbp - 0x49]
call qword [sym.imp.api_ms_win_core_profile_l1_1_0.dll_QueryPerformanceCounter]
mov rax, qword [rdi + 0x50]
cmp qword [rbp - 0x49], rax
jl 0x140050c4f
mov al, byte [rdi + 0x81]
xor esi, esi
test al, al
jne 0x140050c4f
mov al, byte [rdi + 0x80]
test al, al
jne 0x140050c4f
lea eax, [rsi + 1]
xchg byte [rdi + 0x81], al
xorps xmm0, xmm0
movss dword [rbp - 0x69], xmm0
lea r14, [rdi + 0x88]
lea r8, [rbp - 0x69]
movss xmm1, dword [rbx + 8]
mov rcx, r14
call fcn.14004fca8
test al, al
je 0x140050beb
movss xmm0, dword [rdi + 0x58]
movss xmm6, dword [rbp - 0x69]
comiss xmm0, xmm6
ja 0x140050b39
comiss xmm6, dword [rdi + 0x5c]
ja 0x140050b39
inc dword [rdi + 0x64]
call fcn.14000df44
mov rcx, qword [rax + 8]
test rcx, rcx
je 0x140050a30
cmp dword [rcx], esi
jbe 0x140050a30
call fcn.14000df44
movss dword [rsp + 0x28], xmm6
mov eax, dword [rdi + 0x6c]
mov dword [rsp + 0x20], eax
mov r9d, dword [rdi + 0x70]
mov r8d, dword [rdi + 0x64]
xor edx, edx
call fcn.1400512b4
mov eax, dword [rdi + 0x68]
cmp dword [rdi + 0x64], eax
jb 0x140050c10
mov eax, dword [rdi + 0x6c]
cmp dword [rdi + 0x70], eax
je 0x140050c10
mov eax, 1
xchg byte [rdi + 0x80], al
mov qword [rbp - 0x39], rdi
movss xmm0, dword [rbp - 0x69]
movss dword [rbp - 0x31], xmm0
movups xmm1, xmmword [rbp - 0x39]
movaps xmmword [rbp - 0x39], xmm1
lea rax, [0x1400aaec8]
mov qword [rbp - 0x19], rax
movdqu xmmword [rbp - 0x11], xmm1
lea rax, [rbp - 0x19]
mov qword [rbp + 0x1f], rax
lea rdx, [rbp - 0x19]
lea rcx, [rbp - 0x61]
call fcn.1400114dc
nop
mov rcx, qword [rbp + 0x1f]
test rcx, rcx
je 0x140050aaf
mov rax, qword [rcx]
lea rdx, [rbp - 0x19]
cmp rcx, rdx
setne dl
mov rax, qword [rax + 0x20]
call qword [case.0x1400a0b76.0]
lea rbx, [rdi + 0x98]
mov r14, qword [rbx + 0x10]
test r14, r14
je 0x140050ad6
mov edx, 1
mov rcx, r14
call qword [sym.imp.api_ms_win_core_threadpool_l1_2_0.dll_WaitForThreadpoolWorkCallbacks]
mov rcx, r14
call qword [sym.imp.api_ms_win_core_threadpool_l1_2_0.dll_CloseThreadpoolWork]
mov rax, qword [rbp - 0x51]
mov qword [rbx + 0x10], rax
mov qword [rbp - 0x51], rsi
lea rax, [rbp - 0x61]
cmp rbx, rax
je 0x140050b2b
mov rax, qword [rbp - 0x61]
mov qword [rbp - 0x61], rsi
mov r14, qword [rbx]
mov qword [rbx], rax
test r14, r14
je 0x140050b2b
mov rcx, qword [r14 + 0x38]
test rcx, rcx
je 0x140050b1e
mov rax, qword [rcx]
cmp rcx, r14
setne dl
mov rax, qword [rax + 0x20]
call qword [case.0x1400a0b76.0]
mov qword [r14 + 0x38], rsi
mov edx, 0x40
mov rcx, r14
call fcn.1400a07d8
lea rcx, [rbp - 0x61]
call fcn.140011fa0
jmp 0x140050c10
mov dword [rdi + 0x64], esi
mov ecx, esi
mov rax, qword [rdi + 0x30]
mov rdx, qword [rdi + 0x38]
jmp 0x140050b64
movss xmm0, dword [rax + 4]
comiss xmm6, xmm0
jb 0x140050b5b
movss dword [rdi + 0x58], xmm0
mov ecx, dword [rax]
jmp 0x140050b60
comiss xmm0, xmm6
ja 0x140050b6b
add rax, 8
cmp rax, rdx
jne 0x140050b48
jmp 0x140050b70
movss dword [rdi + 0x5c], xmm0
cmp ecx, dword [rdx - 8]
jne 0x140050b7b
mov eax, dword [rdi + 0x58]
mov dword [rdi + 0x5c], eax
mov dword [rdi + 0x6c], ecx
mov rax, qword [r14]
mov rcx, qword [rax]
mov qword [rax], rax
mov rax, qword [r14]
mov qword [rax + 8], rax
mov qword [r14 + 8], rsi
cmp rcx, qword [r14]
je 0x140050bac
mov rbx, qword [rcx]
mov edx, 0x18
call fcn.1400a07d8
mov rcx, rbx
cmp rbx, qword [r14]
jne 0x140050b97
cvttss2si rbx, dword [rdi + 0x5c]
cvttss2si r14, dword [rdi + 0x58]
call fcn.14000df44
mov rcx, qword [rax + 8]
test rcx, rcx
je 0x140050c10
cmp dword [rcx], esi
jbe 0x140050c10
call fcn.14000df44
movss dword [rsp + 0x28], xmm6
mov eax, dword [rdi + 0x6c]
mov dword [rsp + 0x20], eax
mov r9d, ebx
mov r8d, r14d
xor edx, edx
call fcn.1400513c4
jmp 0x140050c10
call fcn.14000df44
mov rcx, qword [rax + 8]
test rcx, rcx
je 0x140050c10
cmp dword [rcx], esi
jbe 0x140050c10
call fcn.14000df44
lea r8, str.Not_enough_samples.
xor edx, edx
call fcn.140051098
lea rcx, [rbp - 0x41]
call qword [sym.imp.api_ms_win_core_profile_l1_1_0.dll_QueryPerformanceCounter]
mov ecx, dword [rdi + 0x48]
imul rcx, qword [0x1400e8950]
movabs rax, 0x20c49ba5e353f7cf
imul rcx
sar rdx, 7
mov rax, rdx
shr rax, 0x3f
add rdx, rax
add rdx, qword [rbp - 0x41]
mov qword [rdi + 0x50], rdx
xchg byte [rdi + 0x81], sil
mov rcx, qword [rbp + 0x27]
xor rcx, rsp
call fcn.1400a01e0
lea r11, [rsp + 0xe0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
movaps xmm6, xmmword [r11 - 0x10]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret