Function at 0x140018220
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 0x140018248
movzx eax, word [0x1401f2924]
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 [0x1401f2908]
mov esi, dword [0x1401f2924]
mov byte [rdi], 1
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [0x1401f2904]
btr eax, 0x1f
cmp eax, 0xc8
jbe 0x14001840c
lea rcx, [rbp - 1]
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
test rbx, rbx
jne 0x140018403
mov rax, qword [rdi + 8]
test rax, rax
je 0x1400182c3
lea r8, [rbp + 0x77]
lea rdx, [rbp + 0x67]
lea rcx, [rbp + 0x6f]
call rax
jmp 0x140018376
mov rax, qword [rdi + 0x10]
mov qword [rbp + 0x6f], rbx
mov qword [rbp + 0x67], rbx
mov qword [rbp + 0x77], rbx
test rax, rax
je 0x140018376
mov r8d, dword [rdi + 0x48]
test r8d, r8d
je 0x140018376
mov rdx, qword [rdi + 0x40]
lea r9, [rdi + 0x48]
mov ecx, 8
call rax
test eax, eax
jne 0x140018376
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 0x140018352
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 0x140018330
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 [0x1401f2908], rax
mov rax, qword [rbp + 0x6f]
mov qword [0x1401f2960], rax
mov rax, qword [rbp + 0x67]
mov qword [0x1401f2910], rax
mov rax, qword [rbp + 0x77]
mov qword [0x1401f2928], rax
mov rax, qword [rbp + 0x7f]
mov qword [0x1401f2918], rax
mov qword [0x1401f2968], rcx
mov dword [0x1401f2924], ebx
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [0x1401f2904], eax
cmp byte [rdi], bl
je 0x1400183fc
lea rcx, [rdi + 0x18]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov byte [rdi], bl
jmp 0x14001872a
mov r15, qword [rbp - 1]
sub r15, rbx
jne 0x140018426
cmp byte [rdi], 0
je 0x14001841b
lea rcx, [rdi + 0x18]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov byte [rdi], 0
movzx eax, si
jmp 0x14001872d
mov rax, qword [rdi + 8]
xor ebx, ebx
mov qword [rsp + 0x70], r12
test rax, rax
je 0x140018449
lea r8, [rbp + 0x77]
lea rdx, [rbp + 0x67]
lea rcx, [rbp + 0x6f]
call rax
jmp 0x140018506
mov rax, qword [rdi + 0x10]
mov qword [rbp + 0x6f], rbx
mov qword [rbp + 0x67], rbx
mov qword [rbp + 0x77], rbx
test rax, rax
je 0x140018506
mov r8d, dword [rdi + 0x48]
test r8d, r8d
je 0x140018506
mov rdx, qword [rdi + 0x40]
lea r9, [rdi + 0x48]
mov ecx, 8
call rax
test eax, eax
jne 0x140018506
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 0x1400184e2
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 0x1400184c0
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 [0x1401f2928]
sub rcx, qword [0x1401f2910]
mov r11, qword [rbp + 0x6f]
add rcx, r12
je 0x140018567
mov rax, qword [0x1401f2960]
sub rax, r11
add rax, rcx
imul rax, rax, 0x64
cqo
idiv rcx
mov r10, rax
jmp 0x14001856a
mov r10d, ebx
mov r8, qword [rbp - 9]
mov r9, qword [rbp + 0x7f]
mov rcx, qword [rbp - 1]
mov rax, r9
sub rax, qword [0x1401f2968]
sub rax, qword [0x1401f2918]
add rax, r8
mov qword [0x1401f2908], rcx
imul rax, rax, 0x64
mov qword [0x1401f2968], r8
mov r8d, dword [0x1401f2944]
cqo
idiv r15
movsxd rdx, dword [0x1401f2920]
inc r8d
mov qword [0x1401f2910], rsi
lea rsi, [0x140000000]
mov qword [0x1401f2928], r12
mov r12, qword [rsp + 0x70]
mov dword [rsi + rdx*4 + 0x1f2948], eax
lea ecx, [rdx + 1]
mov dword [rsi + rdx*4 + 0x1f2930], r10d
mov eax, 0x66666667
imul ecx
mov qword [0x1401f2960], r11
mov r10d, ebx
sar edx, 1
mov eax, edx
mov qword [0x1401f2918], r9
shr eax, 0x1f
add edx, eax
mov dword [0x1401f2944], r8d
lea eax, [rdx + rdx*4]
mov edx, ebx
sub ecx, eax
mov dword [0x1401f2920], ecx
cmp r8d, 5
jle 0x14001862b
mov r8d, 5
mov dword [0x1401f2944], r8d
jmp 0x1400186a9
test r8d, r8d
jle 0x1400186a9
cmp r8d, 8
jb 0x1400186a9
mov ecx, r8d
xorps xmm2, xmm2
xorps xmm1, xmm1
and ecx, 0x80000007
jge 0x14001864e
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 + 0x1f2948]
add edx, 8
paddd xmm2, xmm0
movdqu xmm0, xmmword [rsi + rax*4 + 0x1f2958]
add rax, 8
paddd xmm1, xmm0
cmp rax, rcx
jl 0x140018660
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 0x1400186fd
mov eax, r8d
movsxd rcx, edx
sub eax, edx
cmp eax, 2
jl 0x1400186ee
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 + 0x1f2948]
add r9d, dword [rsi + rcx*4 + 0x1f294c]
add rcx, 2
sub r11, 1
jne 0x1400186d0
cmp eax, r8d
jge 0x1400186f6
add r10d, dword [rsi + rcx*4 + 0x1f2948]
lea ecx, [r9 + rbx]
add r10d, ecx
mov eax, r10d
cdq
idiv r8d
mov ebx, eax
mov dword [0x1401f2924], eax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
cmp byte [rdi], 0
mov dword [0x1401f2904], eax
je 0x140018727
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