Function at 0x1402ef7e0
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, 0xd8
mov rbx, qword [0x14048b840]
mov rsi, qword [rcx]
test rbx, rbx
mov rdi, rcx
mov rbp, rdx
mov dword [rsp + 0x6c], 0
je 0x1402efa10
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [rbx]
mov r12d, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, r12d
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rbx, rbx
je 0x1402efa10
mov rbx, qword [rbx + 0x10]
test rbx, rbx
je 0x1402ef84f
mov eax, dword [rbx + 0x28]
cmp eax, 3
je 0x1402ef935
test rbp, rbp
mov r12d, 0xffffffff
je 0x1402ef8cb
movsxd r8, dword [rbp + 8]
lea rcx, [rsp + 0xb0]
xor r12d, r12d
movabs rdx, 0x431bde82d7b634db
imul rbx, qword [rbp], 0x3e8
add r8, 0x7a120
mov rax, r8
sar r8, 0x3f
imul rdx
sar rdx, 0x12
sub rdx, r8
add rbx, rdx
call qword [sym.imp.msvcrt.dll__ftime64]
movzx eax, word [rsp + 0xb8]
imul rdx, qword [rsp + 0xb0], 0x3e8
add rax, rdx
cmp rbx, rax
jle 0x1402ef8cb
mov r12d, ebx
sub r12d, eax
mov eax, 0xfffffffe
cmp r12d, 0xffffffff
cmove r12d, eax
lea rbx, [rsi + 8]
mov rcx, rbx
call sym.pthread_mutex_lock
test eax, eax
mov dword [rsp + 0x6c], eax
jne 0x1402ef910
cmp qword [rdi], 0
je 0x1402efdf8
mov eax, dword [rsi]
mov rcx, rbx
lea edi, [rax - 1]
mov dword [rsi], edi
call sym.pthread_mutex_unlock
test edi, edi
js 0x1402efad2
mov eax, dword [rsp + 0x6c]
test eax, eax
je 0x1402ef921
nop dword [rax + rax]
call qword [sym.imp.msvcrt.dll__errno]
mov edx, dword [rsp + 0x6c]
mov dword [rax], edx
mov eax, 0xffffffff
add rsp, 0xd8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov qword [rsp + 0xc8], 0
lea rax, [rbx + 0x38]
lea r12, [rsp + 0xb0]
mov qword [rsp + 0xb0], rax
mov qword [rsp + 0xc0], 0
mov rdx, r12
mov qword [rsp + 0xb8], 0
xchg qword [rax], rdx
test rdx, rdx
je 0x1402ef9b2
mov qword [rdx + 8], r12
xor eax, eax
add rdx, 0x18
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x1402ef99c
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r14, [r12 + 0x10]
xor r13d, r13d
lock xadd qword [r14], r13
test r13, r13
je 0x1402efcf0
cmp dword [rbx + 0x18c], 1
jne 0x1402efe65
mov r8, qword [rsp + 0xb0]
lea rcx, [r12 + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x1402efd70
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x1402ef84f
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x1402ef84f
lea r13, [rsp + 0x50]
mov rcx, r13
call sym.ptw32_new
mov r12, qword [rsp + 0x50]
mov r15, qword [rsp + 0x58]
test r12, r12
mov rbx, r12
je 0x1402ef84f
or byte [r12 + 0x194], 1
mov dword [r12 + 0x184], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov r14, qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [r12 + 0x198], eax
call r14
mov qword [rsp + 0x48], rax
call qword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov qword [rsp + 0x40], rax
call r14
mov dword [rsp + 0x30], 2
lea r9, [r12 + 8]
mov r8, qword [rsp + 0x48]
mov dword [rsp + 0x28], 0
mov rdx, qword [rsp + 0x40]
mov rcx, rax
mov dword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x1402efd50
mov rcx, qword [r12 + 8]
call qword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov rcx, qword [0x14048b840]
mov rdx, r12
mov dword [r12 + 0x188], eax
call sym.pthread_setspecific
jmp 0x1402ef843
mov rbx, qword [0x14048b838]
lea rax, [rsp + 0x6c]
mov qword [rsp + 0x70], rsi
mov qword [rsp + 0x78], rax
lea rax, [sym.ptw32_sem_timedwait_cleanup]
mov qword [rsp + 0x90], rax
lea rax, [rsp + 0x70]
mov qword [rsp + 0x98], rax
test rbx, rbx
je 0x1402efe16
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 rdi, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rbx, qword [0x14048b838]
mov rcx, rbx
mov qword [rsp + 0xa0], rdi
lea rdx, [rsp + 0x90]
call sym.pthread_setspecific
mov rax, qword [rsi + 0x10]
lea rcx, [rsp + 0x50]
mov qword [rsp + 0x80], rax
call sym.pthread_self
mov rbx, qword [rsp + 0x50]
test rbx, rbx
je 0x1402efca1
mov eax, dword [rbx + 0x18c]
test eax, eax
jne 0x1402efd22
mov rax, qword [rbx + 0x40]
mov ecx, 2
test rax, rax
mov qword [rsp + 0x88], rax
je 0x1402efd22
lea rdx, [rsp + 0x80]
xor r8d, r8d
mov r9d, r12d
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
je 0x1402efda1
cmp eax, 1
jne 0x1402efd30
mov rcx, qword [rsp + 0x88]
lea r12, [rsp + 0xb0]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
lea rdx, [rbx + 0x38]
mov rax, r12
mov qword [rsp + 0xc8], 0
mov qword [rsp + 0xb0], rdx
mov qword [rsp + 0xc0], 0
mov qword [rsp + 0xb8], 0
xchg qword [rdx], rax
test rax, rax
je 0x1402efc42
mov qword [rax + 8], r12
lea rdx, [rax + 0x18]
mov rcx, 0xffffffffffffffff
xor eax, eax
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x1402efc2d
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea rdi, [r12 + 0x10]
xor esi, esi
lock xadd qword [rdi], rsi
test rsi, rsi
je 0x1402efdca
mov eax, dword [rbx + 0x28]
cmp eax, 3
jbe 0x1402efe6f
mov rcx, qword [rsp + 0xb0]
lea rax, [r12 + 8]
xor edx, edx
lock xadd qword [rax], rdx
test rdx, rdx
mov rax, rdx
je 0x1402efe1d
lea rdx, [rax + 0x10]
mov rcx, 0xffffffffffffffff
xor eax, eax
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x1402efc8e
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, 0x16
mov dword [rsp + 0x6c], ecx
call sym.ptw32_pop_cleanup
jmp 0x1402ef900
xor r8d, r8d
mov ecx, 1
mov r9d, r12d
mov qword [rsp + 0x88], 0
lea rdx, [rsp + 0x80]
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
xor ecx, ecx
test eax, eax
je 0x1402efc93
cmp eax, 1
jne 0x1402efd30
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov ecx, 0x16
jmp 0x1402efc93
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r15, rax
mov rax, r13
lock cmpxchg qword [r14], r15
test rax, rax
je 0x1402efdb0
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1402ef9b2
mov ecx, 1
jmp 0x1402efb93
cmp eax, 0x102
mov ecx, 0x16
mov eax, 0x8a
cmove ecx, eax
jmp 0x1402efc93
mov rcx, r13
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x58], r15
call sym.ptw32_threadReusePush
jmp 0x1402ef84f
mov rax, r12
lock cmpxchg qword [r8], rdx
cmp r12, rax
je 0x1402ef84f
lea rcx, [r12 + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x1402efdc3
add r12, 8
xor ecx, ecx
lock xadd qword [r12], rcx
jmp 0x1402ef9df
xor ecx, ecx
jmp 0x1402efc93
mov edx, 0xffffffff
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x1402efd14
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x1402efd90
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov rbp, rax
mov rax, rsi
lock cmpxchg qword [rdi], rbp
test rax, rax
je 0x1402efe4e
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1402efc42
mov rcx, rbx
call sym.pthread_mutex_unlock
call qword [sym.imp.msvcrt.dll__errno]
mov dword [rax], 0x16
mov eax, 0xffffffff
jmp 0x1402ef921
xor edi, edi
jmp 0x1402efb2f
mov rax, r12
lock cmpxchg qword [rcx], rdx
cmp r12, rax
je 0x1402efc8e
lea rcx, [r12 + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x1402efe5e
add r12, 8
xor eax, eax
lock xadd qword [r12], rax
jmp 0x1402efc6e
mov edx, 0xffffffff
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x1402efdea
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x1402efe3d
mov rcx, qword [rbx + 0x40]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
mov rcx, r12
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 word cs:[rax + rax]