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

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
xor ebx, ebx
movsxd rsi, edx
cmp dword [rcx + 8], 1
mov rdi, r9
mov r15, r8
mov rbp, rcx
mov r14d, ebx
mov r13d, ebx
jne 0x140021598
mov eax, 0x8007045b
jmp 0x140021a0b
cmp dword [rcx + 0x90], ebx
jne 0x1400215a7
xor eax, eax
jmp 0x140021a0b
cmp esi, 0x20
ja 0x140021a06
call fcn.140038b70
test eax, eax
je 0x1400219ff
call fcn.140038f28
test eax, eax
je 0x1400219ff
cmp dword [rbp + 8], 1
je 0x14002158e
lea rax, [rbp + 0x40]
mov rcx, rax
mov qword [rsp + 0x50], rax
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [rbp + 8], 1
jne 0x1400215f3
mov r14d, 0x8007045b
jmp 0x1400219da
test rdi, rdi
je 0x140021635
mov rcx, qword [rbp + 0x88]
test rcx, rcx
je 0x140021611
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_]
mov qword [rbp + 0x88], rbx
cmp qword [rbp + 0x78], rbx
je 0x140021635
mov rcx, qword [rbp + 0x70]
xor r8d, r8d
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_DeleteTimerQueueTimer]
cmp rdi, qword [rbp + 0x78]
jne 0x1400219da
mov qword [rbp + 0x78], rbx
cmp qword [rbp + 0x10], rbx
je 0x1400219da
lea eax, [rsi + 2]
movsxd rcx, eax
mov eax, 4
mul rcx
mov rcx, 0xffffffffffffffff
cmovo rax, rcx
mov rcx, rax
call fcn.1401061b4
mov r13, rax
test rax, rax
jne 0x140021673
mov r14d, 0x8007000e
jmp 0x1400219da
xor eax, eax
mov r12d, ebx
mov word [rsp + 0x90], ax
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [rsp + 0x40], eax
mov rdx, rbx
mov r11d, eax
test esi, esi
jle 0x14002172d
mov r8, r13
mov r10d, dword [rbp + 0x38]
mov eax, ebx
mov r9, rbx
test r10d, r10d
jle 0x1400216c9
mov r11d, dword [r15 + rdx*4]
lea rcx, [rbp + 0x18]
cmp dword [rcx], r11d
je 0x1400216c4
inc eax
inc r9
add rcx, 0x10
cmp eax, r10d
jl 0x1400216b1
mov r11d, dword [rsp + 0x40]
cmp eax, r10d
jne 0x1400216d7
mov eax, dword [r15 + rdx*4]
mov dword [r8], eax
jmp 0x14002171a
mov rcx, r9
add rcx, rcx
cmp byte [rbp + rcx*8 + 0x24], 1
jne 0x140021705
lea rax, [r9 + 2]
add rax, rax
cmp r11d, dword [rbp + rax*8]
jb 0x1400216fe
or eax, 0xffffffff
sub eax, dword [rbp + rcx*8 + 0x1c]
cmp r11d, eax
jbe 0x140021705
mov byte [rbp + rcx*8 + 0x25], 1
jmp 0x140021721
mov eax, dword [r15 + rdx*4]
mov dword [r8], eax
mov word [rbp + rcx*8 + 0x24], bx
mov byte [rsp + r9 + 0x90], 1
inc r12d
add r8, 4
inc rdx
cmp rdx, rsi
jl 0x14002169b
or r15d, 0xffffffff
mov edx, ebx
cmp dword [rbp + 0x38], ebx
jle 0x140021795
movsxd rax, r12d
lea r8, [rsp + 0x90]
lea rcx, [rbp + 0x25]
lea r9, [rax*4]
add r9, r13
cmp byte [rcx], bl
je 0x140021787
cmp r11d, dword [rcx - 5]
jb 0x14002177e
or eax, 0xffffffff
sub eax, dword [rcx - 9]
cmp r11d, eax
ja 0x14002177e
mov eax, dword [rcx - 0xd]
inc r12d
mov dword [r9], eax
add r9, 4
mov word [rcx - 1], bx
mov byte [r8], 1
jmp 0x140021787
cmp r15d, dword [rcx - 9]
cmova r15d, dword [rcx - 9]
inc edx
inc r8
add rcx, 0x10
cmp edx, dword [rbp + 0x38]
jl 0x140021752
cmp dword [rbp + 8], 1
je 0x1400215e8
test r12d, r12d
jle 0x140021873
mov rsi, qword [rbp + 0x10]
mov rax, qword [rsi]
mov rdi, qword [rax + 0x28]
mov rcx, rdi
call qword [fcn.140009050]
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, rsi
call rdi
mov rcx, qword [rbp + 0x10]
lea r8, [rsp + 0x48]
lea rdx, [0x1401276b0]
call qword [sym.imp.ole32.dll_CoUnmarshalInterface]
mov r14d, eax
test eax, eax
js 0x1400218bf
mov rsi, qword [rsp + 0x48]
mov rax, qword [rsi]
mov rdi, qword [rax + 0x18]
mov rcx, rdi
call qword [fcn.140009050]
mov r8, r13
mov edx, r12d
mov rcx, rsi
call rdi
mov rsi, qword [rsp + 0x48]
mov r14d, eax
mov rax, qword [rsi]
mov rdi, qword [rax + 0x10]
mov rcx, rdi
call qword [fcn.140009050]
mov rcx, rsi
call rdi
test r14d, r14d
js 0x1400218bf
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov r10d, ebx
cmp dword [rbp + 0x38], ebx
jle 0x140021870
lea r9, [rsp + 0x90]
lea r8, [rbp + 0x20]
cmp byte [r9], bl
je 0x140021860
mov edx, dword [r8 - 4]
add edx, eax
mov word [r8 + 4], 1
mov dword [r8], edx
inc r10d
inc r9
add r8, 0x10
cmp r10d, dword [rbp + 0x38]
jl 0x14002184b
mov dword [rbp + 0x68], ebx
cmp r15d, 0xffffffff
je 0x1400219da
mov rcx, qword [rbp + 0x70]
cmp rcx, 0xffffffffffffffff
je 0x1400219da
mov rdx, qword [rbp + 0x78]
test rdx, rdx
je 0x14002190c
mov eax, dword [rsp + 0x40]
add eax, r15d
cmp eax, dword [rbp + 0x80]
jae 0x1400218b7
xor r9d, r9d
mov r8d, r15d
call qword [sym.imp.KERNEL32.dll_ChangeTimerQueueTimer]
test eax, eax
jne 0x1400219da
mov r14d, ebx
jmp 0x1400219da
mov ecx, dword [rbp + 0x68]
lea eax, [rcx + 1]
mov dword [rbp + 0x68], eax
cmp ecx, 3
jae 0x140021870
mov edx, ebx
cmp dword [rbp + 0x38], ebx
jle 0x140021904
lea rcx, [rsp + 0x90]
mov r8d, 0x64
lea rax, [rbp + 0x24]
cmp byte [rcx], bl
je 0x1400218f6
cmp r15d, r8d
mov word [rax], 0x101
cmova r15d, r8d
inc edx
inc rcx
add rax, 0x10
cmp edx, dword [rbp + 0x38]
jl 0x1400218e6
mov r14d, ebx
jmp 0x140021873
cmp dword [rbp + 8], 1
je 0x1400215e8
mov rcx, qword [rbp + 0x88]
test rcx, rcx
je 0x14002192f
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_]
mov qword [rbp + 0x88], rbx
mov ecx, reloc.OLEAUT32.dll_SafeArrayGetDim
call fcn.14010617c
mov qword [rsp + 0x90], rax
mov rdi, rax
test rax, rax
je 0x14002194e
mov qword [rax], rbp
jmp 0x140021951
mov rdi, rbx
test rdi, rdi
je 0x140021668
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov rdx, qword [rbp + 0x70]
lea rsi, [rdi + 8]
mov dword [rsp + 0x30], 0x28
lea r8, [0x140021a30]
mov rcx, rsi
mov dword [rsp + 0x28], ebx
mov r9, rdi
mov qword [rbp + 0x88], rdi
mov r12d, eax
mov dword [rsp + 0x20], r15d
call qword [sym.imp.KERNEL32.dll_CreateTimerQueueTimer]
test eax, eax
jne 0x1400219c9
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rbp + 0x88], rbx
mov rcx, rdi
movzx r14d, ax
or r14d, 0x80070000
mov qword [rsi], rbx
test eax, eax
mov qword [rdi], rbx
cmovle r14d, eax
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_]
jmp 0x1400219da
mov rax, qword [rsi]
mov qword [rbp + 0x78], rax
lea eax, [r12 + r15]
mov dword [rbp + 0x80], eax
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test r13, r13
je 0x1400219f3
mov rcx, r13
call qword [sym.imp.msvcrt.dll_void___cdecl_operator_delete___void____ptr64_]
test r14d, r14d
cmovns r14d, ebx
mov eax, r14d
jmp 0x140021a0b
mov eax, 0x8000ffff
jmp 0x140021a0b
mov eax, 0x80070057
lea r11, [rsp + 0x60]
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret