Function at 0x14027e380
Capabilities:
Resume thread
Suspend thread

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x68
lea rax, [0x1403b9788]
mov rsi, qword [rcx]
mov rdi, qword [rcx + 8]
lea rbx, [rsp + 0x40]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x58], 0
mov rcx, rbx
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x48], 0
xchg qword [rax], rcx
test rcx, rcx
je 0x14027e407
mov qword [rcx + 8], rbx
lea rdx, [rcx + 0x18]
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x14027e3f2
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r12, [rbx + 0x10]
xor ebp, ebp
lock xadd qword [r12], rbp
test rbp, rbp
je 0x14027e5e4
test rsi, rsi
mov ebp, 3
je 0x14027e41a
cmp edi, dword [rsi + 0x18]
je 0x14027e620
mov r8, qword [rsp + 0x40]
lea rcx, [rbx + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x14027e690
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x14027e456
call qword [sym.imp.KERNEL32.dll_SetEvent]
test ebp, ebp
mov r14d, ebp
je 0x14027e471
mov eax, r14d
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea rcx, [rsp + 0x30]
call sym.pthread_self
mov r12, qword [rsp + 0x30]
mov r13, qword [rsp + 0x38]
test r12, r12
je 0x14027e6c0
mov qword [rsp + 0x58], 0
lea rax, [rsi + 0x38]
mov rcx, rbx
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x48], 0
xchg qword [rax], rcx
test rcx, rcx
je 0x14027e4f6
mov qword [rcx + 8], rbx
lea rdx, [rcx + 0x18]
xor eax, eax
mov rcx, 0xffffffffffffffff
lock cmpxchg qword [rdx], rcx
test rax, rax
mov rcx, rax
je 0x14027e4e1
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r15, [rbx + 0x10]
xor r14d, r14d
lock xadd qword [r15], r14
test r14, r14
je 0x14027e630
mov eax, dword [rsi + 0x190]
test eax, eax
jne 0x14027e583
mov r14d, dword [rsi + 0x18c]
test r14d, r14d
jne 0x14027e583
mov eax, dword [rsi + 0x28]
cmp eax, 3
ja 0x14027e583
cmp edi, r13d
jne 0x14027e526
cmp r12, rsi
je 0x14027e74c
mov rdi, qword [rsi + 8]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SuspendThread]
xor edx, edx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x14027e45d
xor r8d, r8d
mov rdx, rdi
mov dword [rsi + 0x28], 4
mov dword [rsi + 0x18c], 1
lea rcx, [sym.ptw32_cancel_callback]
call qword [0x1403b9790]
mov rcx, rbx
call sym.ptw32_mcs_lock_release
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ResumeThread]
jmp 0x14027e45d
mov eax, dword [rsi + 0x28]
cmp eax, 2
jbe 0x14027e670
mov eax, dword [rsi + 0x28]
cmp eax, 3
jbe 0x14027e59c
mov ebp, 3
mov r8, qword [rsp + 0x40]
lea rcx, [rbx + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x14027e6f0
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
mov r14d, ebp
je 0x14027e45d
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x14027e45d
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r13, rax
mov rax, rbp
lock cmpxchg qword [r12], r13
test rax, rax
je 0x14027e6d0
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x14027e407
cmp qword [rsi + 8], 1
sbb ebp, ebp
and ebp, 3
jmp 0x14027e41a
xor r8d, r8d
xor r9d, r9d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov r8, rax
mov rax, r14
lock cmpxchg qword [r15], r8
test rax, rax
je 0x14027e720
mov rcx, r8
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [rsi + 0x190]
test eax, eax
jne 0x14027e583
jmp 0x14027e504
mov dword [rsi + 0x28], 3
mov rcx, qword [rsi + 0x40]
call qword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x14027e59c
jmp 0x14027e597
mov rax, rbx
lock cmpxchg qword [r8], rdx
cmp rbx, rax
je 0x14027e456
lea rcx, [rbx + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x14027e6e3
lea rax, [rbx + 8]
xor ecx, ecx
lock xadd qword [rax], rcx
jmp 0x14027e436
mov r14d, 0xc
jmp 0x14027e45d
mov edx, 0xffffffff
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x14027e609
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x14027e6af
mov rax, rbx
lock cmpxchg qword [r8], rdx
cmp rbx, rax
je 0x14027e744
lea rcx, [rbx + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x14027e73d
add rbx, 8
xor ecx, ecx
lock xadd qword [rbx], rcx
jmp 0x14027e5b8
mov rcx, r8
mov qword [rsp + 0x28], r8
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r8, qword [rsp + 0x28]
jmp 0x14027e654
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x14027e70b
mov r14d, ebp
jmp 0x14027e45d
mov rcx, rbx
mov dword [rsi + 0x28], 4
mov dword [rsi + 0x18c], 1
call sym.ptw32_mcs_lock_release
mov ecx, 2
call sym.ptw32_throw
nop