Function at 0x1400164e0
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 r13, rdx
mov r12, rcx
mov rax, qword [0x140163028]
xor rax, rsp
mov qword [rsp + 0x40], rax
lea rax, str.pd_n_
mov qword [rcx], rax
lea rax, str.pv_n_
mov qword [rcx + 8], rax
mov qword [rcx + 0x10], rdx
xorps xmm0, xmm0
movups xmmword [rcx + 0x18], xmm0
mov rax, qword [rdx + 0x368]
mov dword [rcx + 0x28], eax
mov eax, dword [0x14016c040]
mov ecx, dword [0x1401666f4]
mov rdx, qword gs:[0x58]
mov rcx, qword [rdx + rcx*8]
cmp eax, dword [rcx + 4]
jg 0x1400168df
mov ecx, dword [0x140166310]
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
and rax, 0xfffffffffffffffc
je 0x1400168d8
movsxd rcx, dword [0x14016c038]
shl rcx, 4
mov edx, dword [rax + rcx + 8]
cmp edx, dword [0x14016c03c]
jne 0x1400168d8
mov rax, qword [rax + rcx]
lea rsi, [r12 + 8]
lea rcx, [rsp + 0x38]
mov qword [rcx], rax
mov rdx, r12
call fcn.140016940
call fcn.140016e00
mov rdi, rax
call fcn.140020c50
mov rax, qword [rax]
mov qword [rsp + 0x30], rax
test rax, rax
je 0x1400165bc
lock inc dword [rax + 8]
lea r8, str.ThreadLocalEventBuffer
lea r9, [rsp + 0x30]
mov rcx, rdi
mov rdx, rsi
call fcn.140016aa0
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ebp, eax
lea rsi, [r13 + 8]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x140016826
mov qword [rsp + 0x28], rsi
call fcn.140020c50
mov r14, qword [rax]
test r14, r14
je 0x140016607
lock inc dword [r14 + 8]
lea r9, [r13 + 0x310]
movsxd rsi, ebp
mov r15, qword [r13 + 0x318]
test r15, r15
je 0x1400167b7
mov rax, r15
shr rax, 1
movabs rcx, 0x5555555555555555
and rcx, rax
mov rax, r15
sub rax, rcx
movabs rcx, 0x3333333333333333
mov rdx, rax
and rdx, rcx
shr rax, 2
and rax, rcx
add rax, rdx
mov rcx, rax
shr rcx, 4
add rcx, rax
movabs rax, 0xf0f0f0f0f0f0f0f
and rax, rcx
movabs rcx, 0x101010101010101
imul rcx, rax
shr rcx, 0x38
cmp rcx, 1
ja 0x14001680a
lea rdi, [r15 - 1]
and rdi, rsi
mov rax, qword [r9]
mov rbx, qword [rax + rdi*8]
test rbx, rbx
je 0x1400166d5
lea r8, [r15 - 1]
mov rbx, qword [rbx]
test rbx, rbx
je 0x1400166d5
mov rax, qword [rbx + 8]
cmp rax, rsi
je 0x1400166bc
cmp ecx, 1
ja 0x1400166c6
and rax, r8
cmp rax, rdi
jne 0x1400166d5
cmp dword [rbx + 0x10], ebp
jne 0x14001669e
jmp 0x14001677a
cmp rax, r15
jb 0x1400166b7
xor edx, edx
div r15
mov rax, rdx
jmp 0x1400166b7
mov rbp, r9
mov ecx, 0x20
call fcn.140105030
mov rbx, rax
mov dword [rax + 0x10], esi
xor eax, eax
mov qword [rbx + 0x18], rax
mov qword [rbx + 8], rsi
mov qword [rbx], rax
mov rax, qword [r13 + 0x328]
inc rax
js 0x140016708
cvtsi2ss xmm0, rax
jmp 0x14001671d
mov rcx, rax
shr rcx, 1
and eax, 1
or rax, rcx
cvtsi2ss xmm0, rax
addss xmm0, xmm0
mov rcx, r15
shr rcx, 1
mov eax, r15d
and eax, 1
or rax, rcx
test r15, r15
js 0x140016738
cvtsi2ss xmm1, r15
jmp 0x140016741
cvtsi2ss xmm1, rax
addss xmm1, xmm1
movss xmm2, dword [r13 + 0x330]
je 0x140016842
mulss xmm1, xmm2
ucomiss xmm0, xmm1
ja 0x140016842
mov rcx, qword [rbp]
mov rax, qword [rcx + rdi*8]
test rax, rax
je 0x1400167c9
mov rcx, qword [rax]
mov qword [rbx], rcx
mov qword [rax], rbx
inc qword [r13 + 0x328]
mov rcx, qword [rbx + 0x18]
mov qword [rbx + 0x18], r14
test rcx, rcx
jne 0x140016922
mov rcx, qword [rsp + 0x28]
call qword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov rcx, qword [rsp + 0x40]
xor rcx, rsp
call fcn.140107cc0
mov rax, r12
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rbp, r9
movabs rdi, 0xaaaaaaaaaaaaaaaa
jmp 0x1400166d8
lea rax, [r13 + 0x320]
mov rdx, qword [r13 + 0x320]
mov qword [rbx], rdx
mov qword [r13 + 0x320], rbx
mov qword [rcx + rdi*8], rax
mov rax, qword [rbx]
test rax, rax
je 0x140016773
mov rax, qword [rax + 8]
lea rcx, [r15 - 1]
test r15, rcx
jne 0x140016833
and rax, rcx
shl rax, 3
add rax, qword [rbp]
jmp 0x140016770
mov rdi, rsi
cmp r15, rsi
ja 0x14001668e
mov rax, rsi
xor edx, edx
div r15
mov rdi, rdx
jmp 0x14001668e
mov rcx, rsi
call fcn.1400071b0
jmp 0x1400165f0
cmp rax, r15
jb 0x1400167fd
xor edx, edx
div r15
mov rax, rdx
jmp 0x1400167fd
mov qword [rsp + 0x20], rbp
divss xmm0, xmm2
call fcn.1401307a0
cvttss2si rcx, xmm0
movss xmm1, dword [0x140142404]
movaps xmm2, xmm0
subss xmm2, xmm1
cvttss2si rax, xmm2
btc rax, 0x3f
ucomiss xmm0, xmm1
cmovb rax, rcx
lea rcx, [r15 + r15]
mov edx, 1
cmp r15, 3
jb 0x140016890
lea rbp, [r15 - 1]
xor edx, edx
test r15, rbp
setne dl
or rdx, rcx
cmp rdx, rax
cmovb rdx, rax
mov rcx, qword [rsp + 0x20]
call fcn.140018300
mov r15, qword [r13 + 0x318]
lea rdi, [r15 - 1]
test r15, rdi
jne 0x1400168c1
and rdi, rsi
mov rbp, qword [rsp + 0x20]
jmp 0x14001675d
cmp r15, rsi
jbe 0x1400168cb
mov rdi, rsi
jmp 0x1400168b7
mov rax, rsi
xor edx, edx
div r15
mov rdi, rdx
jmp 0x1400168b7
xor eax, eax
jmp 0x140016589
lea rcx, [0x14016c040]
call fcn.1401050e8
cmp dword [0x14016c040], 0xffffffff
jne 0x140016554
mov qword [0x14016c038], 0
lea rcx, [0x14016c038]
xor edx, edx
call fcn.14002ec30
lea rcx, [0x14016c040]
call fcn.1401052d4
jmp 0x140016554
lock dec dword [rcx + 8]
jne 0x14001678b
add rcx, 8
add rcx, 0xfffffffffffffff8
call fcn.14003d4a0
jmp 0x14001678b