Function at 0x1800a8670
Capabilities:
Get thread local storage value

Disassembly:
mov qword [rsp + 0x10], rdx
push rsi
push rdi
push r13
push r14
push r15
sub rsp, 0x20
mov rax, qword [0x1801902f8]
mov r14, rcx
mov r15d, r9d
mov r13, r8
mov rdi, rdx
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
movsxd rcx, dword [0x18018fdf0]
xor esi, esi
test rax, rax
je 0x1800a86ba
test ecx, ecx
jle 0x1800a86ba
cmp ecx, dword [rax + 8]
jge 0x1800a86ba
mov rax, qword [rax]
mov rsi, qword [rax + rcx*8]
test rsi, rsi
jne 0x1800a8707
lea ecx, [rsi + 0x48]
call sym.tcl86t.dll_hclpAlloc
mov rsi, rax
test rax, rax
je 0x1800a889d
xor eax, eax
lea rcx, [0x18018fdf0]
mov qword [rsi], rax
mov rdx, rsi
mov qword [rsi + 8], rax
mov qword [rsi + 0x10], rax
mov qword [rsi + 0x18], rax
mov qword [rsi + 0x20], rax
mov qword [rsi + 0x28], rax
mov qword [rsi + 0x30], rax
mov qword [rsi + 0x38], rax
mov qword [rsi + 0x40], rax
call fcn.180106bc0
mov rsi, qword [rsi + 8]
mov qword [rsp + 0x50], rbx
mov qword [rsp + 0x60], rbp
mov qword [rsp + 0x68], r12
mov r12, qword [rsp + 0x70]
mov rdx, qword [r12]
mov rbp, qword [rdx + 0xc8]
test rsi, rsi
je 0x1800a8745
nop
cmp qword [rsi + 0xc8], rbp
je 0x1800a8782
mov rsi, qword [rsi + 0xd8]
test rsi, rsi
jne 0x1800a8730
test r14, r14
je 0x1800a8764
lea rcx, str.couldnt_find_state_for_channel___s_
mov rdx, qword [rdx]
call sym.tcl86t.dll_hcl_ObjPrintf
mov rdx, rax
mov rcx, r14
call sym.tcl86t.dll_hcl_SetObjResult
xor eax, eax
mov rbp, qword [rsp + 0x60]
mov rbx, qword [rsp + 0x50]
mov r12, qword [rsp + 0x68]
add rsp, 0x20
pop r15
pop r14
pop r13
pop rdi
pop rsi
ret
test rsi, rsi
je 0x1800a8745
mov eax, dword [rsi + 8]
and eax, r15d
test al, 6
jne 0x1800a879f
test r14, r14
je 0x1800a8764
lea rcx, str.reading_and_writing_both_disallowed_for_channel___s_
jmp 0x1800a8751
test r15b, 4
je 0x1800a8804
mov rdi, qword [rsi + 0xb8]
mov rcx, rbp
mov rbx, qword [rsi + 0xc0]
mov qword [rsi + 0xb8], 0
mov qword [rsi + 0xc0], 0
call sym.tcl86t.dll_hcl_Flush
mov qword [rsi + 0xb8], rdi
mov qword [rsi + 0xc0], rbx
test eax, eax
je 0x1800a87ff
test r14, r14
je 0x1800a8764
mov rax, qword [r12]
lea rcx, str.could_not_flush_channel___s_
mov rdx, qword [rax]
jmp 0x1800a8754
mov rdi, qword [rsp + 0x58]
xor r14d, r14d
test r15b, 2
je 0x1800a8836
mov rax, qword [rsi + 0x80]
test rax, rax
je 0x1800a8836
mov qword [rbp + 0x28], rax
mov rax, qword [rsi + 0x88]
mov qword [rbp + 0x30], rax
mov qword [rsi + 0x80], r14
mov qword [rsi + 0x88], r14
mov ecx, 0x40
call sym.tcl86t.dll_hclpAlloc
mov rbx, rax
test rax, rax
je 0x1800a88af
mov qword [rax + 0x10], rdi
mov qword [rax], rsi
mov qword [rax + 8], r13
mov qword [rax + 0x18], rbp
mov qword [rax + 0x20], r14
mov qword [rax + 0x28], r14
mov qword [rax + 0x30], r14
mov dword [rax + 0x38], r14d
mov qword [rbp + 0x20], rax
mov qword [rsi + 0xc8], rax
mov rcx, qword [rax + 0x10]
mov rax, qword [rcx + 8]
sub rax, 4
cmp rax, 1
ja 0x1800a8895
mov rax, qword [rcx + 0x78]
test rax, rax
je 0x1800a8895
mov rcx, qword [rbx + 8]
xor edx, edx
call rax
mov rax, rbx
jmp 0x1800a8766
mov edx, 0x48
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3
mov edx, 0x40
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3