Function at 0x140089c40
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, 0x38
mov r12, rcx
mov rax, qword [0x1400e5028]
xor rax, rsp
mov qword [rsp + 0x30], rax
call fcn.14008aff0
mov r14, rax
mov r15, rax
mov eax, 0x40
mov ecx, 0x40
test r12, r12
je 0x140089c84
bsr rcx, r12
xor rcx, 0x3f
sub rax, rcx
lea rcx, [0x1400cc640]
mov cl, byte [rax + rcx]
mov rdx, r12
shr rdx, cl
and edx, 7
lea rcx, [0x1400cc690]
mov rcx, qword [rcx + rax*8]
and rcx, r12
lea rax, [rdx + rax*8]
cmp rcx, 1
sbb rax, 0xffffffffffffffff
lea rcx, [0x1400cc898]
movzx r13d, word [rcx + rax*2 + 0x400]
mov byte [rsp + 0x2f], 0
cmp byte [r15 + 2], 0
je 0x140089d8e
mov edi, dword [0x1400f0298]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, rax
test ebx, ebx
jne 0x140089d81
cmp rdi, 1
jbe 0x140089de8
inc qword [rdi + 0x298]
cmp r13w, 0x29
jae 0x140089e0b
mov rsi, r13
shl rsi, 4
mov rbp, rdi
add rbp, rsi
cmp qword [rdi + rsi], 0
je 0x140089eae
inc qword [rdi + 0x2a0]
mov rbx, qword [rbp]
mov rax, qword [rbx]
test rax, rax
je 0x140089d4c
mov rcx, rax
not rcx
cmp qword [rbx + 8], rcx
jne 0x140089ed9
bswap rax
dec byte [rdi + rsi + 8]
mov qword [rbp], rax
test rbx, rbx
je 0x140089e19
mov rcx, qword [rsp + 0x30]
xor rcx, rsp
call fcn.14005e850
mov rax, rbx
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140089cf5
lea rax, [r13*4]
add rax, r13
lea rsi, [r14 + rax*8]
add rsi, 0x10
add r14, 8
mov edi, 1
xor ebx, ebx
mov r13, qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov ebp, 0x40
mov rcx, r14
call r13
test al, al
jne 0x140089e72
jmp 0x140089eed
pause
dec eax
jne 0x140089dcb
add ebx, edi
add edi, edi
cmp edi, 0x40
cmovge edi, ebp
cmp ebx, 0x3e8
jl 0x140089db8
jmp 0x140089e6a
je 0x140089e19
mov byte [r15 + 2], 0
mov rcx, r15
call fcn.140054960
mov rdi, rax
mov byte [r15 + 2], 1
inc qword [rax + 0x298]
jmp 0x140089d06
inc qword [rdi + 0x2b8]
inc qword [rdi + 0x2a8]
lea rax, [r13*4]
add rax, r13
lea rsi, [r14 + rax*8]
add rsi, 0x10
add r14, 8
mov edi, 1
xor ebx, ebx
mov r13, qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov ebp, 0x40
mov rcx, r14
call r13
test al, al
jne 0x140089e72
jmp 0x140089ede
pause
dec eax
jne 0x140089e52
add ebx, edi
add edi, edi
cmp edi, 0x40
cmovge edi, ebp
cmp ebx, 0x3e8
jl 0x140089e43
mov rcx, r14
call sub.KERNEL32.dll_AcquireSRWLockExclusive
mov rax, qword [rsi]
mov rbx, qword [rax]
test rbx, rbx
je 0x140089efc
mov byte [rsp + 0x2f], 0
mov rcx, qword [rbx]
test rcx, rcx
je 0x140089e96
mov rdx, rcx
not rdx
cmp qword [rbx + 8], rdx
jne 0x140089ed9
bswap rcx
mov qword [rax], rcx
inc word [rax + 0x18]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x140089d60
inc qword [rdi + 0x2b0]
inc qword [rdi + 0x2a8]
mov rcx, rdi
mov rdx, r13
call fcn.140054be0
mov rbx, qword [rbp]
test rbx, rbx
jne 0x140089d34
jmp 0x140089e19
call 0x140089960
mov eax, edi
test edi, edi
jg 0x140089e52
jmp 0x140089e5a
mov eax, edi
test edi, edi
jg 0x140089dcb
jmp 0x140089dd3
lea rax, [rsp + 0x2f]
mov qword [rsp + 0x20], rax
mov rcx, rsi
mov rdx, r15
xor r8d, r8d
mov r9, r12
call fcn.14003bd50
mov rbx, rax
jmp 0x140089ea0