Function at 0x140197e50
Capabilities:
Get thread local storage value

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x70
mov rbx, qword [0x14020ba20]
test rbx, rbx
je 0x140197f71
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rbx]
mov esi, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, esi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rbx, rbx
je 0x140197f71
mov rbx, qword [rbx + 0x10]
test rbx, rbx
je 0x140197ea3
mov eax, dword [rbx + 0x28]
cmp eax, 3
je 0x140197eb2
add rsp, 0x70
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov qword [rsp + 0x68], 0
lea rax, [rbx + 0x38]
lea rsi, [rsp + 0x50]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x60], 0
mov rdx, rsi
mov qword [rsp + 0x58], 0
xchg qword [rax], rdx
test rdx, rdx
je 0x140197f1f
mov qword [rdx + 8], rsi
xor eax, eax
add rdx, 0x18
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x140197f0a
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea rbp, [rsi + 0x10]
xor edi, edi
lock xadd qword [rbp], rdi
test rdi, rdi
je 0x140198020
cmp dword [rbx + 0x18c], 1
jne 0x1401980b7
mov r8, qword [rsp + 0x50]
lea rcx, [rsi + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x140198070
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x140197ea3
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x140197ea3
lea rdi, [rsp + 0x40]
mov rcx, rdi
call sym.ptw32_new
mov rsi, qword [rsp + 0x40]
mov r13, qword [rsp + 0x48]
test rsi, rsi
mov rbx, rsi
je 0x140197ea3
or byte [rsi + 0x194], 1
mov dword [rsi + 0x184], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov rbp, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rsi + 0x198], eax
call rbp
mov r14, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov r12, rax
call rbp
mov dword [rsp + 0x30], 2
mov r8, r14
mov rdx, r12
mov dword [rsp + 0x28], 0
lea r9, [rsi + 8]
mov rcx, rax
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x140198050
mov rcx, qword [rsi + 8]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rcx, qword [0x14020ba20]
mov rdx, rsi
mov dword [rsi + 0x188], eax
call sym.pthread_setspecific
jmp 0x140197e9b
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r12, rax
mov rax, rdi
lock cmpxchg qword [rbp], r12
test rax, rax
je 0x1401980a0
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140197f1f
mov rcx, rdi
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x48], r13
call sym.ptw32_threadReusePush
jmp 0x140197ea3
mov rax, rsi
lock cmpxchg qword [r8], rdx
cmp rsi, rax
je 0x140197ea3
lea rcx, [rsi + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x1401980b0
add rsi, 8
xor ecx, ecx
lock xadd qword [rsi], rcx
jmp 0x140197f48
mov edx, 0xffffffff
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x140198041
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x14019808f
mov rcx, qword [rbx + 0x40]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov rcx, rsi
mov dword [rbx + 0x28], 4
mov dword [rbx + 0x18c], 1
call sym.ptw32_mcs_lock_release
mov ecx, 2
call sym.ptw32_throw
nop
nop word cs:[rax + rax]