Function at 0x140019560
Capabilities:
Check for time delay via gettickcount

Disassembly:
push rbp
push rdi
lea rbp, [rsp - 0x4f]
sub rsp, 0x88
cmp byte [rcx], 0
mov rdi, rcx
je 0x140019588
movzx eax, word [0x14021f0c4]
add rsp, 0x88
pop rdi
pop rbp
ret
mov qword [rsp + 0x80], rbx
add rcx, 0x18
mov qword [rsp + 0x78], rsi
mov qword [rsp + 0x68], r14
mov qword [rsp + 0x60], r15
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x14021f0a8]
mov esi, dword [0x14021f0c4]
mov byte [rdi], 1
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [0x14021f0a4]
btr eax, 0x1f
cmp eax, 0xc8
jbe 0x14001974c
lea rcx, [rbp - 1]
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
test rbx, rbx
jne 0x140019743
mov rax, qword [rdi + 8]
test rax, rax
je 0x140019603
lea r8, [rbp + 0x77]
lea rdx, [rbp + 0x67]
lea rcx, [rbp + 0x6f]
call rax
jmp 0x1400196b6
mov rax, qword [rdi + 0x10]
mov qword [rbp + 0x6f], rbx
mov qword [rbp + 0x67], rbx
mov qword [rbp + 0x77], rbx
test rax, rax
je 0x1400196b6
mov r8d, dword [rdi + 0x48]
test r8d, r8d
je 0x1400196b6
mov rdx, qword [rdi + 0x40]
lea r9, [rdi + 0x48]
mov ecx, 8
call rax
test eax, eax
jne 0x1400196b6
mov ecx, dword [rdi + 0x48]
movabs rax, 0xaaaaaaaaaaaaaaab
mov r8, qword [rbp + 0x67]
mul rcx
mov rcx, qword [rbp + 0x77]
shr rdx, 5
movsxd r10, edx
test edx, edx
mov rdx, qword [rbp + 0x6f]
jle 0x140019692
mov rax, qword [rdi + 0x40]
mov r9, r10
add rax, 0x10
nop
add rdx, qword [rax - 0x10]
lea rax, [rax + 0x30]
mov qword [rbp + 0x6f], rdx
add r8, qword [rax - 0x38]
mov qword [rbp + 0x67], r8
add rcx, qword [rax - 0x30]
mov qword [rbp + 0x77], rcx
sub r9, 1
jne 0x140019670
mov rax, rdx
cqo
idiv r10
mov qword [rbp + 0x6f], rax
mov rax, r8
cqo
idiv r10
mov qword [rbp + 0x67], rax
mov rax, rcx
cqo
idiv r10
mov qword [rbp + 0x77], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r9, [rbp + 0x7f]
lea rax, [rbp - 9]
lea r8, [rbp + 7]
mov qword [rsp + 0x20], rax
lea rdx, [rbp + 0xf]
call qword [sym.imp.KERNEL32.dll_GetProcessTimes]
mov rax, qword [rbp - 1]
mov rcx, qword [rbp - 9]
mov qword [0x14021f0a8], rax
mov rax, qword [rbp + 0x6f]
mov qword [0x14021f100], rax
mov rax, qword [rbp + 0x67]
mov qword [0x14021f0b0], rax
mov rax, qword [rbp + 0x77]
mov qword [0x14021f0c8], rax
mov rax, qword [rbp + 0x7f]
mov qword [0x14021f0b8], rax
mov qword [0x14021f108], rcx
mov dword [0x14021f0c4], ebx
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [0x14021f0a4], eax
cmp byte [rdi], bl
je 0x14001973c
lea rcx, [rdi + 0x18]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov byte [rdi], bl
jmp 0x140019a6a
mov r15, qword [rbp - 1]
sub r15, rbx
jne 0x140019766
cmp byte [rdi], 0
je 0x14001975b
lea rcx, [rdi + 0x18]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov byte [rdi], 0
movzx eax, si
jmp 0x140019a6d
mov rax, qword [rdi + 8]
xor ebx, ebx
mov qword [rsp + 0x70], r12
test rax, rax
je 0x140019789
lea r8, [rbp + 0x77]
lea rdx, [rbp + 0x67]
lea rcx, [rbp + 0x6f]
call rax
jmp 0x140019846
mov rax, qword [rdi + 0x10]
mov qword [rbp + 0x6f], rbx
mov qword [rbp + 0x67], rbx
mov qword [rbp + 0x77], rbx
test rax, rax
je 0x140019846
mov r8d, dword [rdi + 0x48]
test r8d, r8d
je 0x140019846
mov rdx, qword [rdi + 0x40]
lea r9, [rdi + 0x48]
mov ecx, 8
call rax
test eax, eax
jne 0x140019846
mov ecx, dword [rdi + 0x48]
movabs rax, 0xaaaaaaaaaaaaaaab
mov r8, qword [rbp + 0x67]
mul rcx
mov rcx, qword [rbp + 0x77]
shr rdx, 5
movsxd r10, edx
test edx, edx
mov rdx, qword [rbp + 0x6f]
jle 0x140019822
mov rax, qword [rdi + 0x40]
mov r9, r10
add rax, 0x10
nop dword [rax + rax]
add rdx, qword [rax - 0x10]
lea rax, [rax + 0x30]
mov qword [rbp + 0x6f], rdx
add r8, qword [rax - 0x38]
mov qword [rbp + 0x67], r8
add rcx, qword [rax - 0x30]
mov qword [rbp + 0x77], rcx
sub r9, 1
jne 0x140019800
mov rax, rdx
cqo
idiv r10
mov qword [rbp + 0x6f], rax
mov rax, r8
cqo
idiv r10
mov qword [rbp + 0x67], rax
mov rax, rcx
cqo
idiv r10
mov qword [rbp + 0x77], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r9, [rbp + 0x7f]
lea rax, [rbp - 9]
lea r8, [rbp + 0x17]
mov qword [rsp + 0x20], rax
lea rdx, [rbp + 0x1f]
call qword [sym.imp.KERNEL32.dll_GetProcessTimes]
mov rsi, qword [rbp + 0x67]
mov r12, qword [rbp + 0x77]
mov rcx, rsi
sub rcx, qword [0x14021f0c8]
sub rcx, qword [0x14021f0b0]
mov r11, qword [rbp + 0x6f]
add rcx, r12
je 0x1400198a7
mov rax, qword [0x14021f100]
sub rax, r11
add rax, rcx
imul rax, rax, 0x64
cqo
idiv rcx
mov r10, rax
jmp 0x1400198aa
mov r10d, ebx
mov r8, qword [rbp - 9]
mov r9, qword [rbp + 0x7f]
mov rcx, qword [rbp - 1]
mov rax, r9
sub rax, qword [0x14021f108]
sub rax, qword [0x14021f0b8]
add rax, r8
mov qword [0x14021f0a8], rcx
imul rax, rax, 0x64
mov qword [0x14021f108], r8
mov r8d, dword [0x14021f0e4]
cqo
idiv r15
movsxd rdx, dword [0x14021f0c0]
inc r8d
mov qword [0x14021f0b0], rsi
lea rsi, [0x140000000]
mov qword [0x14021f0c8], r12
mov r12, qword [rsp + 0x70]
mov dword [rsi + rdx*4 + 0x21f0e8], eax
lea ecx, [rdx + 1]
mov dword [rsi + rdx*4 + 0x21f0d0], r10d
mov eax, 0x66666667
imul ecx
mov qword [0x14021f100], r11
mov r10d, ebx
sar edx, 1
mov eax, edx
mov qword [0x14021f0b8], r9
shr eax, 0x1f
add edx, eax
mov dword [0x14021f0e4], r8d
lea eax, [rdx + rdx*4]
mov edx, ebx
sub ecx, eax
mov dword [0x14021f0c0], ecx
cmp r8d, 5
jle 0x14001996b
mov r8d, 5
mov dword [0x14021f0e4], r8d
jmp 0x1400199e9
test r8d, r8d
jle 0x1400199e9
cmp r8d, 8
jb 0x1400199e9
mov ecx, r8d
xorps xmm2, xmm2
xorps xmm1, xmm1
and ecx, 0x80000007
jge 0x14001998e
dec ecx
or ecx, 0xfffffff8
inc ecx
mov eax, r8d
sub eax, ecx
movsxd rcx, eax
mov rax, rbx
nop dword [rax]
movdqu xmm0, xmmword [rsi + rax*4 + 0x21f0e8]
add edx, 8
paddd xmm2, xmm0
movdqu xmm0, xmmword [rsi + rax*4 + 0x21f0f8]
add rax, 8
paddd xmm1, xmm0
cmp rax, rcx
jl 0x1400199a0
paddd xmm1, xmm2
movdqa xmm0, xmm1
psrldq xmm0, 8
paddd xmm1, xmm0
movdqa xmm0, xmm1
psrldq xmm0, 4
paddd xmm1, xmm0
movd r10d, xmm1
mov r9d, ebx
cmp edx, r8d
jge 0x140019a3d
mov eax, r8d
movsxd rcx, edx
sub eax, edx
cmp eax, 2
jl 0x140019a2e
mov eax, r8d
sub eax, edx
sub eax, 2
shr eax, 1
inc eax
mov r11d, eax
lea eax, [rdx + rax*2]
add ebx, dword [rsi + rcx*4 + 0x21f0e8]
add r9d, dword [rsi + rcx*4 + 0x21f0ec]
add rcx, 2
sub r11, 1
jne 0x140019a10
cmp eax, r8d
jge 0x140019a36
add r10d, dword [rsi + rcx*4 + 0x21f0e8]
lea ecx, [r9 + rbx]
add r10d, ecx
mov eax, r10d
cdq
idiv r8d
mov ebx, eax
mov dword [0x14021f0c4], eax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
cmp byte [rdi], 0
mov dword [0x14021f0a4], eax
je 0x140019a67
lea rcx, [rdi + 0x18]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov byte [rdi], 0
movzx eax, bx
mov r14, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x78]
mov rbx, qword [rsp + 0x80]
mov r15, qword [rsp + 0x60]
add rsp, 0x88
pop rdi
pop rbp
ret