Function at 0x140016130
Capabilities:
Get common file path
Set current directory

Disassembly:
push rbp
push rdi
mov eax, 0x2d38
call fcn.140030eb0
sub rsp, rax
mov eax, dword [0x1400be3b0]
mov rdi, r9
mov rbp, rcx
inc eax
cmp eax, 0x30
mov dword [0x1400be3b0], eax
jge 0x140032a10
xor eax, eax
mov qword [rsp + 0x2d50], rbx
lea rcx, [rsp + 0x50]
mov qword [rsp + 0x2d30], r13
mov rbx, rdx
mov r13d, r8d
mov dword [rsp + 0x30], eax
mov qword [rsp + 0x58], rax
call fcn.1400166a0
lea rcx, [rsp + 0x50]
mov r8d, 0x2000
mov rdx, rbx
call fcn.1400166e0
test al, al
je 0x140032a41
mov qword [rsp + 0x2d58], rsi
mov qword [rsp + 0x2d60], r12
mov qword [rsp + 0x2d28], r14
lea rdx, [rsp + 0x6f0]
mov r14b, 1
mov ecx, 0x104
mov qword [rsp + 0x2d20], r15
mov qword [rsp + 0x2d68], rdi
xor r12b, r12b
movzx r15d, r14b
call qword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea r9, [rsp + 0x40]
lea r8, [rsp + 0xc0]
mov edx, 0x104
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFullPathNameW]
lea r11, [rsp + 0x2900]
lea r9, [rsp + 0x2b10]
lea r8, [rsp + 0x4e0]
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0xc0]
mov qword [rsp + 0x20], r11
call fcn.1400198fc
lea rdx, [rsp + 0x38]
lea rcx, [rsp + 0x2d0]
call fcn.140018140
lea rdx, [rsp + 0x4e0]
lea rcx, [rsp + 0x2d0]
call fcn.140018114
lea rcx, [rsp + 0x2d0]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
nop word [rax + rax]
cmp r15b, 1
jne 0x14001645d
mov eax, dword [rsp + 0x64]
test r15b, al
jne 0x140032a9f
test al, 2
jne 0x140032a9f
test al, 4
jne 0x140032a7f
mov ecx, 0xfff
call fcn.140017e24
lea rcx, [rsp + 0x50]
mov r8d, 0xfff
mov rdx, rax
mov rdi, rax
call fcn.140015ff0
movzx esi, al
test al, al
je 0x1400162e4
or edx, 0xffffffff
mov rcx, rdi
call fcn.140015e80
lea rcx, [rsp + 0x900]
mov rdx, rax
mov rbx, rax
call fcn.140018140
mov rcx, rbx
call fcn.140018614
mov rcx, rdi
call fcn.140018614
test sil, sil
je 0x14001645d
inc dword [rsp + 0x30]
xor eax, eax
mov rbx, rax
mov rdi, rax
movzx esi, word [rsp + rbx*2 + 0x900]
movzx ecx, si
call fcn.140018df8
test eax, eax
je 0x140016325
movzx ecx, si
call fcn.140018de0
test eax, eax
jne 0x1400164c2
cmp word [rsp + rbx*2 + 0x900], di
je 0x140016351
nop
movzx eax, word [rsp + rbx*2 + 0x900]
inc rbx
inc rdi
mov word [rsp + rdi*2 + 0x8fe], ax
cmp word [rsp + rbx*2 + 0x900], 0
jne 0x140016330
lea rdx, [rsp + 0x900]
xor esi, esi
mov rcx, rbp
mov word [rsp + rdi*2 + 0x900], si
call fcn.1400164e0
test al, al
je 0x140032b24
lea rcx, [rsp + 0x900]
call fcn.140018b4c
test eax, eax
je 0x1400163bf
lea edi, [rax - 1]
movsxd rbx, edi
test edi, edi
js 0x1400163b4
movzx esi, word [rsp + rbx*2 + 0x900]
movzx ecx, si
call fcn.140018df8
test eax, eax
je 0x1400163b2
movzx ecx, si
call fcn.140018de0
test eax, eax
jne 0x140032abf
xor esi, esi
movsxd rax, edi
mov word [rsp + rax*2 + 0x902], si
lea rcx, [rsp + 0x900]
xor dil, dil
call fcn.140018b4c
cmp eax, 2
jle 0x1400163f0
movsxd rbx, eax
movzx ecx, word [rsp + rbx*2 + 0x8fc]
and cx, 0x7f
call fcn.140018de0
test eax, eax
jne 0x1400164ca
cmp r12b, 1
je 0x140032ae0
lea rax, [rsp + 0x50]
lea r9, [rsp + 0x30]
lea r8, [rsp + 0xc0]
lea rdx, [rsp + 0x900]
mov rcx, rbp
mov dword [rsp + 0x28], r13d
mov qword [rsp + 0x20], rax
call fcn.140016580
cmp eax, 3
jne 0x140032af6
mov edx, dword [rsp + 0x30]
lea r8, [rsp + 0x900]
mov r9d, r13d
mov rcx, rbp
call fcn.1400165b0
cmp dil, 1
je 0x140032b1c
xor r12b, r12b
cmp r14b, 1
je 0x140016270
lea rcx, [rsp + 0x50]
call fcn.1400166a0
lea rcx, [rsp + 0x6f0]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea rcx, [rsp + 0x50]
call fcn.1400166a0
dec dword [0x1400be3b0]
mov r15, qword [rsp + 0x2d20]
mov r12, qword [rsp + 0x2d60]
mov rsi, qword [rsp + 0x2d58]
mov al, r14b
mov r14, qword [rsp + 0x2d28]
mov rbx, qword [rsp + 0x2d50]
mov r13, qword [rsp + 0x2d30]
add rsp, 0x2d38
pop rdi
pop rbp
ret
inc rbx
jmp 0x140016301
cmp word [rsp + rbx*2 + 0x8fe], 0x5f
jne 0x1400163f0
jmp 0x140032ad0
mov rax, qword [rsp + 0x2d70]
mov r8d, dword [rsp + 0x2d78]
lea r9, str.include_depth_exceeded.__Make_sure_there_are_no_recursive_includes
mov rdx, rdi
mov qword [rsp + 0x20], rax
call fcn.140043cf0
dec dword [0x1400be3b0]
xor al, al
jmp 0x1400164b8
mov rax, qword [rsp + 0x2d70]
mov r8d, dword [rsp + 0x2d78]
lea r9, str.Error_opening_the_file
mov rdx, rdi
mov rcx, rbp
mov qword [rsp + 0x20], rax
call fcn.140043cf0
lea rcx, [rsp + 0x50]
call fcn.1400166a0
dec dword [0x1400be3b0]
xor al, al
jmp 0x1400164a8
lea rdx, [rsp + 0x900]
lea rcx, [rsp + 0x50]
mov r8d, 0xfff
call fcn.140042890
mov sil, al
jmp 0x1400162ec
lea rdx, [rsp + 0x900]
lea rcx, [rsp + 0x50]
mov r8d, 0xfff
call fcn.1400509e0
mov sil, al
jmp 0x1400162ec
dec edi
sub rbx, 1
jns 0x14001638e
jmp 0x1400163b2
mov word [rsp + rbx*2 + 0x8fe], si
mov dil, 1
jmp 0x1400163f0
lea rdx, [rsp + 0x900]
mov rcx, rbp
call fcn.140043a40
nop
jmp 0x140016446
test eax, eax
je 0x140032b14
cmp eax, 2
je 0x14001642f
cmp eax, 4
jne 0x140016446
xor r15b, r15b
jmp 0x140016446
xor r14b, r14b
jmp 0x140016446
mov r12b, 1
jmp 0x140016453
mov r8d, dword [rsp + 0x30]
mov rdx, qword [rsp + 0x2d68]
lea rax, [rsp + 0x900]
lea r9, str.Unterminated_string
mov rcx, rbp
mov qword [rsp + 0x20], rax
call fcn.140043cf0
xor r14b, r14b
jmp 0x14001645d