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

Disassembly:
push r12
push r14
sub rsp, 0x28
call fcn.180086cb0
cmp dword [0x1801905a8], 0
mov r12d, 1
jne 0x1800870ba
lea rcx, [0x180190558]
mov dword [0x1801905a8], r12d
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]
mov qword [rsp + 0x40], rbx
lea rcx, [0x1801905b0]
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x20], r15
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
xor r14d, r14d
cmp dword [0x18018fdb8], r14d
je 0x180087716
mov rax, qword [0x1801902f8]
mov dword [0x18018fdb8], r14d
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
movsxd rcx, dword [0x18018fdd0]
test rax, rax
je 0x18008711a
test ecx, ecx
jle 0x18008711a
cmp ecx, dword [rax + 8]
jge 0x18008711a
mov rax, qword [rax]
cmp qword [rax + rcx*8], r14
jne 0x180087145
mov ecx, reloc.WS2_32.dll_recv
call sym.tcl86t.dll_hclpAlloc
test rax, rax
je 0x1800877ca
xor ecx, ecx
mov rdx, rax
mov qword [rax], rcx
mov qword [rax + 8], rcx
lea rcx, [0x18018fdd0]
call fcn.180106bc0
xor ecx, ecx
call fcn.180087820
lea rcx, [0x18018fdc0]
call sym.tcl86t.dll_hcl_MutexLock
mov rax, qword [0x18018fdb0]
mov rbx, rax
test rax, rax
je 0x1800871b1
nop word [rax + rax]
mov rax, qword [rax + 0x10]
mov rcx, qword [0x18018fdc0]
mov qword [0x18018fdb0], rax
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [rbx + 8]
call qword [rbx]
mov rcx, rbx
call sym.tcl86t.dll_hclpFree
lea rcx, [0x18018fdc0]
call sym.tcl86t.dll_hcl_MutexLock
mov rax, qword [0x18018fdb0]
mov rbx, rax
test rax, rax
jne 0x180087170
mov rcx, qword [0x18018fdc0]
mov qword [0x18018fdb0], r14
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [0x18018fac8]
call sym.tcl86t.dll_hcl_MutexLock
cmp dword [0x18018fad8], r12d
jne 0x1800871ed
lea rcx, [0x18018fa70]
call sym.tcl86t.dll_hcl_DeleteHashTable
mov dword [0x18018fad8], r14d
mov rcx, qword [0x18018fac8]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [0x18018fdd8]
call sym.tcl86t.dll_hcl_MutexLock
mov rcx, qword [0x18018fdd8]
mov dword [0x18018fde0], r14d
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rcx, qword [0x18018fd98]
test rcx, rcx
je 0x180087239
call sym.tcl86t.dll_hclpFree
mov qword [0x18018fd98], r14
mov dword [0x18018fd90], r14d
mov rcx, qword [0x18018fe10]
test rcx, rcx
je 0x180087264
mov edx, dword [rcx]
lea eax, [rdx - 1]
mov dword [rcx], eax
cmp edx, r12d
jg 0x180087256
call sym.tcl86t.dll_hclFreeObj
mov qword [0x18018fe10], r14
mov qword [0x18018fe28], r14
mov rcx, qword [0x18018fe18]
test rcx, rcx
je 0x18008727c
call sym.tcl86t.dll_hclpFree
mov qword [0x18018fe18], r14
mov rcx, qword [0x18018f120]
lea r15, [0x18018f038]
test rcx, rcx
je 0x1800872a6
nop
mov rbx, qword [rcx + 0x10]
cmp rcx, r15
je 0x18008729e
call sym.tcl86t.dll_hclpFree
mov rcx, rbx
test rbx, rbx
jne 0x180087290
mov rax, qword [reloc.WS2_32.dll_accept]
lea rcx, [0x180190350]
add rax, r12
mov qword [0x18018f120], r14
cmove rax, r12
mov qword [reloc.WS2_32.dll_accept], rax
call sym.tcl86t.dll_hcl_MutexLock
mov rdi, qword [0x18018fa20]
test rdi, rdi
je 0x1800872fc
nop word [rax + rax]
mov rcx, qword [rdi]
mov rbx, qword [rdi + 0x10]
call sym.tcl86t.dll_hclpFree
mov rcx, rdi
call sym.tcl86t.dll_hclpFree
mov rdi, rbx
test rbx, rbx
jne 0x1800872e0
mov rcx, qword [0x180190350]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [0x18018ff30]
call sym.tcl86t.dll_hcl_MutexLock
cmp dword [0x18018fec8], r14d
je 0x180087331
lea rcx, [0x18018fed0]
call sym.tcl86t.dll_hcl_DeleteHashTable
mov dword [0x18018fec8], r14d
mov rcx, qword [0x18018ff30]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [0x180190a78]
call sym.tcl86t.dll_hcl_MutexLock
mov rcx, qword [0x180190a78]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.18007afa0
mov rax, qword [0x1801902f8]
mov ecx, dword [rax]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
test rax, rax
je 0x180087391
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 0x1800877dc
call fcn.180145250
test rax, rax
je 0x1800873a3
mov rcx, rax
call fcn.1801452d0
mov rcx, qword [0x18018ffa0]
call sym.tcl86t.dll_hclpFree
lea rbx, [0x18018ffb0]
mov edi, 9
nop dword [rax + rax]
mov rcx, rbx
call sym.tcl86t.dll_hclBN_mp_clear
add rbx, 0x18
sub rdi, r12
jne 0x1800873c0
lea rbx, [0x180190150]
mov edi, 5
nop dword [rax]
mov rcx, rbx
call sym.tcl86t.dll_hclBN_mp_clear
add rbx, 0x18
sub rdi, r12
jne 0x1800873e0
cmp qword [0x18018fdc8], r14
jne 0x1800877e9
lea rcx, [0x18018ff58]
call sym.tcl86t.dll_hcl_MutexLock
cmp dword [0x18018ff60], r14d
je 0x180087434
mov rcx, qword [0x18018ff68]
call sym.tcl86t.dll_hclpFree
mov qword [0x18018ff68], r14
mov dword [0x18018fecc], r14d
mov dword [0x18018ff60], r14d
mov rcx, qword [0x18018ff58]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x1801905a8], r14d
jne 0x180087478
lea rcx, [0x180190558]
mov dword [0x1801905a8], r12d
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]
mov rcx, qword [0x1801901e8]
test rcx, rcx
je 0x1800874cd
cmp dword [0x1801901e0], r14d
mov edi, r14d
jle 0x1800874c1
mov rbx, r14
mov rcx, qword [rbx + rcx]
mov rcx, qword [rcx]
call sym.tcl86t.dll_hclpFree
mov rcx, qword [0x1801901e8]
lea rbx, [rbx + 8]
inc edi
cmp edi, dword [0x1801901e0]
jl 0x1800874a0
call sym.tcl86t.dll_hclpFree
mov qword [0x1801901e8], r14
mov rbx, qword [0x1801902f8]
mov qword [0x1801901e0], r14
mov ecx, dword [rbx]
call qword [sym.imp.KERNEL32.dll_TlsFree]
test eax, eax
je 0x1800877f6
mov qword [rsp + 0x48], rbp
mov qword [rsp + 0x50], rsi
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [0x1801901f0]
mov ebp, r14d
mov rcx, qword [0x1801901f8]
mov qword [0x1801902f8], r14
test eax, eax
jle 0x180087563
mov rdi, r14
mov rbx, qword [rdi + rcx]
test rbx, rbx
je 0x180087559
mov rsi, qword [rbx]
test rsi, rsi
je 0x180087559
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, rsi
call sym.tcl86t.dll_hclpFree
mov qword [rbx], r14
mov rcx, qword [0x1801901f8]
mov eax, dword [0x1801901f0]
inc ebp
add rdi, 8
cmp ebp, eax
jl 0x180087527
test rcx, rcx
je 0x180087574
call sym.tcl86t.dll_hclpFree
mov qword [0x1801901f8], r14
mov eax, dword [0x1801901d0]
mov esi, r14d
mov rcx, qword [0x1801901d8]
mov qword [0x1801901f0], r14
test eax, eax
jle 0x1800875ce
mov rdi, r14
mov rbx, qword [rdi + rcx]
test rbx, rbx
je 0x1800875c4
mov rbp, qword [rbx]
test rbp, rbp
je 0x1800875c4
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, rbp
call sym.tcl86t.dll_hclpFree
mov qword [rbx], r14
mov rcx, qword [0x1801901d8]
mov eax, dword [0x1801901d0]
inc esi
add rdi, 8
cmp esi, eax
jl 0x180087592
mov rbp, qword [rsp + 0x48]
test rcx, rcx
je 0x1800875e4
call sym.tcl86t.dll_hclpFree
mov qword [0x1801901d8], r14
lea rcx, [0x180190580]
mov qword [0x1801901d0], r14
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rbx, [0x180190210]
mov esi, 0xa
mov rdi, qword [rbx]
test rdi, rdi
je 0x18008761f
lea rcx, [rdi + 8]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx], r14
add rbx, 0x18
sub rsi, r12
jne 0x180087604
mov rbx, qword [0x180190148]
mov rsi, qword [rsp + 0x50]
test rbx, rbx
je 0x18008764f
lea rcx, [rbx + 8]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rbx, qword [0x180190088]
mov qword [0x180190148], r14
test rbx, rbx
je 0x180087675
lea rcx, [rbx + 8]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
cmp dword [0x1801905e4], r14d
mov qword [0x180190088], r14
je 0x1800876a0
mov ecx, dword [0x1801905ac]
call qword [sym.imp.KERNEL32.dll_TlsFree]
test eax, eax
je 0x180087803
mov dword [0x1801905e4], r14d
mov rbx, qword [0x18018fe80]
test rbx, rbx
je 0x1800876fa
nop dword [rax]
mov rcx, qword [rbx]
mov rax, qword [rbx + 0x40]
mov qword [0x18018fe80], rax
cmp byte [rcx], r14b
je 0x1800876d8
mov rax, qword [rbx + 0x10]
mov rdx, qword [rax + 0x10]
test rdx, rdx
je 0x1800876d8
mov rcx, rax
call rdx
mov rcx, qword [rbx]
call sym.tcl86t.dll_hclpFree
mov rcx, qword [rbx + 8]
call sym.tcl86t.dll_hclpFree
mov rcx, rbx
call sym.tcl86t.dll_hclpFree
mov rbx, qword [0x18018fe80]
test rbx, rbx
jne 0x1800876b0
mov rax, qword [reloc.WS2_32.dll_accept]
add rax, r12
mov qword [0x18018f120], r15
cmove rax, r12
mov qword [reloc.WS2_32.dll_accept], rax
cmp dword [0x1801905a8], r14d
jne 0x18008774d
lea rcx, [0x180190558]
mov dword [0x1801905a8], r12d
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]
lea rcx, [0x180190558]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x180190580]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
cmp dword [0x1801905e0], r14d
mov dword [0x1801905a8], r14d
je 0x180087798
lea rcx, [0x18018fa28]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov dword [0x1801905e0], r14d
lea rcx, [0x1801905b0]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea rcx, [0x1801905b0]
mov r15, qword [rsp + 0x20]
mov rdi, qword [rsp + 0x58]
mov rbx, qword [rsp + 0x40]
add rsp, 0x28
pop r14
pop r12
jmp qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov edx, reloc.WS2_32.dll_recv
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
lea rcx, str.exit_handlers_were_created_during_Tcl_Finalize
call sym.tcl86t.dll_hcl_Panic
int3
lea rcx, str.unable_to_delete_key
call sym.tcl86t.dll_hcl_Panic
int3
lea rcx, str.TlsFree_failed_from_TclpFreeAllocCache
call sym.tcl86t.dll_hcl_Panic
int3