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

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
sub rsp, 0x20
mov rax, qword [0x1801902f8]
mov ebp, ecx
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
movsxd rdx, dword [0x18018fdd0]
test rax, rax
je 0x180087a37
test edx, edx
jle 0x180087a37
cmp edx, dword [rax + 8]
jge 0x180087a37
mov rax, qword [rax]
mov rdi, qword [rax + rdx*8]
test rdi, rdi
je 0x180087a37
mov rbx, qword [rdi]
mov dword [rdi + 8], 1
test rbx, rbx
je 0x1800878ad
nop word [rax + rax]
mov rax, qword [rbx + 0x10]
mov qword [rdi], rax
mov rcx, qword [rbx + 8]
call qword [rbx]
mov rcx, rbx
call sym.tcl86t.dll_hclpFree
mov rbx, qword [rdi]
test rbx, rbx
jne 0x180087890
call fcn.1800a6e30
mov rax, qword [0x1801902f8]
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
movsxd rcx, dword [0x18018feb0]
xor esi, esi
mov ebx, esi
test rax, rax
je 0x1800878e1
test ecx, ecx
jle 0x1800878e1
cmp ecx, dword [rax + 8]
jge 0x1800878e1
mov rax, qword [rax]
mov rbx, qword [rax + rcx*8]
test rbx, rbx
jne 0x180087917
lea ecx, [rbx + 0x60]
call sym.tcl86t.dll_hclpAlloc
mov rbx, rax
test rax, rax
je 0x180087a93
xor edx, edx
mov rcx, rax
lea r8d, [rdx + 0x60]
call sub.VCRUNTIME140.dll_memset
mov rdx, rbx
lea rcx, [0x18018feb0]
call fcn.180106bc0
cmp dword [rbx + 0x50], esi
je 0x1800879c3
lea rcx, [rbx + 0x18]
mov qword [rsp + 0x30], r14
call sym.tcl86t.dll_hcl_MutexLock
mov rdi, qword [rbx]
test rdi, rdi
je 0x180087951
nop word [rax + rax]
mov rcx, rdi
mov rdi, qword [rdi + 8]
call sym.tcl86t.dll_hclpFree
test rdi, rdi
jne 0x180087940
mov rcx, qword [rbx + 0x18]
mov qword [rbx], rsi
mov qword [rbx + 8], rsi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [0x18018fea0]
call sym.tcl86t.dll_hcl_MutexLock
mov rcx, qword [rbx + 0x48]
call sym.tcl86t.dll_hcl_FinalizeNotifier
lea rcx, [rbx + 0x18]
call sym.tcl86t.dll_hcl_MutexFinalize
mov rax, qword [0x18018fea8]
lea rcx, [0x18018fea8]
mov r14, qword [rsp + 0x30]
test rax, rax
je 0x1800879b3
cmp rax, rbx
je 0x1800879ac
lea rcx, [rax + 0x58]
mov rax, qword [rax + 0x58]
test rax, rax
jne 0x180087998
jmp 0x1800879b3
mov rax, qword [rbx + 0x58]
mov qword [rcx], rax
mov dword [rbx + 0x50], esi
mov rcx, qword [0x18018fea0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, qword [0x1801902f8]
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
movsxd rcx, dword [0x18018fa68]
test rax, rax
je 0x1800879ee
test ecx, ecx
jle 0x1800879ee
cmp ecx, dword [rax + 8]
jge 0x1800879ee
mov rax, qword [rax]
mov rsi, qword [rax + rcx*8]
test rsi, rsi
jne 0x180087a27
lea ecx, [rsi + 0x20]
call sym.tcl86t.dll_hclpAlloc
mov rsi, rax
test rax, rax
je 0x180087aa5
xor eax, eax
lea rcx, [0x18018fa68]
mov qword [rsi], rax
mov rdx, rsi
mov qword [rsi + 8], rax
mov qword [rsi + 0x10], rax
mov qword [rsi + 0x18], rax
call fcn.180106bc0
cmp qword [rsi + 0x18], 0
lea rcx, [rsi + 0x18]
je 0x180087a37
call sym.tcl86t.dll_hcl_MutexFinalize
mov rax, qword [0x1801902f8]
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x180087a68
mov rcx, rax
call fcn.180106a10
mov rax, qword [0x1801902f8]
xor edx, edx
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x180087ab7
test ebp, ebp
jne 0x180087a7e
call fcn.180145250
test rax, rax
je 0x180087a7e
mov rcx, rax
call fcn.1801452d0
mov rbx, qword [rsp + 0x38]
mov rbp, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
add rsp, 0x20
pop rdi
ret
mov edx, 0x60
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3
mov edx, 0x20
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3
lea rcx, str.unable_to_set_master_TSD_value
call sym.tcl86t.dll_hcl_Panic
int3