Function at 0x14003a670
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
mov rax, rsp
push rbp
push r13
lea rbp, [rax - 0x5f]
sub rsp, 0x88
mov r13, qword [rcx]
test r13, r13
je 0x14003aedd
mov qword [rax + 0x18], rbx
mov qword [rax - 0x18], rsi
mov qword [rax - 0x20], rdi
xor edi, edi
mov qword [rax - 0x28], r12
mov qword [rax - 0x30], r14
mov qword [rax - 0x38], r15
mov eax, edi
lea rsi, [rdi - 1]
lea r15, [r13 + 0x30]
lea rcx, [rbp - 0x19]
mov dword [rbp + 0x67], eax
inc eax
mov qword [rbp - 0x19], r15
mov qword [rbp - 1], rdi
mov r12d, edi
mov qword [rbp - 9], rdi
mov qword [rbp - 0x11], rdi
xchg qword [r15], rcx
mov dword [rbp + 0x6f], eax
test rcx, rcx
je 0x14003a73d
lea rax, [rbp - 0x19]
xchg qword [rcx + 8], rax
xor eax, eax
lock cmpxchg qword [rcx + 0x18], rsi
lea rcx, [rax - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x14003a6fb
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rax, rdi
lock xadd qword [rbp - 9], rax
test rax, rax
jne 0x14003a73d
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
xor eax, eax
lock cmpxchg qword [rbp - 9], rbx
jne 0x14003a734
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rax, qword [r13 + 0x58]
mov rbx, rdi
mov qword [r13 + 0x60], rax
mov rcx, qword [rbp - 0x19]
lock xadd qword [rbp - 0x11], rbx
test rbx, rbx
jne 0x14003a7ba
lea rax, [rbp - 0x19]
lock cmpxchg qword [rcx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x14003a820
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003a7af
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rbx
jne 0x14003a7a6
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, rdi
lock xadd qword [rbp - 0x11], rbx
jmp 0x14003a7fe
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003a7fe
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rdi, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rdi
jne 0x14003a7f3
mov edx, 0xffffffff
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
xor eax, eax
lock cmpxchg qword [rbx + 0x10], rsi
lea rcx, [rax - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x14003a820
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop dword [rax]
lea rcx, [rbp - 0x19]
mov qword [rbp - 0x19], r15
mov qword [rbp - 1], rdi
mov qword [rbp - 9], rdi
mov qword [rbp - 0x11], rdi
xchg qword [r15], rcx
test rcx, rcx
je 0x14003a8a1
lea rax, [rbp - 0x19]
xchg qword [rcx + 8], rax
xor eax, eax
lock cmpxchg qword [rcx + 0x18], rsi
lea rcx, [rax - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x14003a85f
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rax, rdi
lock xadd qword [rbp - 9], rax
test rax, rax
jne 0x14003a8a1
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
xor eax, eax
lock cmpxchg qword [rbp - 9], rbx
jne 0x14003a898
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, qword [r13 + 0x60]
test rbx, rbx
je 0x14003add9
mov rcx, qword [rbx + 8]
lea rdx, [rbp + 7]
add rcx, 0x10
mov qword [rbp + 0x1f], rdi
mov qword [rbp + 7], rcx
xor eax, eax
mov qword [rbp + 0x17], rdi
mov qword [rbp + 0xf], rdi
lock cmpxchg qword [rcx], rdx
je 0x14003a9b8
mov rcx, qword [rbp - 0x19]
mov rbx, rdi
lock xadd qword [rbp - 0x11], rbx
test rbx, rbx
jne 0x14003a94c
lea rax, [rbp - 0x19]
lock cmpxchg qword [rcx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x14003a9ab
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003a941
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rbx
jne 0x14003a938
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, rdi
lock xadd qword [rbp - 0x11], rbx
jmp 0x14003a990
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003a990
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rdi, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rdi
jne 0x14003a985
mov edx, 0xffffffff
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
xor eax, eax
lock cmpxchg qword [rbx + 0x10], rsi
lea rcx, [rax - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x14003a9ab
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x14003a820
mov rax, qword [rbx + 0x10]
mov qword [r13 + 0x60], rax
mov rdi, qword [rbx + 8]
mov ecx, dword [rdi]
mov r14, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, dword [rdi]
xor edx, edx
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test rsi, rsi
je 0x14003abbb
cmp dword [rbp + 0x67], 4
jge 0x14003abbb
mov rcx, qword [rbp - 0x19]
xor edi, edi
mov ebx, edi
lock xadd qword [rbp - 0x11], rbx
test rbx, rbx
jne 0x14003aa65
lea rax, [rbp - 0x19]
lock cmpxchg qword [rcx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x14003aacb
mov eax, edi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003aa5a
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rbx
jne 0x14003aa51
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, rdi
lock xadd qword [rbp - 0x11], rbx
jmp 0x14003aaa9
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003aaa9
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rdi, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rdi
jne 0x14003aa9e
mov edx, 0xffffffff
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rbx + 0x10], rcx
lea rcx, [rax - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x14003aacb
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [rbp + 7]
mov rbx, rdi
lock xadd qword [rbp + 0xf], rbx
test rbx, rbx
jne 0x14003ab40
lea rax, [rbp + 7]
lock cmpxchg qword [rcx], rdi
lea rcx, [rbp + 7]
cmp rcx, rax
je 0x14003aba6
mov rax, rdi
lock xadd qword [rbp + 0x1f], rax
test rax, rax
jne 0x14003ab35
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
xor eax, eax
lock cmpxchg qword [rbp + 0x1f], rbx
jne 0x14003ab2c
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, rdi
lock xadd qword [rbp + 0xf], rbx
jmp 0x14003ab84
mov rax, rdi
lock xadd qword [rbp + 0x1f], rax
test rax, rax
jne 0x14003ab84
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rdi, rax
xor eax, eax
lock cmpxchg qword [rbp + 0x1f], rdi
jne 0x14003ab79
mov edx, 0xffffffff
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rbx + 0x10], rcx
lea rcx, [rax - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x14003aba6
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
inc r12d
mov rcx, rsi
call r14
mov rsi, 0xffffffffffffffff
jmp 0x14003a820
mov rcx, qword [rbx + 0x20]
mov rax, qword [rbx + 0x10]
test rcx, rcx
je 0x14003abcc
mov qword [rcx + 0x10], rax
test rax, rax
je 0x14003abd5
mov qword [rax + 0x20], rcx
mov rcx, qword [rbx]
cmp qword [rcx + 0x58], rbx
jne 0x14003abe5
mov qword [rcx + 0x58], rax
mov rcx, qword [rbx]
cmp qword [rcx + 0x60], rbx
jne 0x14003abef
mov qword [rcx + 0x60], rax
mov rcx, qword [rbx + 0x28]
mov rax, qword [rbx + 0x18]
test rcx, rcx
je 0x14003ac00
mov qword [rcx + 0x18], rax
test rax, rax
je 0x14003ac09
mov qword [rax + 0x28], rcx
mov rcx, qword [rbx + 8]
cmp qword [rcx + 0x18], rbx
jne 0x14003ac17
mov qword [rcx + 0x18], rax
mov rcx, rbx
call fcn.1400108e4
mov rcx, qword [rbp - 0x19]
xor edi, edi
mov ebx, edi
lock xadd qword [rbp - 0x11], rbx
test rbx, rbx
jne 0x14003ac94
lea rax, [rbp - 0x19]
lock cmpxchg qword [rcx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x14003acfc
mov eax, edi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003ac89
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rbx
jne 0x14003ac80
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, rdi
lock xadd qword [rbp - 0x11], rbx
jmp 0x14003acd8
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003acd8
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rdi, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rdi
jne 0x14003accd
mov edx, 0xffffffff
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
xor eax, eax
mov rsi, 0xffffffffffffffff
lock cmpxchg qword [rbx + 0x10], rsi
lea rcx, [rax - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x14003ad03
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x14003ad03
mov rsi, 0xffffffffffffffff
mov rcx, qword [rbp + 7]
mov rbx, rdi
lock xadd qword [rbp + 0xf], rbx
test rbx, rbx
jne 0x14003ad78
lea rax, [rbp + 7]
lock cmpxchg qword [rcx], rdi
lea rcx, [rbp + 7]
cmp rcx, rax
je 0x14003a820
mov rax, rdi
lock xadd qword [rbp + 0x1f], rax
test rax, rax
jne 0x14003ad6d
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
xor eax, eax
lock cmpxchg qword [rbp + 0x1f], rbx
jne 0x14003ad64
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, rdi
lock xadd qword [rbp + 0xf], rbx
jmp 0x14003adbc
mov rax, rdi
lock xadd qword [rbp + 0x1f], rax
test rax, rax
jne 0x14003adbc
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rdi, rax
xor eax, eax
lock cmpxchg qword [rbp + 0x1f], rdi
jne 0x14003adb1
mov edx, 0xffffffff
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
xor eax, eax
lock cmpxchg qword [rbx + 0x10], rsi
je 0x14003a820
cmp rax, 0xffffffffffffffff
je 0x14003a820
jmp 0x14003a810
mov rcx, qword [rbp - 0x19]
mov rbx, rdi
lock xadd qword [rbp - 0x11], rbx
test rbx, rbx
jne 0x14003ae4e
lea rax, [rbp - 0x19]
lock cmpxchg qword [rcx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x14003aead
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003ae43
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbx, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rbx
jne 0x14003ae3a
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rbx, rdi
lock xadd qword [rbp - 0x11], rbx
jmp 0x14003ae92
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14003ae92
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rdi, rax
xor eax, eax
lock cmpxchg qword [rbp - 1], rdi
jne 0x14003ae87
mov edx, 0xffffffff
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
xor eax, eax
lock cmpxchg qword [rbx + 0x10], rsi
lea rcx, [rax - 1]
cmp rcx, 0xfffffffffffffffd
ja 0x14003aead
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [rbp + 0x6f]
test r12d, r12d
jne 0x14003a6b1
mov r15, qword [rsp + 0x60]
mov r14, qword [rsp + 0x68]
mov r12, qword [rsp + 0x70]
mov rdi, qword [rsp + 0x78]
mov rsi, qword [rsp + 0x80]
mov rbx, qword [rsp + 0xb0]
add rsp, 0x88
pop r13
pop rbp
ret