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

Disassembly:
mov rax, rsp
push rbp
push r13
mov rbp, rsp
sub rsp, 0x78
mov r13, qword [rcx]
test r13, r13
je 0x1400180fd
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov qword [rax - 0x18], r12
xor esi, esi
mov qword [rax - 0x20], r14
mov qword [rax - 0x28], r15
or r14, 0xffffffffffffffff
lea r15, [r13 + 0x30]
mov edi, esi
nop dword [rax]
inc edi
lea rcx, [rbp - 0x58]
mov qword [rbp - 0x58], r15
mov qword [rbp - 0x40], rsi
mov qword [rbp - 0x48], rsi
mov qword [rbp - 0x50], rsi
xchg qword [r15], rcx
mov r12d, esi
mov dword [rbp + 0x18], edi
test rcx, rcx
je 0x140017bbf
lea rax, [rbp - 0x58]
mov qword [rcx + 8], rax
xor eax, eax
lock cmpxchg qword [rcx + 0x18], r14
je 0x140017b7f
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rax, rsi
lock xadd qword [rbp - 0x48], rax
test rax, rax
jne 0x140017bbf
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 - 0x48], rbx
jne 0x140017bb6
or 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 rcx, rsi
mov qword [r13 + 0x60], rax
mov rdx, qword [rbp - 0x58]
lock xadd qword [rbp - 0x50], rcx
test rcx, rcx
jne 0x140017c34
lea rax, [rbp - 0x58]
lock cmpxchg qword [rdx], rsi
lea rcx, [rbp - 0x58]
cmp rcx, rax
je 0x140017c50
mov rax, rsi
lock xadd qword [rbp - 0x40], rax
test rax, rax
jne 0x140017c2b
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 - 0x40], rbx
jne 0x140017c22
or edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
lock xadd qword [rbp - 0x50], rcx
xor eax, eax
lock cmpxchg qword [rcx + 0x10], r14
je 0x140017c50
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop word [rax + rax]
lea rcx, [rbp - 0x58]
mov qword [rbp - 0x58], r15
mov qword [rbp - 0x40], rsi
mov qword [rbp - 0x48], rsi
mov qword [rbp - 0x50], rsi
xchg qword [r15], rcx
test rcx, rcx
je 0x140017cc7
lea rax, [rbp - 0x58]
mov qword [rcx + 8], rax
xor eax, eax
lock cmpxchg qword [rcx + 0x18], r14
je 0x140017c87
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rax, rsi
lock xadd qword [rbp - 0x48], rax
test rax, rax
jne 0x140017cc7
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 - 0x48], rbx
jne 0x140017cbe
or 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 0x14001804d
mov rcx, qword [rbx + 8]
lea rdx, [rbp - 0x38]
mov qword [rbp - 0x20], rsi
add rcx, 0x10
mov qword [rbp - 0x28], rsi
mov qword [rbp - 0x30], rsi
mov qword [rbp - 0x38], rcx
xor eax, eax
lock cmpxchg qword [rcx], rdx
je 0x140017d8a
mov rdx, qword [rbp - 0x58]
mov rcx, rsi
lock xadd qword [rbp - 0x50], rcx
test rcx, rcx
jne 0x140017d6a
lea rax, [rbp - 0x58]
lock cmpxchg qword [rdx], rsi
lea rcx, [rbp - 0x58]
cmp rcx, rax
je 0x140017d7d
mov rax, rsi
lock xadd qword [rbp - 0x40], rax
test rax, rax
jne 0x140017d61
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 - 0x40], rbx
jne 0x140017d58
or edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
lock xadd qword [rbp - 0x50], rcx
xor eax, eax
lock cmpxchg qword [rcx + 0x10], r14
je 0x140017d7d
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x140017c50
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]
mov edi, dword [rbp + 0x18]
test rsi, rsi
je 0x140017ee4
cmp edi, 4
jg 0x140017ee4
mov rdx, qword [rbp - 0x58]
xor ebx, ebx
mov ecx, ebx
lock xadd qword [rbp - 0x50], rcx
test rcx, rcx
jne 0x140017e33
lea rax, [rbp - 0x58]
lock cmpxchg qword [rdx], rbx
lea rcx, [rbp - 0x58]
cmp rcx, rax
je 0x140017e4a
mov eax, ebx
lock xadd qword [rbp - 0x40], rax
test rax, rax
jne 0x140017e2a
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 - 0x40], rbx
jne 0x140017e1f
or edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
mov rcx, rbx
lock xadd qword [rbp - 0x50], rcx
xor eax, eax
or rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx + 0x10], rdx
je 0x140017e4a
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rdx, qword [rbp - 0x38]
mov rcx, rbx
lock xadd qword [rbp - 0x30], rcx
test rcx, rcx
jne 0x140017eb9
lea rax, [rbp - 0x38]
lock cmpxchg qword [rdx], rbx
lea rcx, [rbp - 0x38]
cmp rcx, rax
je 0x140017ed0
mov rax, rbx
lock xadd qword [rbp - 0x20], rax
test rax, rax
jne 0x140017eb0
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 - 0x20], rbx
jne 0x140017ea5
or edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor ebx, ebx
mov rcx, rbx
lock xadd qword [rbp - 0x30], rcx
xor eax, eax
or rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx + 0x10], rdx
je 0x140017ed0
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, rsi
inc r12d
call r14
xor esi, esi
or r14, 0xffffffffffffffff
jmp 0x140017c50
mov rcx, qword [rbx + 0x20]
mov rax, qword [rbx + 0x10]
test rcx, rcx
je 0x140017ef5
mov qword [rcx + 0x10], rax
test rax, rax
je 0x140017efe
mov qword [rax + 0x20], rcx
mov rcx, qword [rbx]
cmp qword [rcx + 0x58], rbx
jne 0x140017f0b
mov qword [rcx + 0x58], rax
mov rcx, qword [rbx]
cmp qword [rcx + 0x60], rbx
jne 0x140017f18
mov qword [rcx + 0x60], rax
mov rcx, qword [rbx + 0x28]
mov rax, qword [rbx + 0x18]
test rcx, rcx
je 0x140017f29
mov qword [rcx + 0x18], rax
test rax, rax
je 0x140017f32
mov qword [rax + 0x28], rcx
mov rcx, qword [rbx + 8]
cmp qword [rcx + 0x18], rbx
jne 0x140017f40
mov qword [rcx + 0x18], rax
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rdx, qword [rbp - 0x58]
xor esi, esi
mov ecx, esi
lock xadd qword [rbp - 0x50], rcx
test rcx, rcx
jne 0x140017fb6
lea rax, [rbp - 0x58]
lock cmpxchg qword [rdx], rsi
lea rcx, [rbp - 0x58]
cmp rcx, rax
je 0x140017fcf
mov eax, esi
lock xadd qword [rbp - 0x40], rax
test rax, rax
jne 0x140017fad
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 - 0x40], rbx
jne 0x140017fa4
or edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
lock xadd qword [rbp - 0x50], rcx
xor eax, eax
or r14, 0xffffffffffffffff
lock cmpxchg qword [rcx + 0x10], r14
je 0x140017fd3
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x140017fd3
or r14, 0xffffffffffffffff
mov rdx, qword [rbp - 0x38]
mov rcx, rsi
lock xadd qword [rbp - 0x30], rcx
test rcx, rcx
jne 0x140017c34
lea rax, [rbp - 0x38]
lock cmpxchg qword [rdx], rsi
lea rcx, [rbp - 0x38]
cmp rcx, rax
je 0x140017c50
mov rax, rsi
lock xadd qword [rbp - 0x20], rax
test rax, rax
jne 0x14001803f
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 - 0x20], rbx
jne 0x140018036
or edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
lock xadd qword [rbp - 0x30], rcx
jmp 0x140017c34
mov rdx, qword [rbp - 0x58]
mov rcx, rsi
lock xadd qword [rbp - 0x50], rcx
test rcx, rcx
jne 0x1400180ba
lea rax, [rbp - 0x58]
lock cmpxchg qword [rdx], rsi
lea rcx, [rbp - 0x58]
cmp rcx, rax
je 0x1400180cd
mov rax, rsi
lock xadd qword [rbp - 0x40], rax
test rax, rax
jne 0x1400180b1
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 - 0x40], rbx
jne 0x1400180a8
or edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
lock xadd qword [rbp - 0x50], rcx
xor eax, eax
lock cmpxchg qword [rcx + 0x10], r14
je 0x1400180cd
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
test r12d, r12d
jne 0x140017b40
mov r15, qword [rsp + 0x60]
mov r14, qword [rsp + 0x68]
mov r12, qword [rsp + 0x70]
mov rdi, qword [rsp + 0xa8]
mov rsi, qword [rsp + 0xa0]
mov rbx, qword [rsp + 0x98]
add rsp, 0x78
pop r13
pop rbp
ret