Function at 0x1400ca960
Capabilities:
Get thread local storage value

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x58
mov rsi, rdx
mov r14, rcx
mov rax, qword [0x14015e028]
xor rax, rsp
mov qword [rsp + 0x50], rax
mov rax, rdx
and rax, 0xffffffffffe00000
mov rcx, rdx
shr rcx, 9
and ecx, 0xfe0
lea r13, [rax + rcx]
add r13, 0x1000
movzx eax, word [r13 + 0x1e]
mov rcx, rax
neg rcx
mov qword [rsp + 0x20], rcx
shl rax, 5
mov qword [rsp + 0x28], r13
sub r13, rax
mov rax, qword [r13 + 0x10]
mov eax, dword [rax + 0x18]
mov rcx, qword [r14 + 0x10]
add qword [rcx], rax
lea rbp, [r13 + 0x10]
mov rbx, qword [r14]
cmp byte [rbx + 2], 0
je 0x1400cab21
mov r12, qword [rbp]
cmp byte [r12 + 0x1c], 0
je 0x1400cab21
mov r15, r14
mov r14, rbp
mov edi, dword [0x140169500]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
test ebp, ebp
jne 0x1400cab0d
cmp rdi, 2
mov rbp, r14
mov r14, r15
jb 0x1400cab21
sub r12, rbx
add r12, 0xfffffffffffffff0
sar r12, 3
movabs rax, 0xcccccccccccccccd
imul rax, r12
inc qword [rdi + 0x2c0]
cmp rax, 0x28
ja 0x1400cab1a
shl rax, 4
mov rcx, qword [rdi + rax]
bswap rcx
mov qword [rsi], rcx
not rcx
mov qword [rsi + 8], rcx
mov qword [rdi + rax], rsi
inc byte [rdi + rax + 8]
inc qword [rdi + 0x2c8]
movzx r8d, byte [rdi + rax + 9]
cmp byte [rdi + rax + 8], r8b
jae 0x1400cabe5
mov al, byte [rdi + 0x290]
test al, 1
jne 0x1400cabfb
cmp byte [r14 + 8], 0
je 0x1400caaee
mov rcx, qword [rsp + 0x20]
shl rcx, 5
mov rax, qword [rsp + 0x28]
cmp byte [rax + rcx + 0x1d], 0
jne 0x1400cac08
mov rax, qword [rbp]
mov r8d, dword [rax + 0x18]
add r8, 0x1fff
shr r8, 0xd
je 0x1400caaee
movabs rax, 0xfffffffc00000000
and rax, rsi
shr rsi, 0xd
and esi, 0x1fffff
add rsi, rax
mov rcx, rsi
xor edx, edx
call fcn.14009fa40
mov rcx, qword [rsp + 0x50]
xor rcx, rsp
call fcn.14009d180
nop
add rsp, 0x58
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov ecx, ebp
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x1400caa18
inc qword [rdi + 0x2d0]
add rbx, 8
xorps xmm0, xmm0
movaps xmmword [rsp + 0x40], xmm0
mov edi, 1
xor r12d, r12d
mov r15, qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov rcx, rbx
call r15
test al, al
jne 0x1400cab72
jmp 0x1400cac11
pause
dec eax
jne 0x1400cab4b
add r12d, edi
add edi, edi
cmp edi, 0x40
mov eax, 0x40
cmovge edi, eax
cmp r12d, 0x3e8
jl 0x1400cab3c
mov rcx, rbx
call sub.KERNEL32.dll_AcquireSRWLockExclusive
mov rax, qword [r13]
cmp rax, rsi
je 0x1400cac2f
bswap rax
mov qword [rsi], rax
not rax
mov qword [rsi + 8], rax
mov qword [r13], rsi
mov rax, qword [rsp + 0x20]
shl rax, 5
mov rdx, qword [rsp + 0x28]
movzx ecx, word [rdx + rax + 0x18]
dec ecx
mov word [rdx + rax + 0x18], cx
test cx, cx
jle 0x1400cac20
xorps xmm0, xmm0
movaps xmmword [rsp + 0x30], xmm0
movaps xmm0, xmmword [rsp + 0x30]
movaps xmmword [rsp + 0x40], xmm0
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
cmp qword [rsp + 0x40], 0
je 0x1400caa95
lea rcx, [rsp + 0x40]
call fcn.14003df10
jmp 0x1400caa95
mov rdx, rdi
add rdx, rax
shr r8, 1
mov rcx, rdi
call fcn.14007f500
jmp 0x1400caa87
mov rcx, rdi
call fcn.14007f6c0
jmp 0x1400caa95
mov r8, qword [r13 + 0x20]
jmp 0x1400caabd
mov eax, edi
test edi, edi
jg 0x1400cab4b
jmp 0x1400cab54
lea rdx, [rsp + 0x30]
mov rcx, r13
call fcn.14007f740
jmp 0x1400cabb7
int3