Function at 0x1800e9a40
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 r13d, r13d
mov qword [rbp - 0x29], r13
xor eax, eax
mov qword [rbp - 0x21], rax
mov qword [rbp - 0x19], rax
mov r12d, r13d
or r15d, 0xffffffff
mov dword [rbp + 0x6f], r15d
mov dword [rbp + 0x77], r15d
mov r14d, r15d
mov dword [rbp + 0x7f], r15d
cmp rcx, 0xffffffffffffffff
je 0x1800e9a9d
mov dword [rbp + 0x6f], r13d
mov qword [rbp - 0x29], rcx
lea r12d, [r13 + 1]
mov ecx, dword [0x1801c7a18]
cmp ecx, r15d
je 0x1800e9af8
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x1800e9af8
mov ecx, dword [0x1801c7a18]
cmp ecx, r15d
jne 0x1800e9ac3
mov rax, r13
jmp 0x1800e9acf
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, dword [0x1801c7a18]
cmp byte [rax + 0x30], r13b
je 0x1800e9af8
mov dword [rbp + 0x77], r12d
cmp ecx, r15d
jne 0x1800e9ae3
mov rax, r13
jmp 0x1800e9ae9
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rcx, qword [rax + 0x18]
mov eax, r12d
mov qword [rbp + rax*8 - 0x29], rcx
inc r12d
mov rbx, r13
mov qword [rbp - 0x41], rbx
cmp qword [rsi + 8], 0xffffffffffffffff
je 0x1800e9c30
cmp byte [rsi + 0x10], 0
je 0x1800e9b2d
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [rsi]
mov ecx, eax
mov rdx, qword [rsi + 8]
cmp rcx, rdx
jae 0x1800e9b28
sub rdx, rcx
jmp 0x1800e9b77
mov rdx, r13
jmp 0x1800e9b77
lea rcx, [rbp + 0x67]
call fcn.18005ef20
lea rdx, [rsi + 0x18]
mov rax, qword [rdx]
cmp qword [rbp + 0x67], rax
jl 0x1800e9b4b
mov edx, r13d
jmp 0x1800e9bef
lea r8, [rbp + 0x67]
lea rcx, [rbp - 0x49]
call fcn.18005ede0
movabs rax, 0x20c49ba5e353f7cf
imul qword [rbp - 0x49]
sar rdx, 7
mov rax, rdx
shr rax, 0x3f
add rdx, rax
inc rdx
mov ecx, 0xfffffffe
cmp rdx, rcx
seta al
test al, al
cmovne edx, ecx
cmp edx, 0x14
jbe 0x1800e9bef
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateWaitableTimerW]
mov rbx, rax
mov qword [rbp - 0x41], rax
test rax, rax
je 0x1800e9c30
mov rcx, rsi
call fcn.1800e9670
mov qword [rbp + 0x67], rax
mov dword [rsp + 0x28], r13d
mov qword [rsp + 0x20], r13
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 0x1800e9c30
mov r14d, r12d
mov dword [rbp + 0x7f], r12d
mov eax, r12d
mov qword [rbp + rax*8 - 0x29], rbx
inc r12d
jmp 0x1800e9c30
cmp byte [rsi + 0x10], 0
jne 0x1800e9c30
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 rcx, [rbp + 7]
call fcn.18005ef20
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 r14d, r15d
setne cl
mov byte [rbp + 0x67], cl
xor r14b, r14b
mov byte [rbp - 0x49], r14b
mov r15d, r13d
mov dword [rbp - 0x45], r13d
mov rdi, qword [rbp - 0x49]
nop dword [rax + rax]
test cl, cl
jne 0x1800e9c74
lea rdx, [rbp - 0x31]
mov rcx, rsi
call fcn.18009db70
mov rdi, qword [rax]
mov qword [rbp - 0x49], rdi
mov r15d, dword [rbp - 0x45]
movzx r14d, byte [rbp - 0x49]
movzx ecx, byte [rbp + 0x67]
test r12d, r12d
je 0x1800e9cb1
mov r9, rdi
shr r9, 0x20
test cl, cl
mov ecx, 0xffffffff
cmovne r9d, ecx
xor r8d, r8d
lea rdx, [rbp - 0x29]
mov ecx, r12d
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, r12d
jae 0x1800e9cba
cmp eax, dword [rbp + 0x6f]
je 0x1800e9d16
cmp eax, dword [rbp + 0x77]
je 0x1800e9cde
cmp eax, dword [rbp + 0x7f]
je 0x1800e9cdc
jmp 0x1800e9cba
mov ecx, r15d
call qword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [rsi + 0x10], 0
je 0x1800e9cce
movabs rax, 0xffffffff00000002
add qword [rsi + 8], rax
test r14b, r14b
je 0x1800e9d2e
movzx ecx, byte [rbp + 0x67]
jmp 0x1800e9c50
jmp 0x1800e9d2e
mov ecx, dword [0x1801c7a18]
or eax, 0xffffffff
cmp ecx, eax
je 0x1800e9cf4
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov r13, rax
mov rcx, qword [r13 + 0x18]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
xor r11d, r11d
mov byte [rbp + 0x67], r11b
lea rdx, [0x1801c0f08]
lea rcx, [rbp + 0x67]
call fcn.1800c3ae4
nop
test rbx, rbx
je 0x1800e9d2a
cmp rbx, 0xffffffffffffffff
je 0x1800e9d2a
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
jmp 0x1800e9d44
test rbx, rbx
je 0x1800e9d42
cmp rbx, 0xffffffffffffffff
je 0x1800e9d42
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