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

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x40
mov byte [rsp + 0x2f], 0
mov rax, qword [0x1402050d0]
cmp rax, 3
jne 0x1400e6047
cmp byte [rsp + 0x2f], 0
jne 0x1400e61f8
mov ecx, dword [0x140194038]
test ecx, ecx
je 0x1400e605e
dec ecx
call sub.kernel32.dll_TlsGetValue
cmp rax, 2
jb 0x1400e6077
mov rsi, rax
cmp byte [rax + 8], 0
je 0x1400e6077
add rsi, 9
mov rax, qword [0x140205098]
cmp rax, rsi
jne 0x1400e613b
mov eax, dword [0x1402050c8]
inc eax
je 0x1400e642c
mov dword [0x1402050c8], eax
cmp qword [0x1402050a0], 0
je 0x1400e616f
jmp 0x1400e642c
lea rcx, [rsp + 0x2f]
call fcn.1400dcae0
cmp byte [rsp + 0x2f], 0
jne 0x1400e61f8
jmp 0x1400e5fec
lea rcx, [0x140194020]
call fcn.1400db390
mov ecx, eax
call sub.kernel32.dll_TlsGetValue
cmp rax, 2
jae 0x1400e6003
mov ecx, dword [0x140194038]
test ecx, ecx
je 0x1400e609f
dec ecx
call sub.kernel32.dll_TlsGetValue
test rax, rax
je 0x1400e60b7
mov rsi, rax
cmp rax, 1
jne 0x1400e6121
jmp 0x1400e642c
lea rcx, [0x140194020]
call fcn.1400db390
mov ecx, eax
call sub.kernel32.dll_TlsGetValue
test rax, rax
jne 0x1400e608d
movzx eax, byte [0x140205110]
mov rcx, qword [0x140205100]
test rcx, rcx
jne 0x1400e60e2
call sub.kernel32.dll_GetProcessHeap
test rax, rax
je 0x1400e642c
mov rcx, rax
mov qword [0x140205100], rax
mov r8d, 0x10
xor edx, edx
call sub.kernel32.dll_HeapAlloc
test rax, rax
je 0x1400e642c
mov rsi, rax
lea rax, [0x140194020]
mov qword [rsi], rax
mov byte [rsi + 8], 0
mov ecx, dword [0x140194038]
test ecx, ecx
je 0x1400e640d
dec ecx
mov rdx, rsi
call sub.kernel32.dll_TlsSetValue
mov word [rsi + 8], 1
add rsi, 9
mov rax, qword [0x140205098]
cmp rax, rsi
je 0x1400e6020
lea rcx, [0x140205090]
call sub.kernel32.dll_TryAcquireSRWLockExclusive
test al, al
je 0x1400e61f8
mov qword [0x140205098], rsi
mov eax, 1
mov dword [0x1402050c8], eax
cmp qword [0x1402050a0], 0
jne 0x1400e642c
mov qword [0x1402050a0], 0xffffffffffffffff
cmp byte [0x1402050c0], 0
je 0x1400e6209
cmp qword [0x1402050a8], 0
je 0x1400e61a6
mov r8, qword [0x1402050b0]
mov rcx, qword [0x140205100]
xor edx, edx
call sub.kernel32.dll_HeapFree
mov qword [0x1402050a8], 0
mov qword [0x1402050b0], 1
mov qword [0x1402050b8], 0
mov qword [0x1402050be], 0
inc qword [0x1402050a0]
dec dword [0x1402050c8]
jne 0x1400e61f8
mov qword [0x140205098], 0
lea rcx, [0x140205090]
call fcn.1401152a4
nop
add rsp, 0x40
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov r14, qword [0x1402050b8]
test r14, r14
je 0x1400e6187
xor esi, esi
lea r15, [0x1402050c1]
lea rdi, [rsp + 0x30]
lea r12, str.failed_to_write_the_buffered_data
jmp 0x1400e6250
cmp byte [rbx + 0x10], 0x23
jne 0x1400e6343
nop word [rax + rax]
mov r14, qword [0x1402050b8]
cmp rsi, r14
jae 0x1400e63e7
mov byte [0x1402050c0], 1
sub r14, rsi
mov r8, qword [0x1402050b0]
add r8, rsi
mov qword [rsp + 0x20], r15
mov rcx, rdi
mov edx, 0xfffffff5
mov r9, r14
call fcn.1400e7aa0
cmp qword [rsp + 0x30], 0
je 0x1400e62f2
mov rbx, qword [rsp + 0x38]
mov eax, ebx
and eax, 3
cmp rax, 2
jae 0x1400e62f9
mov byte [0x1402050c0], 0
cmp eax, 1
jne 0x1400e6230
cmp byte [rbx + 0xf], 0x23
jne 0x1400e6343
mov r14, qword [rbx - 1]
mov r13, qword [rbx + 7]
mov rcx, r14
call qword [r13]
cmp qword [r13 + 8], 0
je 0x1400e62d9
cmp qword [r13 + 0x10], 0x11
jb 0x1400e62c8
mov r14, qword [r14 - 8]
mov rcx, qword [0x140205100]
xor edx, edx
mov r8, r14
call sub.kernel32.dll_HeapFree
dec rbx
mov rcx, qword [0x140205100]
xor edx, edx
mov r8, rbx
call sub.kernel32.dll_HeapFree
jmp 0x1400e6240
mov r14, qword [rsp + 0x38]
jmp 0x1400e630e
cmp eax, 2
jne 0x1400e6326
mov rax, rbx
shr rax, 0x20
cmp eax, 6
jne 0x1400e6420
mov byte [0x1402050c0], 0
test r14, r14
je 0x1400e6405
add rsi, r14
jmp 0x1400e6240
mov rax, rbx
shr rax, 0x20
mov byte [0x1402050c0], 0
cmp eax, 0x28
ja 0x1400e6343
cmp rax, 0x23
je 0x1400e6240
test rsi, rsi
je 0x1400e6381
mov rdi, qword [0x1402050b8]
sub rdi, rsi
jb 0x1400e642c
mov qword [0x1402050b8], 0
je 0x1400e6381
mov rcx, qword [0x1402050b0]
add rsi, rcx
mov rdx, rsi
mov r8, rdi
call sub.msvcrt.dll_memmove
mov qword [0x1402050b8], rdi
mov eax, ebx
and eax, 3
lea rcx, [rax - 2]
cmp rcx, 2
jb 0x1400e6187
test rax, rax
je 0x1400e6187
lea rsi, [rbx - 1]
mov rdi, qword [rbx - 1]
mov rbx, qword [rbx + 7]
mov rcx, rdi
call qword [rbx]
cmp qword [rbx + 8], 0
je 0x1400e63d1
cmp qword [rbx + 0x10], 0x11
jb 0x1400e63c0
mov rdi, qword [rdi - 8]
mov rcx, qword [0x140205100]
xor edx, edx
mov r8, rdi
call sub.kernel32.dll_HeapFree
mov rcx, qword [0x140205100]
xor edx, edx
mov r8, rsi
call sub.kernel32.dll_HeapFree
jmp 0x1400e6187
test rsi, rsi
je 0x1400e6187
cmp r14, rsi
jb 0x1400e642c
mov qword [0x1402050b8], 0
jmp 0x1400e6187
mov rbx, r12
jmp 0x1400e6343
lea rcx, [0x140194020]
call fcn.1400db390
mov ecx, eax
jmp 0x1400e6119
mov byte [0x1402050c0], 0
jmp 0x1400e6343
ud2