Function at 0x1402ed5e0
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 [0x14048b840]
test rbx, rbx
mov esi, ecx
mov rdi, rdx
je 0x1402ed740
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 0x1402ed740
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 0x1402ed660
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 0x1402ed6ce
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 0x1402ed6b8
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r13, [rbp + 0x10]
xor r12d, r12d
lock xadd qword [r13], r12
test r12, r12
je 0x1402ed800
test rdi, rdi
je 0x1402ed6db
mov eax, dword [rbx + 0x18c]
mov dword [rdi], eax
test esi, esi
mov dword [rbx + 0x18c], esi
jne 0x1402ed6f3
mov eax, dword [rbx + 0x190]
test eax, eax
je 0x1402ed850
mov r8, qword [rsp + 0x60]
lea rcx, [rbp + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x1402ed891
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x1402ed72f
call qword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
jmp 0x1402ed64a
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 0x1402ed830
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 0x1402ed8c1
mov rcx, qword [rbp + 8]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rcx, qword [0x14048b840]
mov rdx, rbp
mov dword [rbp + 0x188], eax
call sym.pthread_setspecific
cmp esi, 1
seta r8b
jmp 0x1402ed640
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 0x1402ed840
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1402ed6ce
mov eax, 0x16
jmp 0x1402ed64a
mov edx, 0xffffffff
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x1402ed821
xor edx, edx
mov rcx, qword [rbx + 0x40]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x1402ed6f3
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 0x1402ed72f
lea rcx, [rbp + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x1402ed8dd
add rbp, 8
xor ecx, ecx
lock xadd qword [rbp], rcx
jmp 0x1402ed70f
mov rcx, r12
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x58], r14
call sym.ptw32_threadReusePush
mov eax, 0x16
jmp 0x1402ed64a
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x1402ed8b0