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

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0xa30]
sub rsp, 0xb30
mov rax, qword [0x1403622b0]
xor rax, rsp
mov qword [rbp + 0xa28], rax
cmp dword [reloc.WS2_32.dll_closesocket], 0
mov r12, rdx
mov qword [rsp + 0x58], rdx
mov r14, rcx
mov qword [rsp + 0x50], rcx
je 0x1400221f4
call fcn.140028aa0
test al, al
je 0x1400221f4
mov ecx, ntohs
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor ebx, ebx
jmp 0x1400228d4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x14057b280]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, ebx
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor ebx, ebx
lea r15d, [rbx + 1]
test rdi, rdi
jne 0x1400224d2
mov ecx, 0xa50
call fcn.140030980
mov rdi, rax
test rax, rax
je 0x140022c0a
xorps xmm0, xmm0
mov byte [rax], bl
xor eax, eax
mov word [rbp - 0x40], bx
xor edx, edx
mov dword [rbp + 0x82], eax
mov r8d, 0xb0
mov word [rbp + 0x86], ax
lea rcx, [rbp + 0xc0]
mov qword [rbp + 0x90], rax
mov byte [rbp + 0x98], al
mov qword [rbp - 0x38], rbx
mov qword [rbp - 0x30], rbx
mov qword [rbp - 0x28], rbx
mov qword [rbp - 0x20], rbx
mov qword [rbp - 0x18], rbx
mov qword [rbp - 0x10], rbx
mov qword [rbp - 8], rbx
mov qword [rbp], rbx
mov qword [rbp + 8], rbx
mov qword [rbp + 0x10], rbx
mov qword [rbp + 0x18], rbx
mov qword [rbp + 0x20], rbx
mov qword [rbp + 0x28], rbx
mov qword [rbp + 0x30], rbx
mov qword [rbp + 0x38], rbx
mov qword [rbp + 0x40], rbx
mov qword [rbp + 0x48], rbx
mov qword [rbp + 0x50], rbx
mov dword [rbp + 0x58], 0x3e8
mov dword [rbp + 0x5c], 0x3e8
mov word [rbp + 0x60], 0xffff
movups xmmword [rbp + 0x62], xmm0
mov qword [rbp + 0x88], rbx
movups xmmword [rbp + 0x72], xmm0
mov qword [rbp + 0xa0], rbx
mov qword [rbp + 0xa8], rbx
mov qword [rbp + 0xb0], rbx
mov qword [rbp + 0xb8], rbx
call fcn.1401e1df0
mov qword [rbp + 0x170], r15
mov qword [rbp + 0x178], rbx
mov qword [rbp + 0x180], r15
mov qword [rbp + 0x188], rbx
mov qword [rbp + 0x190], r15
mov qword [rbp + 0x198], rbx
mov qword [rbp + 0x1a0], r15
mov qword [rbp + 0x1a8], rbx
mov qword [rbp + 0x1b0], r15
mov qword [rbp + 0x1b8], rbx
mov qword [rbp + 0x1c0], r15
mov qword [rbp + 0x1c8], rbx
mov qword [rbp + 0x1d0], r15
mov qword [rbp + 0x1d8], rbx
mov qword [rbp + 0x1e0], r15
mov qword [rbp + 0x1e8], rbx
mov qword [rbp + 0x1f0], r15
mov qword [rbp + 0x1f8], rbx
mov qword [rbp + 0x200], r15
mov qword [rbp + 0x208], rbx
mov qword [rbp + 0x210], r15
mov qword [rbp + 0x218], rbx
mov qword [rbp + 0x220], r15
mov qword [rbp + 0x228], rbx
mov qword [rbp + 0x230], r15
mov qword [rbp + 0x238], rbx
mov qword [rbp + 0x240], r15
mov qword [rbp + 0x248], rbx
mov qword [rbp + 0x250], r15
mov qword [rbp + 0x258], rbx
mov qword [rbp + 0x260], r15
mov qword [rbp + 0x268], rbx
mov qword [rbp + 0x270], r15
mov qword [rbp + 0x278], rbx
mov qword [rbp + 0x280], r15
mov qword [rbp + 0x288], rbx
mov qword [rbp + 0x290], r15
mov qword [rbp + 0x298], rbx
mov qword [rbp + 0x2a0], r15
mov qword [rbp + 0x2a8], rbx
mov qword [rbp + 0x2b0], r15
xor eax, eax
mov qword [rbp + 0x2b8], rbx
xor edx, edx
mov dword [rbp + 0x2f1], eax
mov r8d, 0x6d8
mov word [rbp + 0x2f5], ax
lea rcx, [rbp + 0x320]
mov byte [rbp + 0x2f7], al
mov qword [rbp + 0x2c0], r15
mov qword [rbp + 0x2c8], rbx
mov qword [rbp + 0x2d0], r15
mov qword [rbp + 0x2d8], rbx
mov qword [rbp + 0x2e0], r15
mov qword [rbp + 0x2e8], rbx
mov byte [rbp + 0x2f0], 6
mov qword [rbp + 0x2f8], rbx
mov qword [rbp + 0x300], rbx
mov qword [rbp + 0x308], rbx
mov qword [rbp + 0x310], rbx
mov qword [rbp + 0x318], rbx
call fcn.1401e1df0
lea rcx, [rdi + 8]
mov qword [rbp + 0x9f8], rbx
lea rdx, [rbp - 0x40]
mov byte [rbp + 0xa00], bl
mov r8d, 0xa48
call fcn.1401e1740
mov ecx, dword [0x14057b280]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x140022c1c
add rdi, 8
cmp byte [rdi + 0x330], bl
je 0x1400224eb
xor edx, edx
mov rcx, rdi
call fcn.140030fa0
mov rdi, rax
mov rsi, r12
imul rsi, r14
cmp byte [rdi + 0x330], bl
jne 0x140022871
lea r8, [0x140000000]
movabs rcx, 0x7000000000000000
mov edx, 4
test rsi, rsi
jne 0x140022533
test r14, r14
je 0x140022563
test r12, r12
je 0x140022563
mov ecx, ntohs
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x1400228d4
mov rax, r12
movabs r9, 0xffffffff00000000
or rax, r14
test r9, rax
je 0x14002255a
xor edx, edx
mov rax, rsi
div r12
cmp rax, r14
jne 0x140022523
mov edx, 4
cmp rsi, 0x1000
ja 0x140022576
lea rax, [rsi + 7]
shr rax, 3
movzx r13d, byte [rax + r8 + 0x374080]
jmp 0x1400225d7
cmp rsi, rcx
jbe 0x140022583
mov r13d, 0xe8
jmp 0x1400225d7
lea rax, [rsi*2 - 1]
test rax, rax
je 0x140022c2e
bsr r9, rax
mov ecx, ebx
cmp r9d, 6
lea eax, [r9 - 6]
cmovae ecx, eax
lea r10d, [rcx*4]
mov ecx, edx
cmp r9d, 7
jb 0x1400225b9
lea ecx, [r9 - 3]
mov rdx, 0xffffffffffffffff
lea rax, [rsi - 1]
shl rdx, cl
lea r13d, [r10 + 1]
and rdx, rax
shr rdx, cl
and edx, 3
add r13d, edx
cmp r13d, 0xe8
jae 0x140022523
mov r12d, r13d
lea rdx, [r8 + 0x373940]
mov rax, qword [rdx + r12*8]
lea rdx, [rdx + r12*8]
lea rcx, [rdi + 0x358]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x38], rdx
test rcx, rcx
je 0x1400227f1
cmp rsi, 0x3800
ja 0x1400226f9
lea rax, [r12 + r12*2]
lea r15, [rcx + rax*8]
mov rcx, qword [rcx + rax*8 + 8]
lea rax, [rcx + 8]
mov r14, qword [rcx]
cmp cx, word [r15 + 0x18]
je 0x140022641
mov qword [r15 + 8], rax
jmp 0x1400226e3
cmp cx, word [r15 + 0x1c]
je 0x140022656
mov qword [r15 + 8], rax
mov word [r15 + 0x18], ax
jmp 0x1400226e3
xor edx, edx
mov rcx, rdi
call fcn.140020fc0
mov qword [rsp + 0x40], rax
mov rcx, rax
test rax, rax
jne 0x140022675
mov r14, rbx
jmp 0x140022809
mov rax, qword [0x14037a360]
mov r9d, r13d
mov byte [rsp + 0x20], 1
cmp word [rax + r12*2], bx
jne 0x140022693
mov rdx, rcx
jmp 0x1400227fb
lea r8, [r15 + 8]
mov rcx, rdi
lea rdx, [rdi + 0x358]
call fcn.14005df60
mov rdx, qword [rsp + 0x40]
lea rax, [rsp + 0x30]
mov qword [rsp + 0x28], rax
lea r9, [r15 + 8]
lea r8, [rdi + 0x358]
mov dword [rsp + 0x20], r13d
mov rcx, rdi
call fcn.14005cf20
mov r14, rax
cmp byte [rsp + 0x30], bl
jne 0x1400226de
mov r14, rbx
jmp 0x140022809
mov rdx, qword [rsp + 0x38]
mov r8, qword [rdx]
mov rcx, r14
xor edx, edx
call fcn.1401e1df0
inc qword [r15 + 0x10]
jmp 0x140022809
cmp rsi, qword [0x14037a348]
ja 0x1400227f1
lea rax, [r12 + r12*2]
lea r12, [rcx + rax*8]
mov rcx, qword [rcx + rax*8 + 8]
lea rax, [rcx + 8]
mov r14, qword [rcx]
cmp cx, word [r12 + 0x18]
je 0x140022729
mov qword [r12 + 8], rax
jmp 0x14002273c
cmp cx, word [r12 + 0x1c]
je 0x140022753
mov qword [r12 + 8], rax
mov word [r12 + 0x18], ax
mov r8, qword [rdx]
mov rcx, r14
xor edx, edx
call fcn.1401e1df0
inc qword [r12 + 0x10]
jmp 0x140022809
xor edx, edx
mov rcx, rdi
call fcn.140020fc0
mov qword [rsp + 0x38], rax
test rax, rax
jne 0x14002276f
mov r14, rbx
jmp 0x140022809
mov r9d, r13d
mov byte [rsp + 0x20], bl
lea r8, [r12 + 8]
mov rcx, rdi
lea rdx, [rdi + 0x358]
call fcn.14005df60
movabs rax, 0x7000000000000000
cmp rsi, rax
jbe 0x14002279e
mov r8, rbx
jmp 0x1400227d4
lea rax, [rsi*2 - 1]
test rax, rax
je 0x140022c2e
bsr rcx, rax
cmp rcx, 7
jae 0x1400227c0
mov ecx, 4
jmp 0x1400227c4
add rcx, 0xfffffffffffffffd
shl r15, cl
dec r15
lea r8, [r15 + rsi]
not r15
and r8, r15
mov rdx, qword [rsp + 0x38]
mov r9b, 1
mov rcx, rdi
call fcn.14005c420
mov r14, rax
test rax, rax
jne 0x140022809
mov r14, rbx
jmp 0x140022809
mov byte [rsp + 0x20], r15b
mov r9d, r13d
xor edx, edx
mov r8, rsi
mov rcx, rdi
call fcn.140059800
mov r14, rax
test r14, r14
je 0x140022523
mov r8, qword [rsp + 0x48]
lea rcx, [rdi + 0x338]
mov qword [rsp + 0x68], rcx
lea rax, [rdi + 8]
mov qword [rsp + 0x70], rax
lea rax, [rdi + 0x10]
mov qword [rsp + 0x78], rax
lea rax, [rdi + 0x340]
mov qword [rbp - 0x80], rax
mov byte [rsp + 0x60], 1
mov rdx, qword [rcx]
lea rax, [r8 + rdx]
mov qword [rcx], rax
mov rax, qword [rsp + 0x78]
mov rcx, qword [rax]
sub rcx, rdx
cmp r8, rcx
jb 0x14002286c
lea rdx, [rsp + 0x60]
mov rcx, rdi
call fcn.1400640e0
mov rbx, r14
jmp 0x1400228d4
lea rcx, [0x140000000]
test rsi, rsi
jne 0x140022901
test r14, r14
je 0x140022930
test r12, r12
je 0x140022930
mov ecx, ntohs
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, qword [rsp + 0x50]
lea r9, [rbp + 0xa10]
mov qword [rbp + 0xa10], rax
mov r8, rbx
mov rax, qword [rsp + 0x58]
mov rdx, rbx
mov qword [rbp + 0xa18], rax
xor eax, eax
mov qword [rbp + 0xa20], rax
lea ecx, [rax + 3]
call fcn.1400390b0
mov rax, rbx
mov rcx, qword [rbp + 0xa28]
xor rcx, rsp
call fcn.1401df0b0
mov rbx, qword [rsp + 0xb80]
add rsp, 0xb30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
mov rax, r12
movabs r9, 0xffffffff00000000
or rax, r14
test r9, rax
je 0x140022927
xor edx, edx
mov rax, rsi
div r12
cmp rax, r14
jne 0x140022893
cmp rsi, 0x1000
ja 0x140022943
lea rax, [rsi + 7]
shr rax, 3
movzx r13d, byte [rax + rcx + 0x374080]
jmp 0x140022955
mov rcx, rsi
call fcn.14002b700
mov r13d, eax
lea rcx, [0x140000000]
cmp r13d, 0xe8
jae 0x140022893
lea r8, [rcx + 0x373940]
mov eax, r13d
lea r8, [r8 + rax*8]
mov rcx, qword [r8]
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x48], r8
cmp byte [rdi + 1], bl
jg 0x140022b6d
mov r12, rbx
cmp byte [rdi], bl
je 0x140022994
lea r12, [rdi + 0x358]
mov qword [rsp + 0x40], r12
mov rdx, rbx
test r12, r12
je 0x140022b8f
cmp rsi, 0x3800
ja 0x140022a7c
lea rax, [rax + rax*2]
mov rcx, qword [r12 + rax*8 + 8]
lea r15, [r12 + rax*8]
lea rax, [rcx + 8]
mov r14, qword [rcx]
cmp cx, word [r15 + 0x18]
je 0x1400229d6
mov qword [r15 + 8], rax
jmp 0x140022a66
cmp cx, word [r15 + 0x1c]
je 0x1400229e8
mov qword [r15 + 8], rax
mov word [r15 + 0x18], ax
jmp 0x140022a66
mov rcx, rdi
call fcn.140020fc0
mov r14, rax
test rax, rax
jne 0x140022a00
mov r14, rbx
jmp 0x140022ba5
mov rax, qword [0x14037a360]
mov r9d, r13d
mov ecx, r13d
mov byte [rsp + 0x20], 1
cmp word [rax + rcx*2], bx
mov rcx, rdi
jne 0x140022a23
mov rdx, r14
jmp 0x140022b9a
lea r8, [r15 + 8]
mov rdx, r12
call fcn.14005df60
lea rax, [rsp + 0x31]
mov r8, r12
mov qword [rsp + 0x28], rax
lea r9, [r15 + 8]
mov rdx, r14
mov dword [rsp + 0x20], r13d
mov rcx, rdi
call fcn.14005cf20
mov r14, rax
cmp byte [rsp + 0x31], bl
jne 0x140022a61
mov r14, rbx
jmp 0x140022ba5
mov r8, qword [rsp + 0x48]
mov r8, qword [r8]
xor edx, edx
mov rcx, r14
call fcn.1401e1df0
inc qword [r15 + 0x10]
jmp 0x140022ba5
cmp rsi, qword [0x14037a348]
ja 0x140022b8f
lea rax, [rax + rax*2]
mov rcx, qword [r12 + rax*8 + 8]
lea r12, [r12 + rax*8]
lea rax, [rcx + 8]
mov r14, qword [rcx]
cmp cx, word [r12 + 0x18]
je 0x140022aac
mov qword [r12 + 8], rax
jmp 0x140022abf
cmp cx, word [r12 + 0x1c]
je 0x140022ad4
mov qword [r12 + 8], rax
mov word [r12 + 0x18], ax
mov r8, qword [r8]
mov rcx, r14
call fcn.1401e1df0
inc qword [r12 + 0x10]
jmp 0x140022ba5
mov rcx, rdi
call fcn.140020fc0
mov r14, rax
test rax, rax
jne 0x140022aec
mov r14, rbx
jmp 0x140022ba5
mov rdx, qword [rsp + 0x40]
lea r8, [r12 + 8]
mov r9d, r13d
mov byte [rsp + 0x20], bl
mov rcx, rdi
call fcn.14005df60
movabs rax, 0x7000000000000000
cmp rsi, rax
jbe 0x140022b19
mov r8, rbx
jmp 0x140022b52
lea rax, [rsi*2 - 1]
test rax, rax
je 0x140022c2e
bsr rax, rax
cmp rax, 7
jae 0x140022b3b
mov eax, 4
jmp 0x140022b3f
add rax, 0xfffffffffffffffd
mov rcx, rax
shl r15, cl
dec r15
lea r8, [rsi + r15]
not r15
and r8, r15
mov r9b, 1
mov rdx, r14
mov rcx, rdi
call fcn.14005c420
mov r14, rax
test rax, rax
jne 0x140022ba5
mov r14, rbx
jmp 0x140022ba5
movzx r8d, r15b
xor edx, edx
mov rcx, rdi
call fcn.140021680
mov rdx, rax
test rax, rax
jne 0x140022b8f
cmp dword [0x14057b2f4], ebx
jbe 0x140022893
mov byte [rsp + 0x20], r15b
mov r9d, r13d
mov rcx, rdi
mov r8, rsi
call fcn.140059800
mov r14, rax
test r14, r14
je 0x140022893
mov r8, qword [rsp + 0x38]
lea rcx, [rdi + 0x338]
mov qword [rbp - 0x70], rcx
lea rax, [rdi + 8]
mov qword [rbp - 0x68], rax
lea rax, [rdi + 0x10]
mov qword [rbp - 0x60], rax
lea rax, [rdi + 0x340]
mov qword [rbp - 0x58], rax
mov byte [rbp - 0x78], 1
mov rdx, qword [rcx]
lea rax, [r8 + rdx]
mov qword [rcx], rax
mov rax, qword [rbp - 0x60]
mov rcx, qword [rax]
sub rcx, rdx
cmp r8, rcx
jb 0x140022c02
lea rdx, [rbp - 0x78]
mov rcx, rdi
call fcn.1400640e0
mov rbx, r14
jmp 0x14002289e
lea rcx, str._jemalloc_:_Error_allocating_TSD_n
call fcn.14002ee10
call fcn.1401f5dec
int3
lea rcx, str._jemalloc_:_Error_setting_TSD_n
call fcn.14002ee10
call fcn.1401f5dec
int3
call fcn.1401f5dec
int3