// File: /workspace/github_cpp_makefile_star2_O2/EDDRSoftware[P]libdefsEval/main.cpp
// Function: parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, boost::filesystem::path const&, boost::filesystem::path*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
bool parse(const string &varIn, const path &pathIn, path *pathOut,
           const string &line = string(), int lineNum = 0)
{
    bool retVal = true;
    wordexp_t par;
    memset(&par, 0, sizeof(par));

    wordexp(varIn.c_str(), &par, WRDE_SHOWERR | WRDE_UNDEF);

    char **wp = par.we_wordv;

    if(par.we_wordc==0){
        if(lineNum==0) {
            cerr << "INVALID FILE: " << varIn << endl;
        } else {
            cerr << "ERROR LINE: " << pathIn.string() << ":" << lineNum << " => " << line << endl;
        }

        retVal = false;
    }

    for(size_t i = 0; i<par.we_wordc; ++i) {
        path current = pathIn;

        // check for comment at end of a line
        if (*(wp[i]) == '#') {
            break;
        }

        if(!is_directory(current)) {
            current = pathIn.parent_path();
        }

        if(fullPath(wp[i], current, pathOut)) {

            if(lineNum==0) {
                cerr << "INVALID FILE: " << varIn << endl;
            } else {
                cerr << "INVALID LINE: " << pathIn.string() << ":" << lineNum << " => " << line << endl;
            }

            retVal = false;
            break;
        }
    }

    wordfree(&par);
    return retVal;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %r8d, %r15d
movq %rcx, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
movq %rsi, %r12
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %r14
movaps %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %rdi, -0x38(%rbp)
movq (%rdi), %rdi
pushq $0x30
popq %rdx
movq %r14, %rsi
callq 0x4470
movq 0x8(%r14), %rbx
cmpq $0x0, (%r14)
setne %al
movl %eax, -0x2c(%rbp)
jne 0x494d
movq 0x9711(%rip), %rdi      # 0xdff0
testl %r15d, %r15d
je 0x492d
leaq 0x4759(%rip), %rsi      # 0x9044
callq 0x42d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x42a0
leaq 0x474f(%rip), %rsi      # 0x9051
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movl %r15d, %esi
callq 0x4490
leaq 0x47e1(%rip), %rsi      # 0x90fd
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movq -0x40(%rbp), %rsi
jmp 0x4940
leaq 0x4701(%rip), %rsi      # 0x9035
callq 0x42d0
movq %rax, %rdi
movq -0x38(%rbp), %rsi
callq 0x42a0
movq %rax, %rdi
callq 0x4170
movl %r15d, -0x30(%rbp)
xorl %r14d, %r14d
leaq -0xa0(%rbp), %r13
leaq -0x80(%rbp), %r15
cmpq -0x60(%rbp), %r14
jae 0x4a60
movq %r13, %rdi
movq %r12, %rsi
callq 0x43c0
movq (%rbx,%r14,8), %rax
cmpb $0x23, (%rax)
je 0x4a45
movq %r13, %rdi
callq 0x6009
testb %al, %al
jne 0x49ab
movq %r15, %rdi
movq %r12, %rsi
callq 0x4510
movq %r13, %rdi
movq %r15, %rsi
callq 0x4360
movq %r15, %rdi
callq 0x4150
movq (%rbx,%r14,8), %rdi
movq %r13, %rsi
movq -0x48(%rbp), %rdx
callq 0x470d
testl %eax, %eax
je 0x4a12
cmpl $0x0, -0x30(%rbp)
je 0x4a17
movq 0x9624(%rip), %rdi      # 0xdff0
leaq 0x4680(%rip), %rsi      # 0x9053
callq 0x42d0
movq %rax, %rdi
movq %r12, %rsi
callq 0x42a0
movq %rax, %rdi
leaq 0x4664(%rip), %rsi      # 0x9051
callq 0x42d0
movq %rax, %rdi
movl -0x30(%rbp), %esi
callq 0x4490
movq %rax, %rdi
leaq 0x46f6(%rip), %rsi      # 0x90fd
callq 0x42d0
movq -0x40(%rbp), %rsi
jmp 0x4a2e
movb $0x1, %r15b
jmp 0x4a48
movq 0x95d2(%rip), %rdi      # 0xdff0
leaq 0x4610(%rip), %rsi      # 0x9035
callq 0x42d0
movq -0x38(%rbp), %rsi
movq %rax, %rdi
callq 0x42a0
movq %rax, %rdi
callq 0x4170
movl $0x0, -0x2c(%rbp)
xorl %r15d, %r15d
movq %r13, %rdi
callq 0x4150
incq %r14
testb %r15b, %r15b
leaq -0x80(%rbp), %r15
jne 0x495f
leaq -0x60(%rbp), %rdi
callq 0x42c0
movl -0x2c(%rbp), %eax
andb $0x1, %al
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4a7f
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x4150
movq %rbx, %rdi
callq 0x44c0