Function at 0x1402ed8f0
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 0x1402eda50
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 0x1402eda50
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 0x1402ed970
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 0x1402ed9de
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 0x1402ed9c8
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r13, [rbp + 0x10]
xor r12d, r12d
lock xadd qword [r13], r12
test r12, r12
je 0x1402edb10
test rdi, rdi
je 0x1402ed9eb
mov eax, dword [rbx + 0x190]
mov dword [rdi], eax
mov dword [rbx + 0x190], esi
or esi, dword [rbx + 0x18c]
jne 0x1402eda0d
xor edx, edx
mov rcx, qword [rbx + 0x40]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x1402edbea
mov r8, qword [rsp + 0x60]
lea rcx, [rbp + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x1402edb60
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x1402eda49
call qword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
jmp 0x1402ed95a
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 0x1402edb40
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 0x1402edb93
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 0x1402ed950
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 0x1402edb50
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1402ed9de
mov eax, 0x16
jmp 0x1402ed95a
mov edx, 0xffffffff
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x1402edb31
mov rax, rbp
lock cmpxchg qword [r8], rdx
cmp rbp, rax
je 0x1402eda49
lea rsi, [rbp + 0x18]
mov rbx, rdx
lock xadd qword [rsi], rbx
test rbx, rbx
je 0x1402edbaf
add rbp, 8
xor ecx, ecx
lock xadd qword [rbp], rcx
jmp 0x1402eda29
mov rcx, r12
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x58], r14
call sym.ptw32_threadReusePush
mov eax, 0x16
jmp 0x1402ed95a
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 0x1402edbda
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1402edb82
mov edx, 0xffffffff
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x1402edbcf
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]