Function at 0x140197810
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, ecx
mov rdi, rdx
je 0x140197970
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rbx]
mov ebp, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, ebp
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rbx, rbx
je 0x140197970
mov rbx, qword [rbx + 0x10]
test rbx, rbx
sete r8b
cmp esi, 1
seta al
or r8d, eax
test r8b, r8b
mov eax, 0x16
je 0x140197890
add rsp, 0x88
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov qword [rsp + 0x78], 0
lea rax, [rbx + 0x38]
lea rbp, [rsp + 0x60]
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x70], 0
mov rdx, rbp
mov qword [rsp + 0x68], 0
xchg qword [rax], rdx
test rdx, rdx
je 0x1401978fe
mov qword [rdx + 8], rbp
xor eax, eax
add rdx, 0x18
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x1401978e8
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r13, [rbp + 0x10]
xor r12d, r12d
lock xadd qword [r13], r12
test r12, r12
je 0x140197a30
test rdi, rdi
je 0x14019790b
mov eax, dword [rbx + 0x18c]
mov dword [rdi], eax
test esi, esi
mov dword [rbx + 0x18c], esi
jne 0x140197923
mov eax, dword [rbx + 0x190]
test eax, eax
je 0x140197a80
mov r8, qword [rsp + 0x60]
lea rcx, [rbp + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x140197ac1
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x14019795f
call qword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
jmp 0x14019787a
lea r12, [rsp + 0x50]
mov rcx, r12
call sym.ptw32_new
mov rbp, qword [rsp + 0x50]
mov r14, qword [rsp + 0x58]
test rbp, rbp
mov rbx, rbp
je 0x140197a60
or byte [rbp + 0x194], 1
mov dword [rbp + 0x184], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r13, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [rbp + 0x198], eax
call r13
mov qword [rsp + 0x48], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov r15, rax
call r13
lea r9, [rbp + 8]
mov r8, qword [rsp + 0x48]
mov rdx, r15
mov dword [rsp + 0x30], 2
mov rcx, rax
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x140197af1
mov rcx, qword [rbp + 8]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rcx, qword [0x14020ba20]
mov rdx, rbp
mov dword [rbp + 0x188], eax
call sym.pthread_setspecific
cmp esi, 1
seta r8b
jmp 0x140197870
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r14, rax
mov rax, r12
lock cmpxchg qword [r13], r14
test rax, rax
je 0x140197a70
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1401978fe
mov eax, 0x16
jmp 0x14019787a
mov edx, 0xffffffff
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x140197a51
xor edx, edx
mov rcx, qword [rbx + 0x40]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x140197923
mov rcx, qword [rbx + 0x40]
mov dword [rbx + 0x28], 4
mov dword [rbx + 0x18c], 1
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov rcx, rbp
call sym.ptw32_mcs_lock_release
mov ecx, 2
call sym.ptw32_throw
mov rax, rbp
lock cmpxchg qword [r8], rdx
cmp rbp, rax
je 0x14019795f
lea rcx, [rbp + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x140197b0d
add rbp, 8
xor ecx, ecx
lock xadd qword [rbp], rcx
jmp 0x14019793f
mov rcx, r12
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x58], r14
call sym.ptw32_threadReusePush
mov eax, 0x16
jmp 0x14019787a
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x140197ae0