Function at 0x140021ef0
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 [0x14035e2b0]
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 0x140021f54
call fcn.140028800
test al, al
je 0x140021f54
mov ecx, ntohs
call qword [sym.imp.KERNEL32.dll_SetLastError]
xor ebx, ebx
jmp 0x140022634
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x140577180]
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 0x140022232
mov ecx, 0xa50
call fcn.1400306e0
mov rdi, rax
test rax, rax
je 0x14002296a
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.1401e1b90
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.1401e1b90
lea rcx, [rdi + 8]
mov qword [rbp + 0x9f8], rbx
lea rdx, [rbp - 0x40]
mov byte [rbp + 0xa00], bl
mov r8d, 0xa48
call fcn.1401e14e0
mov ecx, dword [0x140577180]
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x14002297c
add rdi, 8
cmp byte [rdi + 0x330], bl
je 0x14002224b
xor edx, edx
mov rcx, rdi
call fcn.140030d00
mov rdi, rax
mov rsi, r12
imul rsi, r14
cmp byte [rdi + 0x330], bl
jne 0x1400225d1
lea r8, [0x140000000]
movabs rcx, 0x7000000000000000
mov edx, 4
test rsi, rsi
jne 0x140022293
test r14, r14
je 0x1400222c3
test r12, r12
je 0x1400222c3
mov ecx, ntohs
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140022634
mov rax, r12
movabs r9, 0xffffffff00000000
or rax, r14
test r9, rax
je 0x1400222ba
xor edx, edx
mov rax, rsi
div r12
cmp rax, r14
jne 0x140022283
mov edx, 4
cmp rsi, 0x1000
ja 0x1400222d6
lea rax, [rsi + 7]
shr rax, 3
movzx r13d, byte [rax + r8 + 0x370080]
jmp 0x140022337
cmp rsi, rcx
jbe 0x1400222e3
mov r13d, 0xe8
jmp 0x140022337
lea rax, [rsi*2 - 1]
test rax, rax
je 0x14002298e
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 0x140022319
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 0x140022283
mov r12d, r13d
lea rdx, [r8 + 0x36f940]
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 0x140022551
cmp rsi, 0x3800
ja 0x140022459
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 0x1400223a1
mov qword [r15 + 8], rax
jmp 0x140022443
cmp cx, word [r15 + 0x1c]
je 0x1400223b6
mov qword [r15 + 8], rax
mov word [r15 + 0x18], ax
jmp 0x140022443
xor edx, edx
mov rcx, rdi
call fcn.140020d20
mov qword [rsp + 0x40], rax
mov rcx, rax
test rax, rax
jne 0x1400223d5
mov r14, rbx
jmp 0x140022569
mov rax, qword [0x140376270]
mov r9d, r13d
mov byte [rsp + 0x20], 1
cmp word [rax + r12*2], bx
jne 0x1400223f3
mov rdx, rcx
jmp 0x14002255b
lea r8, [r15 + 8]
mov rcx, rdi
lea rdx, [rdi + 0x358]
call fcn.14005dcc0
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.14005cc80
mov r14, rax
cmp byte [rsp + 0x30], bl
jne 0x14002243e
mov r14, rbx
jmp 0x140022569
mov rdx, qword [rsp + 0x38]
mov r8, qword [rdx]
mov rcx, r14
xor edx, edx
call fcn.1401e1b90
inc qword [r15 + 0x10]
jmp 0x140022569
cmp rsi, qword [0x140376258]
ja 0x140022551
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 0x140022489
mov qword [r12 + 8], rax
jmp 0x14002249c
cmp cx, word [r12 + 0x1c]
je 0x1400224b3
mov qword [r12 + 8], rax
mov word [r12 + 0x18], ax
mov r8, qword [rdx]
mov rcx, r14
xor edx, edx
call fcn.1401e1b90
inc qword [r12 + 0x10]
jmp 0x140022569
xor edx, edx
mov rcx, rdi
call fcn.140020d20
mov qword [rsp + 0x38], rax
test rax, rax
jne 0x1400224cf
mov r14, rbx
jmp 0x140022569
mov r9d, r13d
mov byte [rsp + 0x20], bl
lea r8, [r12 + 8]
mov rcx, rdi
lea rdx, [rdi + 0x358]
call fcn.14005dcc0
movabs rax, 0x7000000000000000
cmp rsi, rax
jbe 0x1400224fe
mov r8, rbx
jmp 0x140022534
lea rax, [rsi*2 - 1]
test rax, rax
je 0x14002298e
bsr rcx, rax
cmp rcx, 7
jae 0x140022520
mov ecx, 4
jmp 0x140022524
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.14005c180
mov r14, rax
test rax, rax
jne 0x140022569
mov r14, rbx
jmp 0x140022569
mov byte [rsp + 0x20], r15b
mov r9d, r13d
xor edx, edx
mov r8, rsi
mov rcx, rdi
call fcn.140059560
mov r14, rax
test r14, r14
je 0x140022283
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 0x1400225cc
lea rdx, [rsp + 0x60]
mov rcx, rdi
call fcn.140063e40
mov rbx, r14
jmp 0x140022634
lea rcx, [0x140000000]
test rsi, rsi
jne 0x140022661
test r14, r14
je 0x140022690
test r12, r12
je 0x140022690
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.140038e10
mov rax, rbx
mov rcx, qword [rbp + 0xa28]
xor rcx, rsp
call fcn.1401dee10
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 0x140022687
xor edx, edx
mov rax, rsi
div r12
cmp rax, r14
jne 0x1400225f3
cmp rsi, 0x1000
ja 0x1400226a3
lea rax, [rsi + 7]
shr rax, 3
movzx r13d, byte [rax + rcx + 0x370080]
jmp 0x1400226b5
mov rcx, rsi
call fcn.14002b460
mov r13d, eax
lea rcx, [0x140000000]
cmp r13d, 0xe8
jae 0x1400225f3
lea r8, [rcx + 0x36f940]
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 0x1400228cd
mov r12, rbx
cmp byte [rdi], bl
je 0x1400226f4
lea r12, [rdi + 0x358]
mov qword [rsp + 0x40], r12
mov rdx, rbx
test r12, r12
je 0x1400228ef
cmp rsi, 0x3800
ja 0x1400227dc
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 0x140022736
mov qword [r15 + 8], rax
jmp 0x1400227c6
cmp cx, word [r15 + 0x1c]
je 0x140022748
mov qword [r15 + 8], rax
mov word [r15 + 0x18], ax
jmp 0x1400227c6
mov rcx, rdi
call fcn.140020d20
mov r14, rax
test rax, rax
jne 0x140022760
mov r14, rbx
jmp 0x140022905
mov rax, qword [0x140376270]
mov r9d, r13d
mov ecx, r13d
mov byte [rsp + 0x20], 1
cmp word [rax + rcx*2], bx
mov rcx, rdi
jne 0x140022783
mov rdx, r14
jmp 0x1400228fa
lea r8, [r15 + 8]
mov rdx, r12
call fcn.14005dcc0
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.14005cc80
mov r14, rax
cmp byte [rsp + 0x31], bl
jne 0x1400227c1
mov r14, rbx
jmp 0x140022905
mov r8, qword [rsp + 0x48]
mov r8, qword [r8]
xor edx, edx
mov rcx, r14
call fcn.1401e1b90
inc qword [r15 + 0x10]
jmp 0x140022905
cmp rsi, qword [0x140376258]
ja 0x1400228ef
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 0x14002280c
mov qword [r12 + 8], rax
jmp 0x14002281f
cmp cx, word [r12 + 0x1c]
je 0x140022834
mov qword [r12 + 8], rax
mov word [r12 + 0x18], ax
mov r8, qword [r8]
mov rcx, r14
call fcn.1401e1b90
inc qword [r12 + 0x10]
jmp 0x140022905
mov rcx, rdi
call fcn.140020d20
mov r14, rax
test rax, rax
jne 0x14002284c
mov r14, rbx
jmp 0x140022905
mov rdx, qword [rsp + 0x40]
lea r8, [r12 + 8]
mov r9d, r13d
mov byte [rsp + 0x20], bl
mov rcx, rdi
call fcn.14005dcc0
movabs rax, 0x7000000000000000
cmp rsi, rax
jbe 0x140022879
mov r8, rbx
jmp 0x1400228b2
lea rax, [rsi*2 - 1]
test rax, rax
je 0x14002298e
bsr rax, rax
cmp rax, 7
jae 0x14002289b
mov eax, 4
jmp 0x14002289f
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.14005c180
mov r14, rax
test rax, rax
jne 0x140022905
mov r14, rbx
jmp 0x140022905
movzx r8d, r15b
xor edx, edx
mov rcx, rdi
call fcn.1400213e0
mov rdx, rax
test rax, rax
jne 0x1400228ef
cmp dword [0x1405771f4], ebx
jbe 0x1400225f3
mov byte [rsp + 0x20], r15b
mov r9d, r13d
mov rcx, rdi
mov r8, rsi
call fcn.140059560
mov r14, rax
test r14, r14
je 0x1400225f3
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 0x140022962
lea rdx, [rbp - 0x78]
mov rcx, rdi
call fcn.140063e40
mov rbx, r14
jmp 0x1400225fe
lea rcx, str._jemalloc_:_Error_allocating_TSD_n
call fcn.14002eb70
call fcn.1401f3454
int3
lea rcx, str._jemalloc_:_Error_setting_TSD_n
call fcn.14002eb70
call fcn.1401f3454
int3
call fcn.1401f3454
int3