Function at 0x18003f200
Capabilities:
Resume thread

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
sub rsp, 0x70
mov qword [rsp + 0x38], 0xfffffffffffffffe
mov r12, rcx
cmp byte [rcx + 8], 0
je 0x18003f228
mov al, 1
jmp 0x18003f5e6
xor r13d, r13d
mov rbp, r13
lea rbx, [rcx + 0x50]
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x18003f309
mov rax, qword [rbx + 0x10]
sub rax, rcx
sar rax, 3
cmp rbp, rax
jae 0x18003f309
test rcx, rcx
je 0x18003f268
mov rax, qword [rbx + 0x10]
sub rax, rcx
sar rax, 3
cmp rbp, rax
jb 0x18003f26d
call fcn.18009a780
mov rax, qword [rbx + 8]
mov rdi, qword [rax + rbp*8]
test rdi, rdi
je 0x18003f300
mov rax, qword [rdi]
test rax, rax
je 0x18003f2c5
mov rcx, qword [rax + 0x18]
cmp rcx, 0xffffffffffffffff
je 0x18003f2c5
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x18003f2c5
mov rsi, qword [rdi]
test rsi, rsi
je 0x18003f2c5
mov rcx, qword [rsi + 0x18]
cmp rcx, 0xffffffffffffffff
je 0x18003f2bd
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsi + 0x18], 0xffffffffffffffff
mov byte [rsi + 0x10], r13b
mov dword [rsi + 0x14], r13d
mov rsi, qword [rdi]
test rsi, rsi
je 0x18003f2f8
mov rcx, qword [rsi + 0x18]
cmp rcx, 0xffffffffffffffff
je 0x18003f2e5
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsi + 0x18], 0xffffffffffffffff
mov byte [rsi + 0x10], r13b
mov dword [rsi + 0x14], r13d
mov rcx, qword [rdi]
call fcn.180098980
mov qword [rdi], r13
mov rcx, rdi
call fcn.180098980
add rbp, 1
jmp 0x18003f232
mov rsi, qword [rbx + 0x10]
cmp rcx, rsi
jbe 0x18003f317
call fcn.18009a780
mov rdi, qword [rbx + 8]
cmp rdi, qword [rbx + 0x10]
jbe 0x18003f326
call fcn.18009a780
cmp rdi, rsi
je 0x18003f362
mov rax, qword [rbx + 0x10]
xor ecx, ecx
mov byte [rsp + 0xb0], cl
sub rax, rsi
sar rax, 3
lea rdx, [rax*8]
lea rbp, [rdx + rdi]
test rax, rax
jle 0x18003f35e
mov r9, rdx
mov r8, rsi
mov rcx, rdi
call fcn.18009a280
mov qword [rbx + 0x10], rbp
mov qword [r12 + 0x48], r13
mov rcx, qword [r12 + 0x10]
call qword [sym.imp.KERNEL32.dll_ResetEvent]
test eax, eax
jne 0x18003f37c
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, r13d
cmp dword [r12 + 0x70], r13d
jbe 0x18003f5a1
lea r14, [0x18003f7d0]
mov ecx, 8
call fcn.180099da0
mov rdi, rax
mov qword [rsp + 0x40], rax
test rax, rax
je 0x18003f3eb
mov ecx, 0x28
call fcn.180099da0
test rax, rax
je 0x18003f3d4
mov qword [rax], r13
mov qword [rax + 8], r13
mov qword [rax + 0x18], 0xffffffffffffffff
mov byte [rax + 0x10], 0
mov dword [rax + 0x20], r13d
mov dword [rax + 0x14], r13d
jmp 0x18003f3d7
mov rax, r13
mov qword [rdi], rax
test rax, rax
je 0x18003f3ee
mov qword [rax], r12
mov rax, qword [rdi]
mov qword [rax + 8], r14
jmp 0x18003f3ee
mov rdi, r13
mov qword [rsp + 0x30], rdi
mov r9, qword [rdi]
test r9, r9
je 0x18003f593
cmp qword [r9 + 8], 0
je 0x18003f593
lea rax, [r9 + 0x14]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 4
lea r8, [0x180015d50]
xor edx, edx
xor ecx, ecx
call fcn.18009cde0
mov rcx, qword [rdi]
mov qword [rcx + 0x18], rax
mov rax, qword [rdi]
cmp qword [rax + 0x18], 0
jne 0x18003f46c
mov qword [rax + 0x18], 0xffffffffffffffff
mov rdi, qword [rdi]
mov rcx, qword [rdi + 0x18]
cmp rcx, 0xffffffffffffffff
je 0x18003f45f
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rdi + 0x18], 0xffffffffffffffff
mov byte [rdi + 0x10], 0
mov dword [rdi + 0x14], r13d
jmp 0x18003f593
mov byte [rax + 0x10], 1
mov rcx, qword [rdi]
mov rcx, qword [rcx + 0x18]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
cmp eax, 0xffffffff
jne 0x18003f4ac
mov rsi, qword [rdi]
mov rcx, qword [rsi + 0x18]
cmp rcx, 0xffffffffffffffff
je 0x18003f49d
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rsi + 0x18], 0xffffffffffffffff
mov byte [rsi + 0x10], 0
mov dword [rsi + 0x14], r13d
mov rax, qword [rdi]
mov byte [rax + 0x10], 0
mov rcx, qword [rbx + 8]
test rcx, rcx
jne 0x18003f4ba
mov rdx, r13
jmp 0x18003f4c5
mov rdx, qword [rbx + 0x10]
sub rdx, rcx
sar rdx, 3
test rcx, rcx
je 0x18003f505
mov rax, qword [rbx + 0x18]
sub rax, rcx
sar rax, 3
cmp rdx, rax
jae 0x18003f505
mov rax, qword [rbx + 0x10]
xor ecx, ecx
mov byte [rsp + 0xb8], cl
mov byte [rsp + 0xc0], cl
mov byte [rsp + 0xc8], cl
mov qword [rax], rdi
add rax, 8
mov qword [rbx + 0x10], rax
jmp 0x18003f593
mov rdi, qword [rbx + 0x10]
cmp rcx, rdi
jbe 0x18003f513
call fcn.18009a780
mov qword [rsp + 0x50], rbx
mov qword [rsp + 0x58], rdi
mov rsi, qword [rbx + 8]
test rsi, rsi
je 0x18003f549
mov rcx, qword [rbx + 0x10]
mov rax, rcx
sub rax, rsi
sar rax, 3
je 0x18003f549
cmp rsi, rcx
jbe 0x18003f540
call fcn.18009a780
sub rdi, rsi
sar rdi, 3
jmp 0x18003f54c
mov rdi, r13
movaps xmm0, xmmword [rsp + 0x50]
movdqa xmmword [rsp + 0x60], xmm0
lea r9, [rsp + 0x30]
mov r8d, 1
lea rdx, [rsp + 0x60]
mov rcx, rbx
call fcn.18003f870
mov rsi, qword [rbx + 8]
cmp rsi, qword [rbx + 0x10]
jbe 0x18003f57e
call fcn.18009a780
lea rax, [rsi + rdi*8]
cmp rax, qword [rbx + 0x10]
ja 0x18003f58e
cmp rax, qword [rbx + 8]
jae 0x18003f593
call fcn.18009a780
add ebp, 1
cmp ebp, dword [r12 + 0x70]
jb 0x18003f391
mov rcx, qword [rbx + 8]
test rcx, rcx
je 0x18003f5e4
mov rax, qword [rbx + 0x10]
sub rax, rcx
sar rax, 3
je 0x18003f5e4
test rcx, rcx
je 0x18003f5c9
mov rax, qword [rbx + 0x10]
sub rax, rcx
sar rax, 3
jne 0x18003f5ce
call fcn.18009a780
mov rax, qword [rbx + 8]
mov rcx, qword [rax]
mov qword [r12 + 0x48], rcx
mov byte [r12 + 8], 1
mov al, 1
jmp 0x18003f5e6
xor al, al
add rsp, 0x70
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret