Function at 0x140004e60
Capabilities:
Check if file exists

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x98
movaps xmmword [rsp + 0x80], xmm6
mov qword [rsp + 0x40], rdx
mov rax, qword [0x1401f5028]
xor rax, rsp
mov qword [rsp + 0x78], rax
xor ebp, ebp
cmp r8d, r9d
jb 0x1400051e4
mov eax, r9d
and eax, 0x1f
jne 0x1400051e4
mov r13, rcx
add r8d, 0xfffffff0
mov eax, r9d
mov qword [rsp + 0x50], rax
lea rcx, [rax + 0x28]
xor ebp, ebp
mov rax, r8
xor edx, edx
div rcx
cmp rcx, r8
ja 0x1400051e4
mov rcx, qword [rsp + 0x40]
mov qword [r13], rcx
mov qword [rcx], 0
lea rcx, [rax + rax*4]
lea rsi, [rcx*8 + 0x10]
lea rcx, [r13 + 8]
mov qword [rsp + 0x48], rcx
xor r12d, r12d
xorps xmm6, xmm6
xor ebp, ebp
mov dword [rsp + 0x3c], r9d
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x60], rsi
mov r14, qword [r13]
mov ecx, 0x48
call fcn.1400f045c
mov rdi, rax
movups xmmword [rax], xmm6
mov ecx, 0x18
call fcn.1400f045c
mov qword [rax + 0x10], rdi
mov rcx, qword [rsp + 0x48]
mov qword [rax + 8], rcx
mov rcx, qword [r13 + 8]
mov qword [rax], rcx
mov qword [rcx + 8], rax
mov qword [r13 + 8], rax
inc qword [r13 + 0x18]
xor ecx, ecx
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov r15, rax
cmp qword [rdi], rax
mov qword [rsp + 0x68], rbp
je 0x140004f9a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov rax, qword [rdi]
inc rax
cmp rax, 2
jae 0x140005165
mov rax, r15
inc rax
cmp rax, 2
jb 0x140004f8f
mov qword [rdi], r15
call fcn.1400c18d0
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov r15, qword [rdi]
mov rsi, r14
lea rbx, [r14 + r12]
add rbx, 0x20
mov r14, qword [r13 + 0x28]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
xor ebp, ebp
mov dword [rsp + 0x30], ebp
mov dword [rsp + 0x28], ebp
mov dword [rsp + 0x20], 0x100002
mov rcx, rax
mov rdx, r15
mov r8, r14
mov r9, rbx
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x1400051e4
xor ecx, ecx
xor edx, edx
xor r8d, r8d
xor r9d, r9d
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov rbx, rax
cmp qword [rdi + 8], rax
je 0x140005030
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r14d, eax
mov rax, qword [rdi + 8]
inc rax
cmp rax, 2
jae 0x14000517e
mov rax, rbx
inc rax
cmp rax, 2
jb 0x140005023
mov qword [rdi + 8], rbx
call fcn.1400c18d0
mov ecx, r14d
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rbx, qword [rdi + 8]
lea r14, [rsi + r12]
add r14, 0x28
mov r15, qword [r13 + 0x28]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
xor ebp, ebp
mov dword [rsp + 0x30], ebp
mov dword [rsp + 0x28], ebp
mov dword [rsp + 0x20], 0x100002
mov rcx, rax
mov rdx, rbx
mov r8, r15
mov r9, r14
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x1400051e4
lea rax, [rsi + r12]
add rax, 0x10
mov rsi, qword [rsp + 0x60]
mov qword [rax], rsi
mov dword [rax + 8], 1
mov rdx, qword [rsp + 0x40]
mov qword [rdi + 0x20], rdx
mov ecx, dword [rsp + 0x3c]
mov dword [rdi + 0x10], ecx
mov qword [rdi + 0x28], rax
mov rax, qword [rax]
add rax, rdx
mov qword [rdi + 0x18], rax
mov rax, qword [r13 + 0x38]
mov qword [rdi + 0x30], rax
mov rax, qword [r13 + 0x28]
mov qword [rdi + 0x38], rax
mov eax, dword [r13 + 0x30]
mov dword [rdi + 0x40], eax
test r13, r13
mov r14, qword [rsp + 0x58]
je 0x140005149
mov rbx, qword [r13 + 0x20]
mov rdx, qword [rdi]
mov qword [rsp + 0x70], 0
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0xffffffff
lea rcx, [rsp + 0x70]
lea r8, [0x140017bf0]
mov r9, rdi
call qword [sym.imp.KERNEL32.dll_RegisterWaitForSingleObject]
test eax, eax
je 0x140005149
mov r15, qword [rsp + 0x70]
lea rdi, [rbx + 0x20]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea rbp, [rbx + 8]
mov ecx, 0x20
call fcn.1400f045c
mov qword [rax + 0x10], r13
mov qword [rax + 0x18], r15
mov qword [rax + 8], rbp
mov rcx, qword [rbx + 8]
mov qword [rax], rcx
mov qword [rcx + 8], rax
mov qword [rbx + 8], rax
inc qword [rbx + 0x18]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
add rsi, qword [rsp + 0x50]
mov rbp, qword [rsp + 0x68]
inc rbp
add r12, 0x28
cmp rbp, r14
jne 0x140004f03
jmp 0x140005199
call fcn.1400c18d0
mov rcx, qword [rdi]
call fcn.1400def50
mov qword [rdi], 0
jmp 0x140004f7b
call fcn.1400c18d0
mov rcx, qword [rdi + 8]
call fcn.1400def50
mov qword [rdi + 8], 0
jmp 0x14000500e
mov rsi, qword [r13]
mov rdi, qword [r13 + 0x28]
add rsi, 8
mov rbx, qword [0x140201540]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
xor ebp, ebp
mov dword [rsp + 0x30], ebp
mov dword [rsp + 0x28], ebp
mov dword [rsp + 0x20], 0x100002
mov rcx, rax
mov rdx, rbx
mov r8, rdi
mov r9, rsi
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
je 0x1400051e4
mov rax, qword [r13]
mov qword [rax], r14
mov bpl, 1
mov rcx, qword [rsp + 0x78]
xor rcx, rsp
call fcn.1400f32c0
mov eax, ebp
movaps xmm6, xmmword [rsp + 0x80]
add rsp, 0x98
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret