// File: /workspace/github_cpp_makefile_star2_O3/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, -0x68(%rbp)
movq %rsi, %r12
xorps %xmm0, %xmm0
leaq -0x80(%rbp), %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq %rdi, -0x38(%rbp)
movq (%rdi), %rdi
movq %r14, %rsi
movl $0x30, %edx
callq 0x4440
movq 0x8(%r14), %rbx
cmpq $0x0, (%r14)
setne %r13b
jne 0x4aa3
movq 0x9612(%rip), %r14      # 0xdff0
testl %r15d, %r15d
je 0x4a47
leaq 0x565a(%rip), %rsi      # 0xa044
movl $0xc, %edx
movq %r14, %rdi
callq 0x4300
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r14, %rdi
callq 0x4300
movq %rax, %r14
leaq 0x563f(%rip), %rsi      # 0xa051
movl $0x1, %edx
movq %rax, %rdi
callq 0x4300
movq %r14, %rdi
movl %r15d, %esi
callq 0x4470
movq %rax, %r14
leaq 0x56c9(%rip), %rsi      # 0xa0fd
movl $0x4, %edx
movq %rax, %rdi
callq 0x4300
movq -0x40(%rbp), %rax
jmp 0x4a5f
leaq 0x55e7(%rip), %rsi      # 0xa035
movl $0xe, %edx
movq %r14, %rdi
callq 0x4300
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, %rdi
callq 0x4300
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x41e0
cmpq $0x0, -0x80(%rbp)
je 0x4c7e
movl %r13d, -0x2c(%rbp)
movl %r15d, -0x30(%rbp)
xorl %r14d, %r14d
leaq -0xa0(%rbp), %r13
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x60(%rbp), %r15
movq %r15, %rdi
callq 0x7542
movq (%rbx,%r14,8), %rax
cmpb $0x23, (%rax)
je 0x4c4e
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x43e0
cmpl $0x3, -0xa0(%rbp)
je 0x4b34
movq %r13, %r15
movq %r13, %rdi
movq %r12, %rsi
callq 0x4500
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
callq 0x4350
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x4b34
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x42d0
movq (%rbx,%r14,8), %rdi
leaq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdx
callq 0x4766
testl %eax, %eax
je 0x4be9
cmpl $0x0, -0x30(%rbp)
je 0x4bee
movl $0xe, %edx
movq 0x948d(%rip), %rdi      # 0xdff0
leaq 0x54e9(%rip), %rsi      # 0xa053
callq 0x4300
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x9471(%rip), %rdi      # 0xdff0
callq 0x4300
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x54bb(%rip), %rsi      # 0xa051
callq 0x4300
movq %r15, %rdi
movl -0x30(%rbp), %esi
callq 0x4470
movq %rax, %r15
movl $0x4, %edx
movq %rax, %rdi
leaq 0x5545(%rip), %rsi      # 0xa0fd
callq 0x4300
movq -0x40(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r15, %rdi
callq 0x4300
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x42a0
jmp 0x4c34
movb $0x1, %r15b
jmp 0x4c51
movl $0xe, %edx
movq 0x93f6(%rip), %rdi      # 0xdff0
leaq 0x5434(%rip), %rsi      # 0xa035
callq 0x4300
movq -0x38(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x93d8(%rip), %rdi      # 0xdff0
callq 0x4300
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x41e0
movl $0x0, -0x2c(%rbp)
xorl %r15d, %r15d
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x4c6a
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x42d0
testb %r15b, %r15b
je 0x4c85
incq %r14
cmpq -0x80(%rbp), %r14
jb 0x4ab5
jmp 0x4c85
movl $0x0, -0x2c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x4290
movl -0x2c(%rbp), %eax
andb $0x1, %al
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4ca4
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x4cc0
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x42d0
movq %rbx, %rdi
callq 0x44a0