Function at 0x100162d90
Capabilities:
Check if file exists
Create directory
Query environment variable

Disassembly:
mov rax, rsp
push rbp
push r14
push r15
lea rbp, [rax - 0x2a8]
sub rsp, 0x390
mov qword [rsp + 0x40], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x10022f440]
xor rax, rsp
mov qword [rbp + 0x280], rax
mov rsi, rdx
mov qword [rsp + 0x38], rdx
xor r14d, r14d
mov dword [rsp + 0x30], r14d
mov rcx, rdx
call fcn.100152360
mov dword [rsp + 0x30], 1
mov r8d, 0x104
lea rdx, [rbp + 0x70]
lea rcx, [0x1000453a8]
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
dec eax
cmp eax, 0x103
ja 0x100162e18
lea rdx, [rbp + 0x70]
mov rcx, rsi
call fcn.100057700
lea rax, [rsp + 0x50]
mov qword [rbp + 0x50], rax
mov edi, 0x80
mov qword [rbp + 0x58], rdi
mov qword [rbp + 0x60], r14
mov r15d, 0x200
mov rdx, qword [rbp + 0x50]
test rdx, rdx
je 0x100162e8f
lea rax, [rsp + 0x50]
cmp rdx, rax
je 0x100162e8f
mov rax, rdx
and rax, 0xffffffffffffe000
je 0x100162e5d
cmp word [rax + 4], r15w
jne 0x100162e5d
mov rax, qword [rax + 0x28]
mov rax, qword [rax + 8]
mov rcx, qword [rax + 0x10]
dec rcx
not rcx
and rcx, rdx
je 0x100162e7b
cmp word [rcx + 4], r15w
jne 0x100162e7b
mov rcx, qword [rcx + 0x28]
mov rcx, qword [rcx + 8]
test byte [rcx + 0x28], 8
jne 0x100162e8b
mov rax, qword [rcx]
call qword [rax + 0x28]
mov qword [rbp + 0x50], r14
mov rdx, r14
mov qword [rbp + 0x60], rdx
mov qword [rbp + 0x58], rdi
lea rax, [rsp + 0x50]
mov qword [rbp + 0x50], rax
lea rbx, [0x1000453b8]
nop word [rax + rax]
cmp rdi, rdx
jne 0x100162ec3
lea rcx, [rsp + 0x50]
call fcn.1000577e0
mov rdx, qword [rbp + 0x60]
movzx ecx, word [rbx]
mov rax, qword [rbp + 0x50]
mov word [rax + rdx*2], cx
mov rdx, qword [rbp + 0x60]
inc rdx
mov qword [rbp + 0x60], rdx
add rbx, 2
cmp word [rbx], 0
je 0x100162ee9
mov rdi, qword [rbp + 0x58]
jmp 0x100162eb0
cmp qword [rbp + 0x58], rdx
jne 0x100162efd
lea rcx, [rsp + 0x50]
call fcn.1000577e0
mov rdx, qword [rbp + 0x60]
mov rax, qword [rbp + 0x50]
mov word [rax + rdx*2], r14w
inc qword [rbp + 0x60]
lea rdx, [rsp + 0x50]
mov rcx, rsi
call fcn.100152470
nop
mov rdx, qword [rbp + 0x50]
test rdx, rdx
je 0x100162f73
lea rax, [rsp + 0x50]
cmp rdx, rax
je 0x100162f73
mov rax, rdx
and rax, 0xffffffffffffe000
je 0x100162f41
cmp word [rax + 4], r15w
jne 0x100162f41
mov rax, qword [rax + 0x28]
mov rax, qword [rax + 8]
mov rcx, qword [rax + 0x10]
dec rcx
not rcx
and rcx, rdx
je 0x100162f5f
cmp word [rcx + 4], r15w
jne 0x100162f5f
mov rcx, qword [rcx + 0x28]
mov rcx, qword [rcx + 8]
test byte [rcx + 0x28], 8
jne 0x100162f6f
mov rax, qword [rcx]
call qword [rax + 0x28]
mov qword [rbp + 0x50], r14
mov rcx, qword [rsi + 0x100]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x100162fc7
xor r8d, r8d
mov rdx, qword [rsi + 0x100]
xor ecx, ecx
call qword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
je 0x100162fa6
or eax, 0x80070000
mov ecx, eax
call fcn.10015ed00
mov r8, qword [rsi + 0x100]
mov edx, 4
lea ecx, [rdx - 2]
lea r9d, [rdx - 3]
mov qword [rsp + 0x20], r8
lea r8d, [rdx + 0x72]
call fcn.10015ebf0
mov rax, rsi
mov rcx, qword [rbp + 0x280]
xor rcx, rsp
call fcn.10005f420
lea r11, [rsp + 0x390]
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x30]
mov rdi, qword [r11 + 0x38]
mov rsp, r11
pop r15
pop r14
pop rbp
ret