Function at 0x140018180
Capabilities:
Create thread

Disassembly:
push rsi
push r13
push r14
push r15
sub rsp, 0x138
mov rax, qword [0x1402ca920]
xor rax, rsp
mov qword [rsp + 0x80], rax
mov r9, qword [rcx + 8]
mov r14, r8
mov r13, rcx
test r9, r9
je 0x14001863e
mov eax, dword [r9 + 0x30]
cmp eax, 5
jne 0x1400183fa
lea esi, [rax - 4]
mov eax, 1
mov qword [rsp + 0x170], rbp
xchg dword [r9 + 0x30], eax
mov rdx, qword [rcx + 8]
mov rcx, qword [rcx + 0x20]
mov qword [rsp + 0x130], rdi
mov edi, dword [rdx + 0x34]
test rcx, rcx
je 0x1400181fc
xor r8d, r8d
mov edx, edi
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
mov rdx, qword [r13 + 8]
mov rcx, qword [rdx + 0x28]
test rcx, rcx
je 0x14001820f
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rdx, qword [r13 + 8]
xor ebp, ebp
mov qword [rsp + 0x168], rbx
cmp dword [rdx + 0x4c], ebp
jbe 0x140018275
mov r9, rdx
mov qword [rsp + 0x28], rbp
mov rdx, qword [rdx + 8]
lea r8, [0x1400180d0]
xor ecx, ecx
mov dword [rsp + 0x20], ebp
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rbx, rax
test rax, rax
je 0x140018275
lea edx, [rbp + 0x32]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x14001826c
call fcn.140018960
mov edx, 0x32
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x140018255
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x1400182b4
mov rbx, rdi
nop dword [rax]
mov rcx, qword [r13 + 8]
mov rax, qword [rcx + 0x20]
test rax, rax
je 0x14001829a
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [r13 + 8]
mov rcx, qword [rcx]
xor r9d, r9d
xor r8d, r8d
mov edx, 0x2766
call qword [sym.imp.KERNEL32.dll_PostQueuedCompletionStatus]
sub rbx, 1
jne 0x140018280
mov rdi, qword [rsp + 0x130]
test esi, esi
jne 0x1400185a9
mov ebx, 0xffffffff
movaps xmmword [rsp + 0xc0], xmm12
cmp dword [r14], ebx
cmovg ebx, dword [r14]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov rcx, rax
mov rax, qword [r13 + 8]
xchg qword [rax + 0x18], rcx
call fcn.140031010
mov rax, qword [r13 + 8]
movaps xmm12, xmm0
cmp dword [rax + 0x34], ebp
jbe 0x1400185a0
movaps xmmword [rsp + 0x100], xmm8
movsd xmm8, qword [0x140288ad8]
movaps xmmword [rsp + 0xf0], xmm9
movsd xmm9, qword [0x140288ad0]
movaps xmmword [rsp + 0xe0], xmm10
movsd xmm10, qword [0x140288aa0]
movaps xmmword [rsp + 0xd0], xmm11
movsd xmm11, qword [0x140288ae0]
movaps xmmword [rsp + 0xb0], xmm13
movsd xmm13, qword [0x140288a80]
movaps xmmword [rsp + 0xa0], xmm14
movsd xmm14, qword [0x140288aa8]
movaps xmmword [rsp + 0x90], xmm15
movsd xmm15, qword [0x140288a78]
movaps xmmword [rsp + 0x120], xmm6
movaps xmmword [rsp + 0x110], xmm7
test ebx, ebx
jle 0x1400184bd
lea rcx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [rsp + 0x7e]
movzx r10d, word [rsp + 0x7c]
movzx r11d, word [rsp + 0x7a]
movzx r9d, word [rsp + 0x78]
movzx r8d, word [rsp + 0x76]
movzx edx, word [rsp + 0x72]
movzx ecx, word [rsp + 0x70]
movsd qword [rsp + 0x38], xmm8
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], r10
mov qword [rsp + 0x20], r11
call fcn.140030dd0
comisd xmm8, xmm0
jbe 0x140018414
movaps xmm6, xmm8
jmp 0x14001841c
mov esi, dword [rdx]
cmp eax, 1
jne 0x1400181c4
test esi, esi
jne 0x1400181c4
xor eax, eax
jmp 0x140018643
movaps xmm6, xmm10
minsd xmm6, xmm0
comisd xmm8, xmm12
jbe 0x140018429
movaps xmm7, xmm8
jmp 0x140018432
movaps xmm7, xmm10
minsd xmm7, xmm12
ucomisd xmm6, xmm7
jp 0x14001843a
je 0x1400184b9
comisd xmm6, xmm9
ja 0x140018457
movaps xmm0, xmm6
call fcn.14020372c
movaps xmm1, xmm6
movaps xmm6, xmm0
subsd xmm1, xmm0
subsd xmm6, xmm1
comisd xmm7, xmm9
ja 0x140018474
movaps xmm0, xmm7
call fcn.14020372c
movaps xmm1, xmm7
movaps xmm7, xmm0
subsd xmm1, xmm0
subsd xmm7, xmm1
subsd xmm6, xmm7
comisd xmm11, xmm6
jbe 0x140018485
movaps xmm0, xmm11
jmp 0x14001848d
movaps xmm0, xmm14
minsd xmm0, xmm6
mulsd xmm0, xmm15
mulsd xmm0, xmm13
mulsd xmm0, xmm13
mulsd xmm0, qword [0x140288a98]
addsd xmm0, qword [0x140288a48]
cvttsd2si rax, xmm0
cmp eax, ebx
jge 0x140018551
mov rax, qword [r13 + 8]
test rax, rax
je 0x140018551
mov rcx, qword [rax + 0x18]
mov edx, 0x32
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
xor r9d, r9d
mov dword [rsp + 0x20], ebp
xor r8d, r8d
lea rcx, [rsp + 0x40]
xor edx, edx
call qword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
je 0x14001853f
cmp dword [rsp + 0x48], 0x12
je 0x14001853f
xor r9d, r9d
lea rcx, [rsp + 0x40]
xor r8d, r8d
xor edx, edx
call qword [sym.imp.USER32.dll_GetMessageW]
test eax, eax
jle 0x14001853f
lea rcx, [rsp + 0x40]
call qword [sym.imp.USER32.dll_TranslateMessage]
lea rcx, [rsp + 0x40]
call qword [sym.imp.USER32.dll_DispatchMessageW]
xor r9d, r9d
mov dword [rsp + 0x20], ebp
xor r8d, r8d
lea rcx, [rsp + 0x40]
xor edx, edx
call qword [sym.imp.USER32.dll_PeekMessageW]
test eax, eax
jne 0x1400184f0
mov rax, qword [r13 + 8]
test rax, rax
je 0x140018551
cmp dword [rax + 0x34], ebp
ja 0x140018398
movaps xmm6, xmmword [rsp + 0x120]
movaps xmm7, xmmword [rsp + 0x110]
movaps xmm13, xmmword [rsp + 0xb0]
movaps xmm11, xmmword [rsp + 0xd0]
movaps xmm10, xmmword [rsp + 0xe0]
movaps xmm9, xmmword [rsp + 0xf0]
movaps xmm8, xmmword [rsp + 0x100]
movaps xmm14, xmmword [rsp + 0xa0]
movaps xmm15, xmmword [rsp + 0x90]
movaps xmm12, xmmword [rsp + 0xc0]
mov rcx, qword [r13 + 8]
mov rbx, qword [rsp + 0x168]
test rcx, rcx
je 0x140018636
mov rax, qword [rcx + 0x28]
test rax, rax
je 0x1400185db
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [r13 + 8]
mov rax, rbp
xchg qword [rcx + 0x28], rax
mov rcx, qword [r13 + 8]
mov rax, qword [rcx + 0x20]
test rax, rax
je 0x1400185fc
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [r13 + 8]
mov rax, rbp
xchg qword [rcx + 0x20], rax
mov rcx, qword [r13 + 8]
mov rax, qword [rcx + 0x18]
test rax, rax
je 0x14001861d
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, qword [r13 + 8]
mov rax, rbp
xchg qword [rdx + 0x18], rax
mov rcx, qword [r13 + 8]
mov rcx, qword [rcx]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, qword [r13 + 8]
lea rcx, [r13 + 8]
xchg dword [rdx + 0x30], ebp
call fcn.1400189e0
mov rbp, qword [rsp + 0x170]
mov eax, 1
mov rcx, qword [rsp + 0x80]
xor rcx, rsp
call fcn.1401f2820
add rsp, 0x138
pop r15
pop r14
pop r13
pop rsi
ret