Function at 0x140006804
Capabilities:
Get common file path
Query environment variable

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push r12
sub rsp, 0x30
mov bpl, dl
mov rdi, rcx
mov rdx, rcx
mov esi, 0x1770
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
xor r12d, r12d
cmp eax, r12d
jbe 0x140006852
mov r8b, 1
mov rcx, rdi
mov dl, r8b
call fcn.140006140
cmp al, r12b
jne 0x140006b15
lea rcx, str.USERPROFILE
mov r8d, esi
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp eax, r12d
jbe 0x140006894
lea rdx, str.AppDataLocalTemp
mov rcx, rdi
call fcn.140017460
cmp rax, r12
je 0x140006894
mov r8b, 1
xor edx, edx
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
lea rcx, str.HOMEDRIVE
mov r8d, esi
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp eax, r12d
jbe 0x1400068ef
mov rcx, rdi
call fcn.140016da8
mov ebx, esi
mov rcx, rdi
sub ebx, eax
call fcn.140016da8
lea rcx, str.HOMEPATH
lea rdx, [rdi + rax*2]
mov r8d, ebx
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp eax, r12d
jbe 0x1400068ef
mov r8b, 1
xor edx, edx
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
call fcn.140005b58
mov rax, qword [0x140045238]
cmp rax, r12
je 0x140006962
xor r9d, r9d
xor r8d, r8d
xor ecx, ecx
lea edx, [r9 + 0x23]
mov qword [rsp + 0x20], rdi
call rax
cmp eax, r12d
jne 0x140006962
mov rcx, rdi
call fcn.140016da8
cmp rax, r12
jbe 0x140006962
lea rdx, [0x140034908]
mov rcx, rdi
call fcn.140017460
mov rcx, rdi
call fcn.140018874
lea rdx, [0x1400348f8]
mov rcx, rdi
call fcn.140017460
mov r8b, 1
mov rcx, rdi
mov dl, r8b
call fcn.140006140
cmp al, r12b
jne 0x140006b15
mov edx, esi
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
cmp eax, r12d
jbe 0x14000699c
lea rdx, [0x1400348f8]
mov rcx, rdi
call fcn.140017460
cmp rax, r12
je 0x14000699c
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
lea rdx, str.c:_temp
mov rcx, rdi
call fcn.14001748c
cmp rax, r12
je 0x1400069c6
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
lea rdx, str.c:_tmp
mov rcx, rdi
call fcn.14001748c
cmp rax, r12
je 0x1400069f0
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
mov edx, esi
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
cmp eax, r12d
jbe 0x140006a16
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
lea rdx, str.c:_tmp
mov rcx, rdi
call fcn.14001748c
cmp rax, r12
je 0x140006a40
xor r8d, r8d
mov dl, 1
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
mov rdx, rdi
mov ecx, esi
mov byte [0x14004c772], 1
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp eax, r12d
jbe 0x140006a6d
xor r8d, r8d
mov dl, 1
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
lea rcx, str.USERPROFILE
mov r8d, esi
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp eax, r12d
jbe 0x140006aab
lea rdx, str.AppDataLocalTemp
mov rcx, rdi
call fcn.140017460
cmp rax, r12
je 0x140006aab
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
lea rcx, str.HOMEDRIVE
mov r8d, esi
mov rdx, rdi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp eax, r12d
jbe 0x140006b00
mov rcx, rdi
call fcn.140016da8
mov rcx, rdi
sub esi, eax
call fcn.140016da8
lea rcx, str.HOMEPATH
lea rdx, [rdi + rax*2]
mov r8d, esi
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp eax, r12d
jbe 0x140006b00
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call fcn.140006140
cmp al, r12b
jne 0x140006b15
mov word [rdi], r12w
cmp bpl, r12b
je 0x140006b15
xor edx, edx
mov ecx, 0x3f7
call fcn.140004f90
mov rbx, qword [rsp + 0x40]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
mov rdi, qword [rsp + 0x58]
add rsp, 0x30
pop r12
ret