Function at 0x18001c040
Capabilities:
Create thread

Disassembly:
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x10], rdx
push rsi
sub rsp, 0x70
mov rax, qword [0x1800a7588]
mov esi, ecx
mov qword [rsp + 0x38], rax
test rax, rax
je 0x18001c34e
test ecx, ecx
je 0x18001c34e
cmp ecx, 0x40
jae 0x18001c08e
mov r9d, 0x1388
mov r8d, 1
mov rdx, rax
add rsp, 0x70
pop rsi
jmp qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov qword [rsp + 0x80], rbx
mov qword [rsp + 0x68], rbp
mov qword [rsp + 0x60], rdi
mov eax, 0x4104105
mov edi, ecx
mov qword [rsp + 0x58], r12
mov qword [rsp + 0x50], r13
mul esi
sub edi, edx
shr edi, 1
add edi, edx
shr edi, 5
imul eax, edi, 0x3f
sub esi, eax
je 0x18001c0c5
inc edi
lea rbx, [rdi*8]
lea r13d, [rdi - 1]
mov r12d, edi
mov rcx, rbx
call fcn.180053ad4
mov rbp, rax
test rax, rax
jne 0x18001c0f5
lea ecx, [rax + 8]
call qword [sym.imp.KERNEL32.dll_SetLastError]
or eax, 0xffffffff
jmp 0x18001c317
mov rcx, rbx
mov qword [rsp + 0x48], r14
call fcn.180053ad4
mov r14, rax
test rax, rax
jne 0x18001c124
mov rcx, rbp
call fcn.180053a94
lea ecx, [r14 + 8]
call qword [sym.imp.KERNEL32.dll_SetLastError]
or eax, 0xffffffff
jmp 0x18001c312
mov qword [rsp + 0x40], r15
xor r15d, r15d
test edi, edi
je 0x18001c23d
sub rax, rbp
mov dword [rsp + 0x98], r15d
mov qword [rsp + 0x88], rbp
mov qword [rsp + 0x30], rax
nop dword [rax]
mov ecx, 0x18
call fcn.180053ad4
mov rbx, rax
test rax, rax
je 0x18001c339
mov dword [rax + 0x14], 1
mov dword [rax + 0x10], 0x1388
cmp r15d, r13d
jne 0x18001c181
test esi, esi
je 0x18001c181
mov dword [rax], esi
jmp 0x18001c187
mov dword [rax], 0x3f
inc dword [rax]
mov ecx, dword [rax]
shl rcx, 3
call fcn.180053ad4
xor ecx, ecx
mov qword [rbx + 8], rax
test rax, rax
je 0x18001c2c1
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov rcx, qword [rbx + 8]
mov r8, qword [rsp + 0x88]
mov rdx, qword [rsp + 0x30]
mov qword [rcx], rax
mov rcx, qword [rbx + 8]
mov rax, qword [rcx]
add rcx, 8
mov qword [rdx + r8], rax
mov r8d, dword [rbx]
mov eax, dword [rsp + 0x98]
mov rdx, qword [rsp + 0x38]
dec r8d
lea rdx, [rdx + rax*8]
shl r8, 3
call fcn.180052e30
xor eax, eax
lea r8, [0x18001c370]
mov qword [rsp + 0x28], rax
mov r9, rbx
xor edx, edx
xor ecx, ecx
mov dword [rsp + 0x20], eax
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rcx, qword [rsp + 0x88]
add dword [rsp + 0x98], 0x3f
mov qword [rcx], rax
add rcx, 8
inc r15d
mov qword [rsp + 0x88], rcx
cmp r15d, edi
jb 0x18001c150
mov r9d, 0x1388
mov r8d, 1
mov rdx, rbp
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov r13d, eax
test edi, edi
je 0x18001c2ac
mov r15, qword [r14 + 8]
mov rsi, rbp
mov rbx, r14
sub rsi, r14
nop dword [rax + rax]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov r9d, 0xc8
mov r8d, 1
mov rdx, rbp
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov rcx, qword [rsi + rbx]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
lea rbx, [rbx + 8]
dec r12
jne 0x18001c270
mov rcx, r14
call fcn.180053a94
mov rcx, rbp
call fcn.180053a94
mov eax, r13d
jmp 0x18001c30d
call fcn.180053a94
mov rcx, rbx
call fcn.180053a94
test r15d, r15d
je 0x18001c2ef
lea eax, [r15 - 1]
movsxd rbx, eax
test eax, eax
js 0x18001c2ef
nop
mov rcx, qword [r14 + rbx*8]
call qword [sym.imp.KERNEL32.dll_SetEvent]
dec rbx
jns 0x18001c2e0
mov rcx, r14
call fcn.180053a94
mov rcx, rbp
call fcn.180053a94
mov ecx, 8
call qword [sym.imp.KERNEL32.dll_SetLastError]
or eax, 0xffffffff
mov r15, qword [rsp + 0x40]
mov r14, qword [rsp + 0x48]
mov r12, qword [rsp + 0x58]
mov rdi, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x68]
mov rbx, qword [rsp + 0x80]
mov r13, qword [rsp + 0x50]
add rsp, 0x70
pop rsi
ret
mov ecx, 8
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rcx, rbp
call fcn.180053a94
jmp 0x18001c30a
mov ecx, 0x57
call qword [sym.imp.KERNEL32.dll_SetLastError]
or eax, 0xffffffff
add rsp, 0x70
pop rsi
ret