Function at 0x180119110
Capabilities:
Allocate thread local storage
Get thread local storage value

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r15
sub rsp, 0x50
mov rbx, qword [rcx + 0x88]
lea r15, [rcx + 0xf8]
xor esi, esi
mov qword [rsp + 0x88], rbx
cmp rcx, qword [rbx + 0x28]
jne 0x18011913e
lea edi, [rsi + 1]
jmp 0x180119152
mov rax, qword [rbx + 0xa8]
mov edi, esi
mov edx, 2
cmp rcx, qword [rax]
cmove edi, edx
mov r9d, dword [r15 + 0x28]
mov edx, esi
mov dword [rsp + 0x80], edi
nop
cmp edx, r9d
jge 0x180119178
mov rax, qword [r15]
movsxd rcx, edx
inc edx
mov r8, qword [rax + rcx*8]
test r8, r8
je 0x180119160
jmp 0x18011917b
mov r8, rsi
test r8, r8
mov qword [rsp + 0x90], r12
lea rbp, [r8 - 0x18]
mov qword [rsp + 0x48], r13
cmove rbp, rsi
mov qword [rsp + 0x40], r14
test rbp, rbp
je 0x1801194de
call sym.tcl86t.dll_hcl_NewObj
inc dword [rbp + 0x10]
mov r8, rax
mov rdx, rbp
mov rcx, rbx
mov r12, rax
call sym.tcl86t.dll_hcl_GetVariableFullName
mov dword [rsp + 0x30], 0xffffffff
mov r9, r12
mov dword [rsp + 0x28], edi
mov r8, rbx
xor edx, edx
mov qword [rsp + 0x20], rsi
mov rcx, rbp
call fcn.1801159a0
test dword [rbp], 0x870
je 0x180119426
lea rcx, [rbx + 0x3f0]
mov rdx, rbp
call qword [rbx + 0x430]
mov r13, rax
mov r14, qword [rax + 0x18]
test r14, r14
je 0x1801193f9
nop dword [rax + rax]
lea rcx, [r14 + 0x18]
mov rsi, r14
mov r14, qword [rcx]
mov qword [rcx], 0
mov rcx, qword [0x18018ff58]
test rcx, rcx
jne 0x18011939e
cmp dword [0x1801905a8], ecx
jne 0x18011926a
lea rcx, [0x180190558]
mov dword [0x1801905a8], 1
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1801905b0]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x180190580]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x180190580]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp qword [0x18018ff58], 0
jne 0x18011938a
mov ecx, 0x28
call sym.tcl86t.dll_hclpAlloc
mov rbx, rax
test rax, rax
je 0x180119521
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov rdi, qword [0x1801901f8]
xor r11d, r11d
mov qword [0x18018ff58], rbx
mov ecx, r11d
mov ebx, dword [0x1801901f0]
mov eax, r11d
test ebx, ebx
jle 0x1801192d8
cmp qword [rdi + rax*8], r11
je 0x180119490
inc ecx
inc rax
cmp ecx, ebx
jl 0x1801192c5
mov eax, dword [0x1801901f4]
cmp ebx, eax
jl 0x180119376
add eax, 8
mov dword [0x1801901f4], eax
lea ebx, [rax*8]
mov ecx, ebx
call sym.tcl86t.dll_hclpAlloc
mov rdi, rax
test rax, rax
jne 0x18011930d
test ebx, ebx
jne 0x180119512
mov r9d, dword [0x1801901f0]
xor r11d, r11d
mov rdx, qword [0x1801901f8]
mov r8d, r11d
mov ebx, r11d
test r9d, r9d
jle 0x18011935c
mov ecx, r11d
mov r10, rdi
nop
mov rax, qword [rcx + rdx]
test rax, rax
je 0x180119350
mov qword [r10], rax
inc ebx
mov rdx, qword [0x1801901f8]
add r10, 8
mov r9d, dword [0x1801901f0]
inc r8d
add rcx, 8
cmp r8d, r9d
jl 0x180119330
test rdx, rdx
je 0x180119369
mov rcx, rdx
call sym.tcl86t.dll_hclpFree
mov qword [0x1801901f8], rdi
mov dword [0x1801901f0], ebx
movsxd rax, ebx
lea rcx, [0x18018ff58]
mov qword [rdi + rax*8], rcx
inc dword [0x1801901f0]
lea rcx, [0x180190580]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [0x18018ff58]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edx, dword [0x18018fecc]
xor ecx, ecx
mov rax, qword [0x18018ff68]
test edx, edx
jle 0x1801193ca
cmp qword [rax], rsi
je 0x1801194a0
inc ecx
add rax, 0x18
cmp ecx, edx
jl 0x1801193b7
mov rcx, qword [0x18018ff58]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, rsi
call sym.tcl86t.dll_hclpFree
test r14, r14
jne 0x180119210
mov rbx, qword [rsp + 0x88]
xor esi, esi
mov edi, dword [rsp + 0x80]
mov rcx, r13
call sym.tcl86t.dll_hcl_DeleteHashEntry
and dword [rbp], 0xfffff78f
mov rax, qword [rbx + 0xb0]
test rax, rax
je 0x180119426
cmp qword [rax], rbp
jne 0x18011941d
mov qword [rax + 0x10], rsi
mov rax, qword [rax + 8]
test rax, rax
jne 0x180119414
cmp qword [rbp + 8], 0
je 0x18011944e
mov dword [rsp + 0x30], 0xffffffff
mov r9, r12
mov dword [rsp + 0x28], edi
mov r8, rbx
xor edx, edx
mov qword [rsp + 0x20], rsi
mov rcx, rbp
call fcn.1801159a0
mov ecx, dword [r12]
lea eax, [rcx - 1]
mov dword [r12], eax
cmp ecx, 1
jg 0x180119466
mov rcx, r12
call sym.tcl86t.dll_hclFreeObj
dec dword [rbp + 0x10]
lea rcx, [rbp + 0x18]
call sym.tcl86t.dll_hcl_DeleteHashEntry
mov r9d, dword [r15 + 0x28]
mov edx, esi
cmp edx, r9d
jge 0x1801194c7
mov rax, qword [r15]
movsxd rcx, edx
inc edx
mov r8, qword [rax + rcx*8]
test r8, r8
je 0x180119478
jmp 0x1801194ca
lea rcx, [0x18018ff58]
mov qword [rdi + rax*8], rcx
jmp 0x18011938a
cmp dword [rax + 0xc], 0
jne 0x180119502
mov dword [rax + 0xc], 1
mov qword [rax + 0x10], 3
mov rcx, qword [0x18018ff58]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x1801193df
mov r8, rsi
test r8, r8
lea rbp, [r8 - 0x18]
cmove rbp, rsi
test rbp, rbp
jne 0x1801191a1
mov rcx, r15
mov r14, qword [rsp + 0x40]
mov r13, qword [rsp + 0x48]
mov r12, qword [rsp + 0x90]
add rsp, 0x50
pop r15
pop rdi
pop rsi
pop rbp
pop rbx
jmp sym.tcl86t.dll_hcl_DeleteHashTable
mov rdx, rsi
lea rcx, str.Tcl_EventuallyFree_called_twice_for__p
call sym.tcl86t.dll_hcl_Panic
int3
mov edx, ebx
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3
mov edx, 0x28
lea rcx, str.unable_to_alloc__u_bytes
call sym.tcl86t.dll_hcl_Panic
int3