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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x2cc4
call fcn.00454dd0
inc dword [0x48b8b8]
cmp dword [0x48b8b8], 0x30
push ebx
push esi
push edi
mov dword [esp + 0x18], ecx
jl 0x4089d3
push dword [ebp + 0x14]
push str.include_depth_exceeded.__Make_sure_there_are_no_recursive_includes
push dword [ebp + 0x18]
push dword [ebp + 0x10]
push ecx
call fcn.00408006
dec dword [0x48b8b8]
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x14
and dword [esp + 0x14], 0
and dword [esp + 0x2c], 0
lea esi, [esp + 0x28]
mov byte [esp + 0x11], 1
mov byte [esp + 0x12], 1
xor bl, bl
call fcn.0040d1b5
push dword [ebp + 8]
mov eax, 0x2000
mov ecx, esi
call fcn.0040cfe3
test al, al
jne 0x408a2f
push dword [ebp + 0x14]
push str.Error_opening_the_file
push dword [ebp + 0x18]
push dword [ebp + 0x10]
push dword [esp + 0x28]
call fcn.00408006
lea esi, [esp + 0x28]
call fcn.0040d1b5
dec dword [0x48b8b8]
mov al, bl
jmp 0x4089ca
lea eax, [esp + 0x6b0]
push eax
mov esi, 0x104
push esi
call dword [sym.imp.KERNEL32.DLL_GetCurrentDirectoryW]
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x29c]
push eax
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.DLL_GetFullPathNameW]
lea eax, [esp + 0xac8]
push eax
lea eax, [esp + 0x8c4]
push eax
lea eax, [esp + 0x4b0]
push eax
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x2a8]
push eax
call fcn.0045237c
add esp, 0x14
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x8c]
push eax
call fcn.0044f86d
lea eax, [esp + 0x4b0]
push eax
lea eax, [esp + 0x94]
push eax
call fcn.0044f843
add esp, 0x10
lea eax, [esp + 0x88]
push eax
call dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryW]
cmp byte [esp + 0x12], 1
jne 0x408bf2
lea eax, [esp + 0xcd0]
push eax
mov eax, 0xfff
lea ecx, [esp + 0x2c]
call fcn.0040d4e1
test al, al
je 0x408bf2
inc dword [esp + 0x14]
lea esi, [esp + 0xcd0]
call fcn.00408677
mov eax, esi
call fcn.004086aa
test al, al
je 0x408bd0
mov edi, esi
call fcn.0040864a
mov eax, esi
push eax
mov byte [esp + 0x17], 0
call fcn.0045177a
mov esi, eax
cmp esi, 2
pop ecx
jle 0x408b4f
movzx eax, byte [esp + esi*2 + 0xccc]
and eax, 0x7f
push eax
call fcn.004519a6
test eax, eax
pop ecx
je 0x408b4f
lea eax, [esp + esi*2 + 0xcce]
cmp word [eax], 0x5f
jne 0x408b4f
and word [eax], 0
mov byte [esp + 0x13], 1
cmp bl, 1
mov esi, dword [esp + 0x18]
jne 0x408b67
lea eax, [esp + 0xcd0]
push eax
call fcn.004082ec
jmp 0x408bbb
lea eax, [esp + 0x28]
push eax
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x2a0]
push eax
push esi
lea ecx, [esp + 0xce0]
call fcn.00408c12
test eax, eax
je 0x408bb6
cmp eax, 1
jle 0x408bbb
cmp eax, 3
jle 0x408ba0
cmp eax, 4
jne 0x408bbb
mov byte [esp + 0x12], 0
jmp 0x408bbb
push dword [ebp + 0xc]
lea eax, [esp + 0xcd4]
push eax
push dword [esp + 0x1c]
call fcn.0040827f
jmp 0x408bbb
mov byte [esp + 0x11], 0
cmp byte [esp + 0x13], 1
sete bl
cmp byte [esp + 0x11], 1
je 0x408abf
jmp 0x408bf2
lea eax, [esp + 0xcd0]
push eax
push str.Unterminated_string
push dword [esp + 0x1c]
push dword [ebp + 0x10]
push dword [esp + 0x28]
call fcn.00408006
mov byte [esp + 0x11], 0
lea esi, [esp + 0x28]
call fcn.0040d1b5
lea eax, [esp + 0x6b0]
push eax
call dword [sym.imp.KERNEL32.DLL_SetCurrentDirectoryW]
mov bl, byte [esp + 0x11]
jmp 0x408a1c