Function at 0x140016e50
Capabilities:
Check if file exists

Disassembly:
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x18], r8
mov qword [rsp + 8], rcx
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
mov rbp, rsp
sub rsp, 0x70
mov r12, qword [rbp + 0x60]
xor esi, esi
mov qword [rbp - 0x40], rsi
mov rdi, r8
mov qword [rbp - 0x18], rsi
mov rbx, rdx
mov qword [rbp - 0x28], rsi
mov r14d, esi
mov qword [rbp - 0x30], rsi
mov r13d, esi
test r12, r12
je 0x140016e9b
mov qword [r12], rsi
mov rcx, rbx
mov qword [rsp + 0xb8], r15
call fcn.140016230
mov qword [rbp - 8], rax
test rax, rax
jne 0x140016ec0
lea rcx, str.FILE:__s:_failed_to_get_full_path_for__s._n
jmp 0x140017194
lea r8, [rbp - 0x28]
mov rcx, rax
lea rdx, [rbp - 0x40]
call fcn.140014ba0
mov rcx, qword [rbp - 0x40]
test rcx, rcx
je 0x140016ede
cmp byte [rcx], sil
jne 0x140016ef4
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea rcx, [0x140083cd8]
call fcn.140042340
mov qword [rbp - 0x40], rax
mov r8, qword [rbp - 0x28]
test r8, r8
je 0x14001718d
cmp byte [r8], sil
je 0x14001718d
mov r9, rdi
lea rdx, str._s___d_s__n
xor ecx, ecx
call fcn.140030570
mov rcx, qword [rbp - 0x40]
lea rdx, [rbp - 0x30]
mov qword [rbp - 0x18], rax
call fcn.140016490
cmp eax, 0xffffffff
jne 0x140016f41
mov r8, qword [rbp - 0x40]
lea rcx, str.FILE:__s:_failed_to_read_the_directory__s._n
jmp 0x140017197
movsxd rbx, eax
mov edx, 4
mov rcx, rbx
call fcn.140020ab0
mov qword [rbp - 0x10], rax
mov r13, rax
test rbx, rbx
jle 0x140017036
mov r15, rsi
mov r12, rax
mov r13, rbx
nop word [rax + rax]
mov rcx, qword [rbp - 0x30]
lea r9, [rbp - 0x38]
mov rdx, qword [rbp - 0x18]
lea r8, [rbp - 0x20]
mov dword [rbp - 0x38], esi
mov rcx, qword [rcx + r15*8]
call fcn.14000bd20
cmp eax, 1
jl 0x140016fc0
mov rax, qword [rbp - 0x30]
mov rcx, qword [rax + r15*8]
mov rax, 0xffffffffffffffff
inc rax
cmp byte [rcx + rax], sil
jne 0x140016fa0
movsxd rcx, dword [rbp - 0x38]
cmp rcx, rax
jne 0x140016fc0
mov eax, dword [rbp - 0x20]
inc r14d
mov dword [r12], eax
add r12, 4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, qword [rbp - 0x30]
mov edi, dword [rax]
mov rcx, qword [rcx + r15*8]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
inc r15
mov dword [rax], edi
cmp r15, r13
jl 0x140016f70
mov r13, qword [rbp - 0x10]
test r14d, r14d
jle 0x14001702e
movsxd rbx, r14d
lea r9, [0x140016e40]
mov rdx, rbx
mov r8d, 4
mov rcx, r13
call qword [sym.imp.api_ms_win_crt_utility_l1_1_0.dll_qsort]
mov eax, dword [r13 + rbx*4 - 4]
mov rdi, qword [rbp + 0x50]
mov r12, qword [rbp + 0x60]
jmp 0x140017038
mov rdi, qword [rbp + 0x50]
mov r12, qword [rbp + 0x60]
mov eax, esi
mov r9, qword [rbp - 0x28]
lea rdx, str._s__s__d_s
mov r8, qword [rbp - 0x40]
inc eax
mov qword [rsp + 0x28], rdi
xor ecx, ecx
mov dword [rsp + 0x20], eax
call fcn.140030570
mov rcx, qword [rbp + 0x40]
mov rdx, rax
mov r15, rax
call fcn.140025be0
mov ebx, eax
cmp eax, 0xffffffff
jne 0x1400170a0
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x1400170a0
mov ecx, eax
call fcn.140013400
mov r8, qword [rbp + 0x40]
lea rdx, str.FileRotateByRenumber
mov r9, r15
mov qword [rsp + 0x20], rax
lea rcx, str.FILE:__s:_failed_to_rename__s_____s_failed:__s_n
call fcn.14001bf60
test r12, r12
je 0x1400170b0
cmp ebx, 0xffffffff
je 0x1400170b0
mov qword [r12], r15
jmp 0x1400170dd
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, r15
mov edi, dword [rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], edi
mov rdi, qword [rbp + 0x50]
mov eax, dword [rbp + 0x58]
cmp r14d, eax
jl 0x1400171a3
sub r14d, eax
movsxd r15, r14d
js 0x1400171a3
nop word [rax + rax]
mov eax, dword [r13 + rsi*4]
lea rdx, str._s__s__d_s
mov r9, qword [rbp - 0x28]
xor ecx, ecx
mov r8, qword [rbp - 0x40]
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], eax
call fcn.140030570
mov rcx, rax
mov r14, rax
call fcn.140025d20
cmp eax, 0xffffffff
jne 0x140017152
call fcn.140013250
mov r9, rax
lea rdx, str.FileRotateByRenumber
mov r8, r14
lea rcx, str.FILE:__s:_failed_to_remove__s:__s_n
call fcn.14001bf60
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, r14
mov edi, dword [rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
inc rsi
mov dword [rax], edi
mov rdi, qword [rbp + 0x50]
cmp rsi, r15
jle 0x140017100
jmp 0x1400171a3
lea rcx, str.FILE:__s:_failed_to_get_base_name_for_path__s._n
mov r8, rbx
lea rdx, str.FileRotateByRenumber
call fcn.14001bf60
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, r13
mov edi, dword [rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], edi
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, qword [rbp - 0x30]
mov edi, dword [rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], edi
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, qword [rbp - 0x18]
mov edi, dword [rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], edi
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, qword [rbp - 0x40]
mov edi, dword [rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], edi
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, qword [rbp - 0x28]
mov edi, dword [rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [rax], edi
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov rcx, qword [rbp - 8]
mov edi, dword [rax]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_SetLastError]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov r15, qword [rsp + 0xb8]
mov dword [rax], edi
add rsp, 0x70
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret