Function at 0x140197b20
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 0x140197c80
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 0x140197c80
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 0x140197ba0
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 0x140197c0e
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 0x140197bf8
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r13, [rbp + 0x10]
xor r12d, r12d
lock xadd qword [r13], r12
test r12, r12
je 0x140197d40
test rdi, rdi
je 0x140197c1b
mov eax, dword [rbx + 0x190]
mov dword [rdi], eax
mov dword [rbx + 0x190], esi
or esi, dword [rbx + 0x18c]
jne 0x140197c3d
xor edx, edx
mov rcx, qword [rbx + 0x40]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x140197e1a
mov r8, qword [rsp + 0x60]
lea rcx, [rbp + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x140197d90
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x140197c79
call qword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
jmp 0x140197b8a
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 0x140197d70
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 0x140197dc3
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 0x140197b80
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 0x140197d80
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140197c0e
mov eax, 0x16
jmp 0x140197b8a
mov edx, 0xffffffff
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x140197d61
mov rax, rbp
lock cmpxchg qword [r8], rdx
cmp rbp, rax
je 0x140197c79
lea rsi, [rbp + 0x18]
mov rbx, rdx
lock xadd qword [rsi], rbx
test rbx, rbx
je 0x140197ddf
add rbp, 8
xor ecx, ecx
lock xadd qword [rbp], rcx
jmp 0x140197c59
mov rcx, r12
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x58], r14
call sym.ptw32_threadReusePush
mov eax, 0x16
jmp 0x140197b8a
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rdi, rax
mov rax, rbx
lock cmpxchg qword [rsi], rdi
test rax, rax
je 0x140197e0a
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140197db2
mov edx, 0xffffffff
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x140197dff
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
nop
nop dword [rax + rax]