Function at 0x1402edec0
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, [0x14048b808]
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 0x1402edf47
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 0x1402edf32
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r12, [rbx + 0x10]
xor ebp, ebp
lock xadd qword [r12], rbp
test rbp, rbp
je 0x1402ee124
test rsi, rsi
mov ebp, 3
je 0x1402edf5a
cmp edi, dword [rsi + 0x18]
je 0x1402ee160
mov r8, qword [rsp + 0x40]
lea rcx, [rbx + 8]
xor edx, edx
lock xadd qword [rcx], rdx
test rdx, rdx
mov rcx, rdx
je 0x1402ee1d0
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
je 0x1402edf96
call qword [sym.imp.KERNEL32.dll_SetEvent]
test ebp, ebp
mov r14d, ebp
je 0x1402edfb1
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 0x1402ee200
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 0x1402ee036
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 0x1402ee021
call qword [sym.imp.KERNEL32.dll_SetEvent]
lea r15, [rbx + 0x10]
xor r14d, r14d
lock xadd qword [r15], r14
test r14, r14
je 0x1402ee170
mov eax, dword [rsi + 0x190]
test eax, eax
jne 0x1402ee0c3
mov r14d, dword [rsi + 0x18c]
test r14d, r14d
jne 0x1402ee0c3
mov eax, dword [rsi + 0x28]
cmp eax, 3
ja 0x1402ee0c3
cmp edi, r13d
jne 0x1402ee066
cmp r12, rsi
je 0x1402ee28c
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 0x1402edf9d
xor r8d, r8d
mov rdx, rdi
mov dword [rsi + 0x28], 4
mov dword [rsi + 0x18c], 1
lea rcx, [sym.ptw32_cancel_callback]
call qword [0x14048b810]
mov rcx, rbx
call sym.ptw32_mcs_lock_release
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_ResumeThread]
jmp 0x1402edf9d
mov eax, dword [rsi + 0x28]
cmp eax, 2
jbe 0x1402ee1b0
mov eax, dword [rsi + 0x28]
cmp eax, 3
jbe 0x1402ee0dc
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 0x1402ee230
add rcx, 0x10
xor eax, eax
mov rdx, 0xffffffffffffffff
lock cmpxchg qword [rcx], rdx
test rax, rax
mov rcx, rax
mov r14d, ebp
je 0x1402edf9d
call qword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x1402edf9d
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 0x1402ee210
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x1402edf47
cmp qword [rsi + 8], 1
sbb ebp, ebp
and ebp, 3
jmp 0x1402edf5a
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 0x1402ee260
mov rcx, r8
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [rsi + 0x190]
test eax, eax
jne 0x1402ee0c3
jmp 0x1402ee044
mov dword [rsi + 0x28], 3
mov rcx, qword [rsi + 0x40]
call qword [sym.imp.KERNEL32.dll_SetEvent]
test eax, eax
jne 0x1402ee0dc
jmp 0x1402ee0d7
mov rax, rbx
lock cmpxchg qword [r8], rdx
cmp rbx, rax
je 0x1402edf96
lea rcx, [rbx + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x1402ee223
lea rax, [rbx + 8]
xor ecx, ecx
lock xadd qword [rax], rcx
jmp 0x1402edf76
mov r14d, 0xc
jmp 0x1402edf9d
mov edx, 0xffffffff
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x1402ee149
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x1402ee1ef
mov rax, rbx
lock cmpxchg qword [r8], rdx
cmp rbx, rax
je 0x1402ee284
lea rcx, [rbx + 0x18]
lock xadd qword [rcx], rdx
test rdx, rdx
je 0x1402ee27d
add rbx, 8
xor ecx, ecx
lock xadd qword [rbx], rcx
jmp 0x1402ee0f8
mov rcx, r8
mov qword [rsp + 0x28], r8
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r8, qword [rsp + 0x28]
jmp 0x1402ee194
call sym.ptw32_mcs_flag_wait.part.0
jmp 0x1402ee24b
mov r14d, ebp
jmp 0x1402edf9d
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