// File: /workspace/github_cpp_makefile_star2_O2/Nallantli[P]Rossa/main/rossa/global/global.cpp
// Function: dir::findFile(std::filesystem::__cxx11::path const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, token_t const*)
const std::filesystem::path dir::findFile(const std::filesystem::path &currentDir, const std::string &filename, const token_t *token)
{
	auto currentDirCheck = currentDir / filename;
	if (std::filesystem::exists(currentDirCheck))
		return currentDirCheck;
	auto libDirCheck = util::getRuntimePath().parent_path() / "lib" / filename;
	if (std::filesystem::exists(libDirCheck))
		return libDirCheck;
	trace_t stack_trace;
	throw rossa_error_t(util::format(_FILE_NOT_FOUND_, {filename}), *token, stack_trace);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x8(%rsp), %r13
pushq $0x2
popq %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x1cbea
leaq 0xd0(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1c9b7
leaq 0x8(%rsp), %rdi
callq 0x1ca5c
leaq 0xd0(%rsp), %rdi
callq 0x4cd33
testb %al, %al
je 0x4bb17
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
callq 0x22366
jmp 0x4bbca
leaq 0x80(%rsp), %rdi
callq 0x3fa00
leaq 0xa8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x10750
leaq 0x2cd3c(%rip), %rsi     # 0x7887c
leaq 0x30(%rsp), %rdi
pushq $0x2
popq %rdx
callq 0x4cd4e
leaq 0x8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x1c9b7
leaq 0x58(%rsp), %rdi
pushq $0x2
popq %rdx
movq %r15, %rsi
callq 0x1cbea
leaq 0x8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
movq %rbx, %rdi
callq 0x1c9b7
leaq 0x58(%rsp), %rdi
callq 0x1ca5c
leaq 0x8(%rsp), %rdi
callq 0x1ca5c
leaq 0x30(%rsp), %rdi
callq 0x1ca5c
leaq 0xa8(%rsp), %rdi
callq 0x1ca5c
leaq 0x80(%rsp), %rdi
callq 0x1ca5c
movq %rbx, %rdi
callq 0x4cd33
testb %al, %al
je 0x4bbec
leaq 0xd0(%rsp), %rdi
callq 0x1ca5c
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movl $0xa8, %edi
callq 0x101f0
movq %rax, %r12
leaq 0x2cc72(%rip), %rsi     # 0x78880
leaq 0xa8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1c814
leaq 0x80(%rsp), %rdi
movq %r15, %rsi
callq 0x10550
leaq 0x58(%rsp), %rdi
leaq 0x80(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x6(%rsp), %rcx
callq 0x1f298
leaq 0x8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x3f724
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
leaq 0x30(%rsp), %rcx
movq %r12, %rdi
movq %r14, %rdx
callq 0x3ebb8
xorl %ebp, %ebp
leaq 0x6601e(%rip), %rsi     # 0xb1ca0
leaq -0x1c817(%rip), %rdx    # 0x2f472
movq %r12, %rdi
callq 0x106c0
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x101d0
jmp 0x4bca6
movq %rax, %r14
movb $0x1, %bpl
leaq 0x58(%rsp), %rdi
callq 0x1cea0
jmp 0x4bcb8
movq %rax, %r14
movb $0x1, %bpl
leaq 0x80(%rsp), %rdi
callq 0x101d0
jmp 0x4bccd
movq %rax, %r14
movb $0x1, %bpl
leaq 0xa8(%rsp), %rdi
callq 0x101d0
testb %bpl, %bpl
jne 0x4bce4
jmp 0x4bcec
movq %rax, %r14
movq %r12, %rdi
callq 0x102e0
leaq 0x30(%rsp), %rdi
callq 0x1cb1a
jmp 0x4bcfb
movq %rax, %r14
movq %rbx, %rdi
jmp 0x4bd4a
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x1ca5c
jmp 0x4bd12
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x1ca5c
jmp 0x4bd21
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x1ca5c
jmp 0x4bd30
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0x1ca5c
jmp 0x4bd42
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x1ca5c
jmp 0x4bd56
jmp 0x4bd53
movq %rax, %r14
leaq 0xd0(%rsp), %rdi
callq 0x1ca5c
movq %r14, %rdi
callq 0x106f0
movq %rax, %r14
leaq 0x8(%rsp), %rdi
jmp 0x4bd5e