// File: /workspace/github_cpp_makefile_star2_O1/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, %r12
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rdx, %rsi
movl $0x2, %edx
callq 0x1d846
leaq 0xd0(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x1d675
leaq 0x8(%rsp), %rdi
callq 0x1d736
leaq 0xd0(%rsp), %rdi
callq 0x10190
testb %al, %al
je 0x56866
movzbl %al, %eax
cmpl $0xff, %eax
jne 0x569f6
leaq 0x30(%rsp), %rdi
callq 0x48c95
leaq 0x58(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x10760
leaq 0x2ffb6(%rip), %rsi     # 0x8683c
leaq 0x80(%rsp), %rdi
movl $0x2, %edx
callq 0x5801c
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x1d675
leaq 0xa8(%rsp), %rdi
movq %r12, %rsi
movl $0x2, %edx
callq 0x1d846
leaq 0x8(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
movq %rbx, %rdi
callq 0x1d675
leaq 0xa8(%rsp), %rdi
callq 0x1d736
leaq 0x8(%rsp), %rdi
callq 0x1d736
leaq 0x80(%rsp), %rdi
callq 0x1d736
leaq 0x58(%rsp), %rdi
callq 0x1d736
leaq 0x30(%rsp), %rdi
callq 0x1d736
movq %rbx, %rdi
callq 0x10190
testb %al, %al
je 0x5692b
movzbl %al, %eax
cmpl $0xff, %eax
jne 0x56a06
xorps %xmm0, %xmm0
movaps %xmm0, 0x80(%rsp)
movq $0x0, 0x90(%rsp)
movl $0xa8, %edi
callq 0x101e0
movq %rax, %r15
leaq 0x68(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x2fee1(%rip), %rsi     # 0x86840
leaq 0x2fef4(%rip), %rdx     # 0x8685a
leaq 0x58(%rsp), %rdi
callq 0x1e7ca
leaq 0x40(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0x1e014
leaq 0xa8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x7(%rsp), %rcx
movl $0x1, %edx
callq 0x20c5e
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x48694
movb $0x1, %r12b
leaq 0x8(%rsp), %rsi
leaq 0x80(%rsp), %rcx
movq %r15, %rdi
movq %r14, %rdx
callq 0x476dc
xorl %r12d, %r12d
leaq 0x5c2f9(%rip), %rsi     # 0xb2ce0
leaq -0x1f23a(%rip), %rdx    # 0x377b4
movq %r15, %rdi
callq 0x106d0
leaq 0xd0(%rsp), %rsi
movq %rbx, %rdi
callq 0x24770
leaq 0xd0(%rsp), %rdi
callq 0x1d736
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x56a4e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x56a4e
movq %rax, %r14
movb $0x1, %r12b
leaq 0xa8(%rsp), %rdi
callq 0x1dca2
jmp 0x56a63
movq %rax, %r14
movb $0x1, %r12b
movq 0x30(%rsp), %rdi
cmpq %rbp, %rdi
je 0x56a82
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x56a82
movq %rax, %r14
movb $0x1, %r12b
movq 0x58(%rsp), %rdi
cmpq %r13, %rdi
je 0x56aa1
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x103d0
jmp 0x56aa1
movq %rax, %r14
movb $0x1, %r12b
testb %r12b, %r12b
je 0x56aae
movq %r15, %rdi
callq 0x102d0
leaq 0x80(%rsp), %rdi
callq 0x1d77a
jmp 0x56ac0
movq %rax, %r14
movq %rbx, %rdi
jmp 0x56b0f
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0x1d736
jmp 0x56ada
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x1d736
jmp 0x56ae9
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x1d736
jmp 0x56afb
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x1d736
jmp 0x56b0a
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x1d736
jmp 0x56b1b
jmp 0x56b18
movq %rax, %r14
leaq 0xd0(%rsp), %rdi
callq 0x1d736
movq %r14, %rdi
callq 0x106f0
movq %rax, %r14
leaq 0x8(%rsp), %rdi
jmp 0x56b23