Function at 0x140161e20
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, 0x48
mov r12, rdx
mov rdi, rcx
mov rax, qword [0x1401ff028]
xor rax, rsp
mov qword [rsp + 0x40], rax
cmp rcx, 0x10
ja 0x140034662
lea rax, [rdi - 1]
test rdi, rax
sete al
test rdi, rdi
setne cl
test cl, al
je 0x140034991
mov r15, qword [0x140207738]
test r15, r15
je 0x140034994
movabs rax, 0xaaaaaaaaaaaaaaaa
mov edx, 0x40
mov ecx, 0x40
test r12, r12
je 0x140034468
bsr rcx, r12
xor rcx, 0x3f
sub rdx, rcx
lea rcx, [0x1401e0fb0]
mov cl, byte [rdx + rcx]
mov rbp, r12
shr rbp, cl
and ebp, 7
lea rcx, [0x1401e1000]
mov rcx, qword [rcx + rdx*8]
and rcx, r12
lea rdx, [rdx*8]
add rdx, rbp
cmp rcx, 1
sbb rdx, 0xffffffffffffffff
lea rcx, [0x1401e0790]
movzx r14d, word [rcx + rdx*2 + 0x400]
mov byte [rsp + 0x3f], 0
mov qword [rsp + 0x30], rax
cmp byte [r15], 2
je 0x1400349a1
cmp byte [r15 + 2], 0
je 0x1400349b9
mov edi, dword [0x14020a3fc]
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 0x14003487a
cmp rdi, 2
jb 0x1400349fa
inc qword [rdi + 0x5a0]
cmp r14w, 0x29
jae 0x140034592
mov rsi, r14
shl rsi, 4
mov rbp, rdi
add rbp, rsi
mov rbx, qword [rdi + rsi]
test rbx, rbx
je 0x140034848
inc qword [rdi + 0x5a8]
mov rax, qword [rbx]
test rax, rax
je 0x140034822
mov rcx, rax
not rcx
cmp qword [rbx + 8], rcx
jne 0x140034a6b
bswap rax
prefetcht0 byte [rax]
dec byte [rdi + rsi + 8]
mov qword [rbp], rax
movzx eax, word [rdi + rsi + 0xa]
mov qword [rsp + 0x30], rax
movzx eax, word [rdi + rsi + 0xa]
sub qword [rdi + 0x590], rax
test rbx, rbx
je 0x1400345a0
mov rcx, qword [rsp + 0x40]
xor rcx, rsp
call fcn.140106510
mov rax, rbx
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
inc qword [rdi + 0x5c0]
inc qword [rdi + 0x5b0]
lea rax, [r14 + r14*4]
lea rsi, [r15 + rax*8]
add rsi, 0x10
lea r14, [r15 + 8]
mov edi, 1
xor ebx, ebx
mov rbp, qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov rcx, r14
call rbp
test al, al
jne 0x1400345f2
jmp 0x14003488e
pause
dec eax
jne 0x1400345cc
add ebx, edi
add edi, edi
cmp edi, 0x40
mov eax, 0x40
cmovge edi, eax
cmp ebx, 0x3e8
jl 0x1400345be
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov rax, qword [rsi]
mov rbx, qword [rax]
test rbx, rbx
je 0x140034639
mov byte [rsp + 0x3f], 0
mov rcx, qword [rbx]
test rcx, rcx
je 0x14003481b
mov rdx, rcx
not rdx
cmp qword [rbx + 8], rdx
jne 0x140034a6b
bswap rcx
prefetcht0 byte [rcx]
mov qword [rax], rcx
inc word [rax + 0x18]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x140034571
lea rax, [rsp + 0x3f]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], 0x4000
mov rcx, rsi
mov rdx, r15
xor r8d, r8d
mov r9, r12
int3
mov r14, qword [0x140207738]
test r14, r14
je 0x140034a70
lea r13, [rdi - 1]
test rdi, r13
sete al
test rdi, rdi
setne cl
test cl, al
je 0x140034a7d
cmp rdi, 0x100001
jae 0x140034a80
cmp rdi, 0x4001
jb 0x1400346ad
cmp r12, 0xf0001
jae 0x140034abf
cmp rdi, 0x4000
ja 0x14003497a
cmp r12, rdi
jae 0x140034829
mov r15, rdi
mov edi, 0x4000
cmp r15, r12
jb 0x140034ab3
movabs rax, 0xaaaaaaaaaaaaaaaa
mov edx, 0x40
mov ecx, 0x40
test r15, r15
je 0x1400346f5
bsr rcx, r15
xor rcx, 0x3f
sub rdx, rcx
lea rcx, [0x1401e0fb0]
mov cl, byte [rdx + rcx]
mov rbp, r15
shr rbp, cl
and ebp, 7
lea rcx, [0x1401e1000]
mov rcx, qword [rcx + rdx*8]
and rcx, r15
lea rdx, [rdx*8]
add rdx, rbp
cmp rcx, 1
sbb rdx, 0xffffffffffffffff
lea rcx, [0x1401e0790]
movzx r12d, word [rcx + rdx*2 + 0x400]
mov byte [rsp + 0x3f], 0
mov qword [rsp + 0x30], rax
cmp byte [r14], 2
je 0x140034a83
cmp byte [r14 + 2], 0
je 0x140034a12
cmp rdi, 0x4000
ja 0x140034a12
mov edi, dword [0x14020a3fc]
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 0x14003495a
cmp rdi, 2
jb 0x140034a9b
inc qword [rdi + 0x5a0]
cmp r12w, 0x29
jae 0x140034967
mov rsi, r12
shl rsi, 4
mov rbp, rdi
add rbp, rsi
mov rbx, qword [rdi + rsi]
test rbx, rbx
je 0x14003489d
inc qword [rdi + 0x5a8]
mov rax, qword [rbx]
test rax, rax
je 0x140034887
mov rcx, rax
not rcx
cmp qword [rbx + 8], rcx
jne 0x140034a6b
bswap rax
prefetcht0 byte [rax]
dec byte [rdi + rsi + 8]
mov qword [rbp], rax
movzx eax, word [rdi + rsi + 0xa]
mov qword [rsp + 0x30], rax
movzx eax, word [rdi + rsi + 0xa]
sub qword [rdi + 0x590], rax
test rbx, rbx
je 0x1400348c3
test r13, rbx
je 0x140034571
int3
xor ecx, ecx
jmp 0x140034624
xor eax, eax
jmp 0x14003454e
mov rax, r12
dec rax
je 0x140034873
bsr rcx, rax
xor rcx, 0x3f
neg cl
mov edi, 1
shl rdi, cl
jmp 0x1400346c3
inc qword [rdi + 0x5b8]
inc qword [rdi + 0x5b0]
mov rcx, rdi
mov rdx, r14
int3
mov ecx, 0x40
jmp 0x140034839
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x1400344ef
xor eax, eax
jmp 0x1400347e8
mov eax, edi
test edi, edi
jg 0x1400345cc
jmp 0x1400345d4
inc qword [rdi + 0x5b8]
inc qword [rdi + 0x5b0]
mov rcx, rdi
mov rdx, r12
int3
lea rax, [r12 + r12*4]
lea rsi, [r14 + rax*8]
add rsi, 0x10
lea rbp, [r14 + 8]
mov edi, 1
xor ebx, ebx
mov r12, qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov rcx, rbp
call r12
test al, al
jne 0x140034916
jmp 0x140034982
pause
dec eax
jne 0x1400348f0
add ebx, edi
add edi, edi
cmp edi, 0x40
mov eax, 0x40
cmovge edi, eax
cmp ebx, 0x3e8
jl 0x1400348e1
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov rax, qword [rsi]
mov rbx, qword [rax]
test rbx, rbx
jne 0x140034a40
lea rax, [rsp + 0x3f]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], 0x4000
mov rcx, rsi
mov rdx, r14
xor r8d, r8d
mov r9, r15
int3
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x14003480f
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x140034789
inc qword [rdi + 0x5c0]
inc qword [rdi + 0x5b0]
jmp 0x1400348c3
mov r15, r12
jmp 0x1400346d4
mov eax, edi
test edi, edi
jg 0x1400348f0
jmp 0x1400348f8
int3
int3
mov al, byte [0x1402021f8]
cmp al, 2
jne 0x1400344c3
int3
lea rsi, [r14 + r14*4]
lea r14, [r15 + 8]
mov rcx, r14
int3
lea r8, [rsp + 0x30]
mov rcx, r15
mov edx, r14d
call fcn.140018750
mov rbx, rax
jmp 0x14003456c
lea rbp, [r14 + 8]
mov rcx, rbp
int3
mov byte [rsp + 0x3f], 0
mov rcx, qword [rbx]
test rcx, rcx
je 0x140034abb
mov rdx, rcx
not rdx
cmp qword [rbx + 8], rdx
jne 0x140034a6b
bswap rcx
prefetcht0 byte [rcx]
mov qword [rax], rcx
inc word [rax + 0x18]
jmp 0x14003494c
call fcn.140161e10
int3
int3
int3
mov al, byte [0x1402021f8]
cmp al, 2
jne 0x140034750
int3
lea r8, [rsp + 0x30]
mov rcx, r14
mov edx, r12d
call fcn.140018750
mov rbx, rax
jmp 0x140034806
mov rcx, r12
int3
xor ecx, ecx
jmp 0x140034a5f
int3
mov rcx, rdx
mov rdx, r8
jmp 0x1400343f0