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

Disassembly:
mov rax, rsp
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov qword [rsp + 0x48], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov r13, r9
mov r15, r8
mov rbp, rdx
mov r12, rcx
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
mov dword [rsp + 0x30], eax
lea edx, [rax + 1]
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rsi, rax
mov dword [rsp + 0x34], eax
lea edx, [rax + 1]
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
nop
lea ecx, [rsi + rdi]
mov r14d, dword [rsp + 0xb8]
test ecx, ecx
jne 0x18005eba8
lea rdi, [r12 + 0x18]
mov qword [rsp + 0x50], rdi
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ebx, eax
mov ecx, dword [rdi + 4]
cmp ecx, eax
jne 0x18005e93b
mov rbx, qword [rsp + 0x50]
inc dword [rbx]
jmp 0x18005e957
mov rcx, qword [rsp + 0x50]
add rcx, 8
call fcn.180035b50
xchg dword [rdi + 4], ebx
mov rbx, qword [rsp + 0x50]
mov dword [rbx], 1
mov byte [rsp + 0x58], 1
mov rcx, qword [r12 + 0x38]
mov rax, qword [rcx + 8]
cmp byte [rax + 0x31], 0
jne 0x18005e988
nop dword [rax + rax]
cmp qword [rax + 0x18], rbp
jae 0x18005e97c
mov rax, qword [rax + 0x10]
jmp 0x18005e982
mov rcx, rax
mov rax, qword [rax]
cmp byte [rax + 0x31], 0
je 0x18005e970
mov qword [rsp + 0x38], rcx
mov rax, qword [r12 + 0x38]
cmp rcx, rax
je 0x18005e9a4
cmp rbp, qword [rcx + 0x18]
jb 0x18005e9a4
lea rax, [rsp + 0x38]
jmp 0x18005e9ae
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0x40]
mov rax, qword [rax]
cmp rax, qword [r12 + 0x38]
je 0x18005eb62
cmp r14d, 5
je 0x18005ea54
cmp r14d, 0xe
jne 0x18005eb62
lea rdx, [rax + 0x20]
mov qword [rsp + 0x20], r15
mov r9d, dword [rsp + 0xb0]
mov r8, r13
mov rcx, r12
call fcn.180059280
mov esi, eax
dec dword [rbx]
jne 0x18005ea2d
xor ecx, ecx
xchg dword [rdi + 4], ecx
mov rcx, qword [rsp + 0x50]
add rcx, 8
mov edx, 0x80000000
lock xadd dword [rcx], edx
bt edx, 0x1e
jb 0x18005ea2d
cmp edx, 0x80000000
jle 0x18005ea2d
lock bts dword [rcx], 0x1e
jb 0x18005ea2d
call fcn.180035ad0
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop
mov edx, dword [rsp + 0x34]
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edx, dword [rsp + 0x30]
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, esi
jmp 0x18005ebeb
mov rcx, qword [rax + 0x20]
mov rax, qword [rcx + 8]
mov rsi, qword [rax + 0x50]
sub rsi, qword [rax + 0x48]
mov dword [rsp + 0x28], 5
mov eax, dword [rsp + 0xb0]
mov dword [rsp + 0x20], eax
mov r9, r13
mov r8, r15
mov rdx, rbp
mov rcx, qword [r12 + 0x10]
call fcn.180078680
mov ebp, eax
test eax, eax
jns 0x18005eaf5
dec dword [rbx]
jne 0x18005eace
xor ecx, ecx
xchg dword [rdi + 4], ecx
mov rcx, qword [rsp + 0x50]
add rcx, 8
mov eax, 0x80000000
lock xadd dword [rcx], eax
bt eax, 0x1e
jb 0x18005eace
cmp eax, 0x80000000
jle 0x18005eace
lock bts dword [rcx], 0x1e
jb 0x18005eace
call fcn.180035ad0
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop
mov edx, dword [rsp + 0x34]
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edx, dword [rsp + 0x30]
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, ebp
jmp 0x18005ebeb
mov qword [r13], rsi
mov qword [r13 + 8], rsi
dec dword [rbx]
jne 0x18005eb3b
xor ecx, ecx
xchg dword [rdi + 4], ecx
mov rcx, qword [rsp + 0x50]
add rcx, 8
mov eax, 0x80000000
lock xadd dword [rcx], eax
bt eax, 0x1e
jb 0x18005eb3b
cmp eax, 0x80000000
jle 0x18005eb3b
lock bts dword [rcx], 0x1e
jb 0x18005eb3b
call fcn.180035ad0
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop
mov edx, dword [rsp + 0x34]
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edx, dword [rsp + 0x30]
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
xor eax, eax
jmp 0x18005ebeb
dec dword [rbx]
jne 0x18005eba0
xor ecx, ecx
xchg dword [rdi + 4], ecx
mov rcx, qword [rsp + 0x50]
add rcx, 8
mov eax, 0x80000000
lock xadd dword [rcx], eax
bt eax, 0x1e
jb 0x18005eba0
cmp eax, 0x80000000
jle 0x18005eba0
lock bts dword [rcx], 0x1e
jb 0x18005eba0
call fcn.180035ad0
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop
mov esi, dword [rsp + 0x34]
mov edi, dword [rsp + 0x30]
mov dword [rsp + 0x28], r14d
mov eax, dword [rsp + 0xb0]
mov dword [rsp + 0x20], eax
mov r9, r13
mov r8, r15
mov rdx, rbp
mov rcx, qword [r12 + 0x10]
call fcn.180078680
mov ebx, eax
mov edx, esi
mov ecx, dword [0x180209190]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edx, edi
mov ecx, dword [0x180205148]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
mov eax, ebx
lea r11, [rsp + 0x60]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret