Function at 0x140200270
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 0x140200881
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 0x140200335
lea rax, [rbp - 0x19]
mov qword [rcx + 8], rax
xor eax, eax
lock cmpxchg qword [rcx + 0x18], rsi
je 0x1402002f3
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rax, rdi
lock xadd qword [rbp - 9], rax
test rax, rax
jne 0x140200335
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 0x14020032c
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 rcx, rdi
mov qword [r13 + 0x60], rax
mov rdx, qword [rbp - 0x19]
lock xadd qword [rbp - 0x11], rcx
test rcx, rcx
jne 0x1402003ac
lea rax, [rbp - 0x19]
lock cmpxchg qword [rdx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x1402003c0
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x1402003a3
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 0x14020039a
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
lock xadd qword [rbp - 0x11], rcx
xor eax, eax
lock cmpxchg qword [rcx + 0x10], rsi
je 0x1402003c0
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop
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 0x140200439
lea rax, [rbp - 0x19]
mov qword [rcx + 8], rax
xor eax, eax
lock cmpxchg qword [rcx + 0x18], rsi
je 0x1402003f7
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rax, rdi
lock xadd qword [rbp - 9], rax
test rax, rax
jne 0x140200439
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 0x140200430
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 0x1402007cf
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 0x1402004fe
mov rdx, qword [rbp - 0x19]
mov rcx, rdi
lock xadd qword [rbp - 0x11], rcx
test rcx, rcx
jne 0x1402004de
lea rax, [rbp - 0x19]
lock cmpxchg qword [rdx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x1402004f1
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x1402004d5
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 0x1402004cc
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
lock xadd qword [rbp - 0x11], rcx
xor eax, eax
lock cmpxchg qword [rcx + 0x10], rsi
je 0x1402004f1
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x1402003c0
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 0x14020065d
cmp dword [rbp + 0x67], 4
jge 0x14020065d
mov rdx, qword [rbp - 0x19]
xor edi, edi
mov ecx, edi
lock xadd qword [rbp - 0x11], rcx
test rcx, rcx
jne 0x1402005a5
lea rax, [rbp - 0x19]
lock cmpxchg qword [rdx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x1402005bf
mov eax, edi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x14020059c
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 0x140200593
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
lock xadd qword [rbp - 0x11], rcx
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx + 0x10], rdx
je 0x1402005bf
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rdx, qword [rbp + 7]
mov rcx, rdi
lock xadd qword [rbp + 0xf], rcx
test rcx, rcx
jne 0x14020062e
lea rax, [rbp + 7]
lock cmpxchg qword [rdx], rdi
lea rcx, [rbp + 7]
cmp rcx, rax
je 0x140200648
mov rax, rdi
lock xadd qword [rbp + 0x1f], rax
test rax, rax
jne 0x140200625
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 0x14020061c
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
lock xadd qword [rbp + 0xf], rcx
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx + 0x10], rdx
je 0x140200648
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
inc r12d
mov rcx, rsi
call r14
mov rsi, 0xffffffffffffffff
jmp 0x1402003c0
mov rcx, qword [rbx + 0x20]
mov rax, qword [rbx + 0x10]
test rcx, rcx
je 0x14020066e
mov qword [rcx + 0x10], rax
test rax, rax
je 0x140200677
mov qword [rax + 0x20], rcx
mov rcx, qword [rbx]
cmp qword [rcx + 0x58], rbx
jne 0x140200687
mov qword [rcx + 0x58], rax
mov rcx, qword [rbx]
cmp qword [rcx + 0x60], rbx
jne 0x140200691
mov qword [rcx + 0x60], rax
mov rcx, qword [rbx + 0x28]
mov rax, qword [rbx + 0x18]
test rcx, rcx
je 0x1402006a2
mov qword [rcx + 0x18], rax
test rax, rax
je 0x1402006ab
mov qword [rax + 0x28], rcx
mov rcx, qword [rbx + 8]
cmp qword [rcx + 0x18], rbx
jne 0x1402006b9
mov qword [rcx + 0x18], rax
mov rcx, rbx
call fcn.140226d80
mov rdx, qword [rbp - 0x19]
xor edi, edi
mov ecx, edi
lock xadd qword [rbp - 0x11], rcx
test rcx, rcx
jne 0x140200730
lea rax, [rbp - 0x19]
lock cmpxchg qword [rdx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x14020074c
mov eax, edi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x140200727
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 0x14020071e
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
lock xadd qword [rbp - 0x11], rcx
xor eax, eax
mov rsi, 0xffffffffffffffff
lock cmpxchg qword [rcx + 0x10], rsi
je 0x140200753
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x140200753
mov rsi, 0xffffffffffffffff
mov rdx, qword [rbp + 7]
mov rcx, rdi
lock xadd qword [rbp + 0xf], rcx
test rcx, rcx
jne 0x1402003ac
lea rax, [rbp + 7]
lock cmpxchg qword [rdx], rdi
lea rcx, [rbp + 7]
cmp rcx, rax
je 0x1402003c0
mov rax, rdi
lock xadd qword [rbp + 0x1f], rax
test rax, rax
jne 0x1402007c1
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 0x1402007b8
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
lock xadd qword [rbp + 0xf], rcx
jmp 0x1402003ac
mov rdx, qword [rbp - 0x19]
mov rcx, rdi
lock xadd qword [rbp - 0x11], rcx
test rcx, rcx
jne 0x14020083e
lea rax, [rbp - 0x19]
lock cmpxchg qword [rdx], rdi
lea rcx, [rbp - 0x19]
cmp rcx, rax
je 0x140200851
mov rax, rdi
lock xadd qword [rbp - 1], rax
test rax, rax
jne 0x140200835
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 0x14020082c
mov edx, 0xffffffff
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rdi
lock xadd qword [rbp - 0x11], rcx
xor eax, eax
lock cmpxchg qword [rcx + 0x10], rsi
je 0x140200851
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [rbp + 0x6f]
test r12d, r12d
jne 0x1402002b1
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