Function at 0x140058d10
Capabilities:
Check if file exists
Create directory
Get common file path
Get file attributes

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1c0]
sub rsp, 0x2c0
mov rax, qword [0x1400df0c0]
xor rax, rsp
mov qword [rbp + 0x1b0], rax
mov r13, rcx
xor r14d, r14d
xor edx, edx
mov r8d, 0x208
lea rcx, [rbp - 0x60]
call fcn.14009f420
lea rdx, [rbp - 0x60]
mov ecx, 0x104
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x14005916f
xorps xmm0, xmm0
movups xmmword [rsp + 0x38], xmm0
mov qword [rsp + 0x48], r14
mov qword [rsp + 0x50], r14
lea rax, [rbp - 0x60]
mov r8, 0xffffffffffffffff
inc r8
cmp word [rax + r8*2], r14w
jne 0x140058d93
lea rdx, [rbp - 0x60]
lea rcx, [rsp + 0x38]
call fcn.1400063b0
nop
lea r10, [rsp + 0x38]
mov rsi, qword [rsp + 0x38]
mov r11, qword [rsp + 0x50]
cmp r11, 7
cmova r10, rsi
lea rbx, [0x1400c7d98]
mov rdi, qword [rsp + 0x48]
cmp rdi, 1
jb 0x140058e2b
lea rcx, [rdi - 1]
mov rax, 0xffffffffffffffff
cmp rcx, rax
cmovb rax, rcx
lea r8, [r10 + rax*2]
mov r9, r8
sub r9, rbx
cmp word [r8], 0x5c
jne 0x140058e1c
mov edx, 1
mov rcx, rbx
movzx eax, word [r9 + rcx]
cmp ax, word [rcx]
jne 0x140058e1c
add rcx, 2
sub rdx, 1
jne 0x140058e00
sub r8, r10
sar r8, 1
jmp 0x140058e32
cmp r8, r10
je 0x140058e2b
sub r8, 2
sub r9, 2
jmp 0x140058df1
mov r8, 0xffffffffffffffff
lea rax, [rdi - 1]
mov r12d, 0x5c
cmp r8, rax
je 0x140058e99
mov rax, r11
sub rax, rdi
cmp rax, 1
jb 0x140058e69
lea rax, [rdi + 1]
mov qword [rsp + 0x48], rax
lea rax, [rsp + 0x38]
cmp r11, 7
cmova rax, rsi
mov dword [rax + rdi*2], r12d
jmp 0x140058e8a
mov qword [rsp + 0x20], 1
mov r9, rbx
movzx r8d, byte [rsp + 0x30]
mov edx, 1
lea rcx, [rsp + 0x38]
call fcn.14002d4a0
mov rsi, qword [rsp + 0x38]
mov rdi, qword [rsp + 0x48]
mov r11, qword [rsp + 0x50]
mov rax, r11
sub rax, rdi
cmp rax, 0x10
jb 0x140058ed9
lea rax, [rdi + 0x10]
mov qword [rsp + 0x48], rax
lea rbx, [rsp + 0x38]
cmp r11, 7
cmova rbx, rsi
lea rcx, [rbx + rdi*2]
mov r8d, 0x20
lea rdx, str.FLiNGTrainerTemp
call fcn.14009ed80
mov word [rbx + rdi*2 + 0x20], r14w
jmp 0x140058efe
mov qword [rsp + 0x20], SafeArrayUnaccessData
lea r9, str.FLiNGTrainerTemp
movzx r8d, byte [rsp + 0x30]
mov edx, 0x10
lea rcx, [rsp + 0x38]
call fcn.14002d4a0
lea rcx, [rsp + 0x38]
cmp qword [rsp + 0x50], 7
cmova rcx, qword [rsp + 0x38]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x140058f33
lea rcx, [rsp + 0x38]
cmp qword [rsp + 0x50], 7
cmova rcx, qword [rsp + 0x38]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea rcx, [rsp + 0x38]
cmp qword [rsp + 0x50], 7
cmova rcx, qword [rsp + 0x38]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140059131
mov rsi, qword [rsp + 0x48]
movabs rcx, 0x7ffffffffffffffe
mov rax, rcx
sub rax, rsi
cmp rax, 1
jb 0x1400591a5
lea r15, [rsp + 0x38]
cmp qword [rsp + 0x50], 7
cmova r15, qword [rsp + 0x38]
xorps xmm0, xmm0
movups xmmword [rsp + 0x58], xmm0
xorps xmm1, xmm1
movdqu xmmword [rsp + 0x68], xmm1
lea r14, [rsi + 1]
mov ebx, 7
lea rdi, [rsp + 0x58]
cmp r14, rbx
jbe 0x14005903b
mov rbx, r14
or rbx, 7
cmp rbx, rcx
jbe 0x140058fca
mov rbx, rcx
movabs rax, 0x7fffffffffffffff
lea rcx, [rax + rax]
jmp 0x140058ff9
mov eax, 0xa
cmp rbx, rax
cmovb rbx, rax
lea rcx, [rbx + 1]
movabs rax, 0x7fffffffffffffff
cmp rcx, rax
ja 0x1400591b1
add rcx, rcx
cmp rcx, 0x1000
jb 0x140059025
lea rax, [rcx + 0x27]
cmp rax, rcx
jbe 0x1400591b1
mov rcx, rax
call fcn.140078824
test rax, rax
je 0x1400591b7
lea rdi, [rax + 0x27]
and rdi, 0xffffffffffffffe0
mov qword [rdi - 8], rax
jmp 0x140059036
test rcx, rcx
je 0x140059034
call fcn.140078824
mov rdi, rax
jmp 0x140059036
xor edi, edi
mov qword [rsp + 0x58], rdi
mov qword [rsp + 0x68], r14
mov qword [rsp + 0x70], rbx
lea rbx, [rsi + rsi]
mov r8, rbx
mov rdx, r15
mov rcx, rdi
call fcn.14009ed80
mov word [rbx + rdi], r12w
xor ebx, ebx
mov word [rdi + r14*2], bx
lea rdx, [r13 + 0x70]
mov r8, qword [rdx + 0x10]
cmp qword [rdx + 0x18], 7
jbe 0x140059075
mov rdx, qword [rdx]
lea rcx, [rsp + 0x58]
call fcn.14002d410
movups xmm0, xmmword [rax]
movups xmmword [rsp + 0x78], xmm0
movups xmm1, xmmword [rax + 0x10]
movups xmmword [rbp - 0x78], xmm1
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], 7
mov word [rax], bx
lea rcx, [r13 + 0x50]
lea rdx, [rsp + 0x78]
call fcn.14001f2a0
mov rdx, qword [rbp - 0x70]
cmp rdx, 7
jbe 0x1400590ee
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x78]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400590e8
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400591ab
call fcn.1400787f0
nop
mov rdx, qword [rsp + 0x70]
cmp rdx, 7
jbe 0x140059131
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x58]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14005912b
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1400591b7
call fcn.1400787f0
nop
mov rdx, qword [rsp + 0x50]
cmp rdx, 7
jbe 0x14005916f
lea rdx, [rdx*2 + 2]
mov rcx, qword [rsp + 0x38]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14005916a
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14005919f
call fcn.1400787f0
mov rcx, qword [rbp + 0x1b0]
xor rcx, rsp
call fcn.1400787d0
lea r11, [rsp + 0x2c0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
call fcn.14007f704
nop
call fcn.140003240
nop
call fcn.14007f704
nop
call fcn.1400031a0
int3
call fcn.14007f704
int3