Function at 0x1402e61c0
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x78
cmp rcx, qword [0x14048b840]
mov rbx, rcx
mov rdi, rdx
je 0x1402e6495
lea rcx, [rsp + 0x20]
call sym.pthread_self
mov rbp, qword [rsp + 0x20]
test rbp, rbp
je 0x1402e6410
test rbx, rbx
je 0x1402e64e5
test rdi, rdi
je 0x1402e64cf
cmp qword [rbx + 8], 0
je 0x1402e64cf
mov qword [rsp + 0x48], 0
lea rax, [rbx + 0x10]
lea rsi, [rsp + 0x30]
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x40], 0
mov rcx, rsi
mov qword [rsp + 0x38], 0
xchg qword [rax], rcx
test rcx, rcx
je 0x1402e6286
mov qword [rcx + 8], rsi
lea rdx, [rcx + 0x18]
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x1402e6270
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r13, [rsi + 0x10]
xor r12d, r12d
lock xadd qword [r13], r12
test r12, r12
je 0x1402e6462
mov qword [rsp + 0x68], 0
lea rax, [rbp + 0x30]
lea r13, [rsp + 0x50]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x60], 0
mov rcx, r13
mov qword [rsp + 0x58], 0
xchg qword [rax], rcx
test rcx, rcx
je 0x1402e62f3
mov qword [rcx + 8], r13
lea r8, [rcx + 0x18]
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [r8], rdx
test rax, rax
mov rcx, rax
je 0x1402e62de
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r14, [r13 + 0x10]
xor r12d, r12d
lock xadd qword [r14], r12
test r12, r12
je 0x1402e6430
mov r14, qword [rbp + 0x58]
test r14, r14
je 0x1402e6323
cmp qword [r14 + 8], rbx
je 0x1402e64f0
mov r8, r14
jmp 0x1402e631a
cmp qword [r8 + 8], rbx
je 0x1402e64f0
mov r8, qword [r8 + 0x10]
test r8, r8
jne 0x1402e6310
mov edx, 0x30
mov ecx, 1
mov r12d, 0xc
call sym.calloc
test rax, rax
je 0x1402e6380
mov rdx, qword [rbx + 0x18]
mov qword [rax], rbp
mov qword [rax + 8], rbx
mov qword [rax + 0x28], 0
test rdx, rdx
mov qword [rax + 0x18], rdx
je 0x1402e635d
mov qword [rdx + 0x28], rax
test r14, r14
mov qword [rbx + 0x18], rax
mov qword [rax + 0x20], 0
mov qword [rax + 0x10], r14
je 0x1402e6376
mov qword [r14 + 0x20], rax
mov qword [rbp + 0x58], rax
xor r12d, r12d
nop dword [rax]
mov r8, qword [rsp + 0x50]
lea rax, [r13 + 8]
xor edx, edx
lock xadd qword [rax], rdx
test rdx, rdx
mov rcx, rdx
je 0x1402e6533
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x1402e63bc
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov r8, qword [rsp + 0x30]
lea rax, [rsi + 8]
xor edx, edx
lock xadd qword [rax], rdx
test rdx, rdx
mov rcx, rdx
je 0x1402e6500
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x1402e63f8
call qword [sym.imp.KERNEL32.dll_SetEvent]
test r12d, r12d
je 0x1402e64cf
mov eax, r12d
jmp 0x1402e6415
test rdx, rdx
jne 0x1402e64e5
nop
mov eax, 2
add rsp, 0x78
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r15, rax
mov rax, r12
lock cmpxchg qword [r14], r15
test rax, rax
je 0x1402e6563
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1402e62f3
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 0x1402e6576
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1402e6286
test rcx, rcx
je 0x1402e6406
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 rsi, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rsi, rsi
je 0x1402e6589
mov rbp, qword [rsi + 0x10]
test rbp, rbp
jne 0x1402e6204
mov rdx, rdi
mov ecx, dword [rbx]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x1402e64e5
mov al, 0xb
jmp 0x1402e6415
xor eax, eax
jmp 0x1402e6415
xor r12d, r12d
jmp 0x1402e6380
mov rax, rsi
lock cmpxchg qword [r8], rdx
cmp rsi, rax
je 0x1402e63f8
lea rcx, [rsi + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x1402e65a7
add rsi, 8
xor ecx, ecx
lock xadd qword [rsi], rcx
jmp 0x1402e63d8
mov rax, r13
lock cmpxchg qword [r8], rdx
cmp r13, rax
je 0x1402e63bc
lea rcx, [r13 + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x1402e65a0
add r13, 8
xor ecx, ecx
lock xadd qword [r13], rcx
jmp 0x1402e639c
mov edx, 0xffffffff
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x1402e6454
mov edx, 0xffffffff
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x1402e6487
test rdi, rdi
je 0x1402e6410
mov rbp, qword [rdi]
jmp 0x1402e64c6
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x1402e6552
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x1402e6523