Function at 0x140040980
Capabilities:
Check for time delay via queryperformancecounter
Execute anti-debugging instructions

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x60
movapd xmmword [rsp + 0x50], xmm6
mov rsi, rcx
mov rax, qword [0x1400eb040]
xor rax, rsp
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x38], 0
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
lea rdx, [rsp + 0x38]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_QueryThreadCycleTime]
movsd xmm0, qword [0x1400faac0]
xorpd xmm6, xmm6
ucomisd xmm0, xmm6
jne 0x1400409dc
jnp 0x140040abe
ucomisd xmm0, xmm6
jne 0x1400409e4
jnp 0x140040a3e
movsd xmm1, qword [rsp + 0x38]
unpcklps xmm1, xmmword [0x1400ced90]
subpd xmm1, xmmword [0x1400ceda0]
movapd xmm2, xmm1
unpckhpd xmm2, xmm1
addsd xmm2, xmm1
divsd xmm2, xmm0
mulsd xmm2, qword [0x1400ced70]
cvttsd2si rax, xmm2
mov qword [rsi], rax
mov rcx, qword [rsp + 0x48]
xor rcx, rsp
call fcn.1400596c0
mov rax, rsi
movaps xmm6, xmmword [rsp + 0x50]
add rsp, 0x60
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
xor eax, eax
jmp 0x140040a16
lea rcx, [0x1400faae0]
call fcn.14005830c
cmp dword [0x1400faae0], 0xffffffff
jne 0x140040b28
lea rbx, [rsp + 0x40]
mov qword [rbx], 0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov rax, qword [rbx]
mov qword [0x1400faad8], rax
lea rcx, [0x1400faae0]
call fcn.1400583c0
jmp 0x140040b28
lea rcx, [0x1400faad0]
call fcn.14005830c
cmp dword [0x1400faad0], 0xffffffff
jne 0x140040b03
rdtsc
shl rdx, 0x20
or rdx, rax
mov qword [0x1400faac8], rdx
lea rcx, [0x1400faad0]
call fcn.1400583c0
jmp 0x140040b03
mov rbx, qword [sym.imp.KERNEL32.dll_GetCurrentThread]
call rbx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov edi, eax
call rbx
mov rcx, rax
mov edx, 2
call qword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov eax, dword [0x1400faad0]
mov ecx, dword [0x1400f9658]
mov rdx, qword gs:[0x58]
mov rcx, qword [rdx + rcx*8]
cmp eax, dword [rcx + 4]
jg 0x140040a8b
mov eax, dword [0x1400faae0]
mov ecx, dword [0x1400f9658]
mov rdx, qword gs:[0x58]
mov rcx, qword [rdx + rcx*8]
cmp eax, dword [rcx + 4]
jg 0x140040a42
rdtsc
mov rbx, rax
mov r14, rdx
xor r13d, r13d
lea r15, [rsp + 0x40]
mov qword [r15], r13
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov r12, qword [r15]
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov rcx, rax
mov edx, edi
call qword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov qword [r15], r13
lea rcx, [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
sub r12, qword [0x1400faad8]
jl 0x140040bde
cvtsi2sd xmm1, r12
xorps xmm0, xmm0
cvtsi2sd xmm0, qword [rsp + 0x40]
divsd xmm1, xmm0
xorpd xmm0, xmm0
movsd xmm2, qword [0x1400ced80]
ucomisd xmm2, xmm1
ja 0x1400409dc
shl r14, 0x20
or rbx, r14
sub rbx, qword [0x1400faac8]
jb 0x140040c30
movq xmm0, rbx
punpckldq xmm0, xmmword [0x1400ced90]
subpd xmm0, xmmword [0x1400ceda0]
haddpd xmm0, xmm0
divsd xmm0, xmm1
movsd qword [0x1400faac0], xmm0
movsd xmm0, qword [0x1400faac0]
jmp 0x1400409dc
call fcn.14006a1b0
mov ecx, dword [rax]
call fcn.140073184
mov rsi, rax
call fcn.14006a1b0
mov edi, dword [rax]
lea rcx, [0x1400cedb0]
call fcn.14008c410
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], edi
lea rcx, str.PERFETTO_CHECK_perf_counter_now___perf_counter_initial_
mov qword [rsp + 0x20], rcx
lea r9, str._s__errno:__d___s_
mov ecx, 3
mov rdx, rax
mov r8d, 0x5b
call fcn.14008c790
int3
call fcn.14006a1b0
mov ecx, dword [rax]
call fcn.140073184
mov rsi, rax
call fcn.14006a1b0
mov edi, dword [rax]
lea rcx, [0x1400cedb0]
call fcn.14008c410
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], edi
lea rcx, str.PERFETTO_CHECK_tsc_now___tsc_initial_
mov qword [rsp + 0x20], rcx
lea r9, str._s__errno:__d___s_
mov ecx, 3
mov rdx, rax
mov r8d, 0x66
call fcn.14008c790
int3