Function at 0x140198b70
Capabilities:
Get thread local storage value

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x88
mov rbx, qword [0x14020ba20]
test rbx, rbx
mov esi, edx
mov qword [rsp + 0x50], rcx
je 0x140198da0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rbx]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, edi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rbx, rbx
je 0x140198da0
mov rbx, qword [rbx + 0x10]
test rbx, rbx
je 0x140198d60
mov eax, dword [rbx + 0x18c]
test eax, eax
je 0x140198cf3
mov ecx, 1
lea rdx, [rsp + 0x50]
xor r8d, r8d
mov r9d, esi
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
mov edx, eax
je 0x140198d40
cmp eax, 1
jne 0x140198d10
mov rcx, qword [rsp + 0x58]
lea rdi, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
lea rax, [rbx + 0x38]
mov rcx, rdi
mov qword [rsp + 0x78], 0
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x70], 0
mov qword [rsp + 0x68], 0
xchg qword [rax], rcx
test rcx, rcx
je 0x140198ca4
mov qword [rcx + 8], rdi
lea rdx, [rcx + 0x18]
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x140198c65
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea rbp, [rdi + 0x10]
xor esi, esi
lock xadd qword [rbp], rsi
test rsi, rsi
jne 0x140198ca4
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r12, rax
mov rax, rsi
lock cmpxchg qword [rbp], r12
test rax, rax
je 0x140198e50
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [rbx + 0x28]
cmp eax, 3
jbe 0x140198e99
mov r8, qword [rsp + 0x60]
lea rcx, [rdi + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x140198e63
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x140198cec
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, 0x16
jmp 0x140198d23
mov rax, qword [rbx + 0x40]
mov ecx, 2
test rax, rax
mov qword [rsp + 0x58], rax
jne 0x140198bde
jmp 0x140198bd9
cmp edx, 0x102
mov eax, 0x8a
mov edx, 0x16
cmovne eax, edx
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
xor eax, eax
jmp 0x140198d23
mov rcx, rbp
mov qword [rsp + 0x40], rdi
mov qword [rsp + 0x48], r13
call sym.ptw32_threadReusePush
nop word cs:[rax + rax]
lea rdx, [rsp + 0x50]
xor r8d, r8d
mov r9d, esi
mov qword [rsp + 0x58], 0
mov ecx, 1
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov edx, eax
xor eax, eax
test edx, edx
je 0x140198d23
cmp edx, 1
jne 0x140198d10
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, 0x16
jmp 0x140198d23
lea rbp, [rsp + 0x40]
mov rcx, rbp
call sym.ptw32_new
mov rdi, qword [rsp + 0x40]
mov r13, qword [rsp + 0x48]
test rdi, rdi
mov rbx, rdi
je 0x140198d60
or byte [rdi + 0x194], 1
mov dword [rdi + 0x184], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r12, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rdi + 0x198], eax
call r12
mov r15, rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov r14, rax
call r12
lea r9, [rdi + 8]
mov r8, r15
mov rdx, r14
mov rcx, rax
mov dword [rsp + 0x30], 2
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x140198d44
mov rcx, qword [rdi + 8]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rcx, qword [0x14020ba20]
mov rdx, rdi
mov dword [rdi + 0x188], eax
call sym.pthread_setspecific
jmp 0x140198bcb
mov edx, 0xffffffff
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x140198c9b
mov rax, rdi
lock cmpxchg qword [r8], rdx
cmp rdi, rax
je 0x140198cec
lea rcx, [rdi + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x140198e92
add rdi, 8
xor ecx, ecx
lock xadd qword [rdi], rcx
jmp 0x140198ccc
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x140198e82
mov rcx, rdi
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 dword [rax]