Function at 0x14006b820
Capabilities:
Check for time delay via gettickcount
Get thread local storage value

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1f]
sub rsp, 0x98
mov qword [rbp - 0x39], 0xfffffffffffffffe
mov rsi, rdx
xor r15d, r15d
mov qword [rbp - 0x29], r15
xor eax, eax
mov qword [rbp - 0x21], rax
mov qword [rbp - 0x19], rax
mov r14d, r15d
or r13d, 0xffffffff
mov dword [rbp + 0x6f], r13d
mov dword [rbp + 0x77], r13d
mov r12d, r13d
mov dword [rbp + 0x7f], r13d
cmp rcx, 0xffffffffffffffff
je 0x14006b87d
mov dword [rbp + 0x6f], r15d
mov qword [rbp - 0x29], rcx
lea r14d, [r15 + 1]
mov ecx, dword [0x140104240]
cmp ecx, r13d
je 0x14006b8d8
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x14006b8d8
mov ecx, dword [0x140104240]
cmp ecx, r13d
jne 0x14006b8a3
mov rax, r15
jmp 0x14006b8af
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, dword [0x140104240]
cmp byte [rax + 0x70], r15b
je 0x14006b8d8
mov dword [rbp + 0x77], r14d
cmp ecx, r13d
jne 0x14006b8c3
mov rax, r15
jmp 0x14006b8c9
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rcx, qword [rax + 0x68]
mov eax, r14d
mov qword [rbp + rax*8 - 0x29], rcx
inc r14d
mov rbx, r15
mov qword [rbp - 0x41], rbx
cmp qword [rsi + 8], 0xffffffffffffffff
je 0x14006ba1e
cmp byte [rsi + 0x10], 0
je 0x14006b90d
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [rsi]
mov ecx, eax
mov rdx, qword [rsi + 8]
cmp rcx, rdx
jae 0x14006b908
sub rdx, rcx
jmp 0x14006b95e
mov rdx, r15
jmp 0x14006b95e
lea rdx, [0x14001c110]
lea rcx, [rbp + 0x67]
call fcn.14003c7c0
lea rdx, [rsi + 0x18]
mov rax, qword [rdx]
cmp qword [rbp + 0x67], rax
jl 0x14006b932
mov edx, r15d
jmp 0x14006b9d6
lea r8, [rbp + 0x67]
lea rcx, [rbp - 0x49]
call fcn.14003c670
movabs rax, 0x20c49ba5e353f7cf
imul qword [rbp - 0x49]
sar rdx, 7
mov rax, rdx
shr rax, 0x3f
inc rdx
add rdx, rax
mov ecx, 0xfffffffe
cmp rdx, rcx
seta al
test al, al
cmovne edx, ecx
cmp edx, 0x14
jbe 0x14006b9d6
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateWaitableTimerA]
mov rbx, rax
mov qword [rbp - 0x41], rax
test rax, rax
je 0x14006ba1e
mov rcx, rsi
call fcn.14006b5f0
mov qword [rbp + 0x67], rax
mov dword [rsp + 0x28], r15d
mov qword [rsp + 0x20], r15
xor r9d, r9d
xor r8d, r8d
lea rdx, [rbp + 0x67]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_SetWaitableTimer]
test eax, eax
setne al
test al, al
je 0x14006ba1e
mov r12d, r14d
mov dword [rbp + 0x7f], r14d
mov eax, r14d
mov qword [rbp + rax*8 - 0x29], rbx
inc r14d
jmp 0x14006ba1e
cmp byte [rsi + 0x10], 0
jne 0x14006ba1e
mov edi, edx
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [rbp - 0x11], eax
mov qword [rbp - 9], rdi
mov byte [rbp - 1], 1
lea rdx, [0x14001c110]
lea rcx, [rbp + 7]
call fcn.14003c7c0
mov rax, qword [rbp - 0x11]
mov qword [rsi], rax
mov rax, qword [rbp - 9]
mov qword [rsi + 8], rax
mov rax, qword [rbp - 1]
mov qword [rsi + 0x10], rax
mov rax, qword [rbp + 7]
mov qword [rsi + 0x18], rax
cmp r12d, r13d
setne cl
mov byte [rbp + 0x67], cl
xor r12b, r12b
mov byte [rbp - 0x49], r12b
mov r13d, r15d
mov dword [rbp - 0x45], r15d
mov rdi, qword [rbp - 0x49]
nop dword [rax]
test cl, cl
jne 0x14006ba64
lea rdx, [rbp - 0x31]
mov rcx, rsi
call fcn.14006bcb0
mov rdi, qword [rax]
mov qword [rbp - 0x49], rdi
mov r13d, dword [rbp - 0x45]
movzx r12d, byte [rbp - 0x49]
movzx ecx, byte [rbp + 0x67]
test r14d, r14d
je 0x14006baa1
mov r9, rdi
shr r9, 0x20
test cl, cl
mov ecx, 0xffffffff
cmovne r9d, ecx
xor r8d, r8d
lea rdx, [rbp - 0x29]
mov ecx, r14d
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, r14d
jae 0x14006baaa
cmp eax, dword [rbp + 0x6f]
je 0x14006bb02
cmp eax, dword [rbp + 0x77]
je 0x14006bacc
cmp eax, dword [rbp + 0x7f]
je 0x14006bb19
jmp 0x14006baaa
mov ecx, r13d
call qword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [rsi + 0x10], 0
je 0x14006babe
movabs rax, 0xffffffff00000002
add qword [rsi + 8], rax
test r12b, r12b
je 0x14006bb19
movzx ecx, byte [rbp + 0x67]
jmp 0x14006ba40
mov ecx, dword [0x140104240]
or eax, 0xffffffff
cmp ecx, eax
je 0x14006bae2
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov r15, rax
mov rcx, qword [r15 + 0x68]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
xor eax, eax
mov byte [rbp + 0x67], al
lea rdx, [0x140101100]
lea rcx, [rbp + 0x67]
call fcn.14008c5a8
nop
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x14006bb15
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
jmp 0x14006bb2e
lea rax, [rbx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x14006bb2c
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
add rsp, 0x98
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret