Function at 0x14001fb60
Capabilities:
Create thread

Disassembly:
push rdi
push r12
push r13
sub rsp, 0x40
mov qword [rsp + 0x30], 0xfffffffffffffffe
mov qword [rsp + 0x60], rbx
mov qword [rsp + 0x68], rbp
mov qword [rsp + 0x78], rsi
mov rsi, rdx
mov rdi, rcx
mov r8, qword [0x140ddc4a8]
lea rbx, [0x140ddc4a8]
mov r13d, 1
test byte [r8 + 4], r13b
je 0x14001fbac
mov rcx, rbx
call fcn.140030650
jmp 0x14001fbc2
xor eax, eax
lock cmpxchg dword [r8], r13d
sete cl
test cl, cl
jne 0x14001fbc2
mov rcx, rbx
call fcn.140030450
or rbx, r13
mov qword [rsp + 0x70], rbx
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x140ddc490]
jne 0x14001fc27
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
test bl, 1
je 0x14001fe75
and rbx, 0xfffffffffffffffe
mov qword [rsp + 0x70], rbx
and rbx, 0xfffffffffffffffe
mov rcx, qword [rbx]
test byte [rcx + 4], 1
je 0x14001fc0e
mov rcx, rbx
call fcn.140030410
jmp 0x14001fe75
xor r12d, r12d
mov eax, r13d
lock cmpxchg dword [rcx], r12d
je 0x14001fe75
mov rcx, rbx
jmp 0x14001fe70
mov rax, qword [0x140dd82f0]
mov ecx, dword [rax]
mov rax, qword [0x140dd82f0]
cmp ecx, 1
jne 0x14001fc4f
movsxd rdx, dword [rax + 8]
lea ecx, [rdx + 1]
cmp ecx, dword [rax + 4]
jg 0x14001fc4f
mov qword [rax + rdx*8 + 0x10], rdi
jmp 0x14001fc8d
mov edx, dword [rax + 8]
inc edx
xor r9d, r9d
lea ecx, [r9 + 0x18]
lea r8d, [r9 + 8]
call fcn.140040520
mov r8d, eax
mov rax, qword [0x140dd82f0]
mov edx, dword [rax + 8]
lea rcx, [0x140dd82f0]
call fcn.140031620
mov r11, qword [0x140dd82f0]
movsxd rax, dword [r11 + 8]
mov qword [r11 + rax*8 + 0x10], rdi
mov rax, qword [0x140dd82f0]
inc dword [rax + 8]
mov rax, qword [0x140dd82f8]
mov ecx, dword [rax]
mov rax, qword [0x140dd82f8]
cmp ecx, 1
jne 0x14001fcbf
movsxd rdx, dword [rax + 8]
lea ecx, [rdx + 1]
cmp ecx, dword [rax + 4]
jg 0x14001fcbf
mov qword [rax + rdx*8 + 0x10], rsi
jmp 0x14001fcfd
mov edx, dword [rax + 8]
inc edx
xor r9d, r9d
lea ecx, [r9 + 0x18]
lea r8d, [r9 + 8]
call fcn.140040520
mov r8d, eax
mov rax, qword [0x140dd82f8]
mov edx, dword [rax + 8]
lea rcx, [0x140dd82f8]
call fcn.140031620
mov r11, qword [0x140dd82f8]
movsxd rax, dword [r11 + 8]
mov qword [r11 + rax*8 + 0x10], rsi
mov rax, qword [0x140dd82f8]
inc dword [rax + 8]
xor r12d, r12d
cmp dword [0x140ddc490], r12d
jne 0x14001fe34
cmp qword [0x140ddc498], r12
jne 0x14001fe0d
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [0x140ddc498], rax
mov rax, qword [0x140dd82f0]
mov ecx, dword [rax]
cmp ecx, 1
je 0x14001fd63
mov rax, qword [0x140dd82f0]
mov r8d, dword [rax + 4]
mov edx, dword [rax + 8]
lea rcx, [0x140dd82f0]
call fcn.140031620
mov rax, qword [0x140dd82f0]
lea rbp, [rax + 0x10]
sub rbp, rax
sub rbp, 0x10
sar rbp, 3
mov rsi, qword [0x140ddc498]
mov edx, dword [rax]
mov rax, qword [0x140dd82f0]
cmp edx, 1
jne 0x14001fd98
mov edx, dword [rax + 8]
inc edx
cmp edx, dword [rax + 4]
jle 0x14001fdcd
mov edx, dword [rax + 8]
inc edx
xor r9d, r9d
lea ecx, [r9 + 0x18]
lea r8d, [r9 + 8]
call fcn.140040520
mov r8d, eax
mov rax, qword [0x140dd82f0]
mov edx, dword [rax + 8]
lea rcx, [0x140dd82f0]
call fcn.140031620
mov rax, qword [0x140dd82f0]
movsxd rcx, ebp
lea rdi, [rax + rcx*8 + 0x10]
lea rbx, [rdi + 8]
mov ecx, dword [rax + 8]
sub ecx, ebp
movsxd r8, ecx
shl r8, 3
mov rdx, rdi
mov rcx, rbx
call fcn.1400abec0
cmp rbx, rdi
je 0x14001fe03
sub rbx, 8
je 0x14001fdfe
mov qword [rbx], rsi
cmp rbx, rdi
jne 0x14001fdf5
mov rax, qword [0x140dd82f0]
inc dword [rax + 8]
lea rax, [0x140ddc490]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], r12d
xor r9d, r9d
lea r8, [0x14001f700]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
jmp 0x14001fe42
mov rcx, qword [0x140ddc498]
call qword [sym.imp.KERNEL32.dll_SetEvent]
nop
mov rcx, qword [rsp + 0x70]
test cl, 1
je 0x14001fe75
and rcx, 0xfffffffffffffffe
mov qword [rsp + 0x70], rcx
and rcx, 0xfffffffffffffffe
mov rdx, qword [rcx]
test byte [rdx + 4], 1
jne 0x14001fc04
mov eax, r13d
lock cmpxchg dword [rdx], r12d
je 0x14001fe75
call fcn.140030360
mov rbx, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x78]
add rsp, 0x40
pop r13
pop r12
pop rdi
ret