// File: /workspace/github_cpp_makefile_star2_O1/EDDRSoftware[P]libdefsEval/main.cpp
// Function: evaluate(boost::program_options::variables_map const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>*)
void evaluate(const variables_map &vm, const string &libdefs, std::vector<string> *pLibDefFiles)
{
    bool showAssigns    = vm.count("assigns");
    bool showComments   = vm.count("comments");
    bool showEmptyLines = vm.count("emptylines");
    path fp;

    try {
        if(parse(libdefs, current_path(), &fp)) {
            ifstream libdefsFile(fp.string().c_str());

            if(libdefsFile.is_open()) {
                int lineNum = 0;

                while(libdefsFile.good()) {
                    lineNum++;
                    string line;
                    getline(libdefsFile, line);

                    if(line.length()==0) {
                        if(showEmptyLines) {
                            cout << "EMPTY LINE: " << fp.string() << ":" <<
                                 lineNum << endl;
                        }

                        continue;
                    }

                    string action;
                    stringstream stream(line);
                    stream >> action;

                    if(action[0]=='#') {
                        if(showComments) {
                            cout << "COMMENT: " << line << endl;
                        }

                        continue;
                    }

                    if(action=="DEFINE") {
                        string var1, var2;
                        stream >> var1;
                        // var2 requires reading until EOL;
                        readUntilEOL(&stream, &var2);

                        if(var1[0]=='#' || var2[0]=='#') {
                            cerr << "INVALID LINE: " << fp.string() << ":" <<
                                 lineNum << " => " << line << endl;
                            continue;
                        }

                        if(var1.length()>0 && var2.length()>0) {
                            evaluateDefine(vm, var1, var2, fp, line, lineNum);
                        }
                    } else if(action=="INCLUDE") {
                        string var1;
                        // var1 requires reading until EOL
                        readUntilEOL(&stream, &var1);

                        if(var1[0]=='#') {
                            cerr << "INVALID LINE: " << fp.string() << ":" <<
                                 lineNum << " => " << line << endl;
                            continue;
                        }

                        if(var1.length()>0) {
                            evaluateInclude(vm, var1, fp, line, lineNum, pLibDefFiles);
                        }
                    } else if(action=="ASSIGN") {
                        if(showAssigns) {
                            cout << "ASSIGN: " << fp.string() << ":" << lineNum << " \"" << line << "\"" <<
                                 endl;
                        }
                    } else {
                        cerr << "INVALID LINE: " << fp.string() << ":" <<
                             lineNum << " => " << line << endl;
                    }
                }
            } else {
                cerr << "ERROR: Library path " << libdefs <<
                     " does not exist." << endl;
            }
        }
    } catch(...) {
        cerr << "ERROR: Library path " << fp << " does not exist." << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
movq %rdx, -0xe0(%rbp)
movq %rsi, %r14
movq %rdi, %r12
leaq -0x2f0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x44de(%rip), %rsi      # 0xa162
leaq 0x44de(%rip), %rdx      # 0xa169
leaq -0x300(%rbp), %rdi
callq 0x768c
leaq 0x10(%r12), %rbx
leaq -0x300(%rbp), %rsi
movq %rbx, %rdi
callq 0x7cc4
movq %rax, -0xe8(%rbp)
movq -0x300(%rbp), %rdi
cmpq %r15, %rdi
je 0x5ccd
movq -0x2f0(%rbp), %rsi
incq %rsi
callq 0x42d0
leaq -0x300(%rbp), %rdi
movq %r15, (%rdi)
leaq 0x448c(%rip), %rsi      # 0xa16a
leaq 0x448d(%rip), %rdx      # 0xa172
callq 0x768c
leaq -0x300(%rbp), %rsi
movq %rbx, %rdi
callq 0x7cc4
movq %rax, -0xf0(%rbp)
movq -0x300(%rbp), %rdi
cmpq %r15, %rdi
je 0x5d1b
movq -0x2f0(%rbp), %rsi
incq %rsi
callq 0x42d0
leaq -0x300(%rbp), %rdi
movq %r15, (%rdi)
leaq 0x4447(%rip), %rsi      # 0xa173
leaq 0x444a(%rip), %rdx      # 0xa17d
callq 0x768c
leaq -0x300(%rbp), %rsi
movq %rbx, %rdi
callq 0x7cc4
movq %rax, -0xf8(%rbp)
movq -0x300(%rbp), %rdi
cmpq %r15, %rdi
je 0x5d69
movq -0x2f0(%rbp), %rsi
incq %rsi
callq 0x42d0
movq %r12, -0xb0(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x300(%rbp), %rdi
xorl %esi, %esi
callq 0x42c0
leaq -0x478(%rbp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq -0x300(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0x488(%rbp), %rcx
movq %r14, %rdi
xorl %r8d, %r8d
callq 0x49a2
movl %eax, %ebx
movq -0x488(%rbp), %rdi
cmpq %r12, %rdi
je 0x5de8
movq -0x478(%rbp), %rsi
incq %rsi
callq 0x42d0
movq -0x300(%rbp), %rdi
cmpq %r15, %rdi
je 0x5e03
movq -0x2f0(%rbp), %rsi
incq %rsi
callq 0x42d0
testb %bl, %bl
je 0x6516
movq -0x88(%rbp), %rsi
leaq -0x300(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x44c0
leaq -0x288(%rbp), %rdi
callq 0x4070
testb %al, %al
je 0x64a1
movq -0x300(%rbp), %rax
movq -0x18(%rax), %rcx
cmpl $0x0, -0x2e0(%rbp,%rcx)
jne 0x650a
movq -0xb0(%rbp), %rcx
addq $0x18, %rcx
movq %rcx, -0xb8(%rbp)
addq $-0x18, %rax
leaq -0x58(%rbp), %r12
movl $0x1, %r15d
leaq -0x488(%rbp), %r14
movq %r12, -0x68(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
movq (%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %edx
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
callq 0x44e0
cmpq $0x0, -0x60(%rbp)
je 0x5f60
leaq -0xc8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq $0x0, -0xd0(%rbp)
movb $0x0, -0xc8(%rbp)
movq %r14, %rdi
leaq -0x68(%rbp), %rsi
movl $0x18, %edx
callq 0x4420
movq %r14, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4370
movq -0xd8(%rbp), %rax
cmpb $0x23, (%rax)
jne 0x5ff4
movq -0xb8(%rbp), %rax
cmpq %rax, -0xf0(%rbp)
je 0x63e7
movl $0x9, %edx
movq 0x80a4(%rip), %rdi      # 0xdfc8
leaq 0x4260(%rip), %rsi      # 0xa18b
callq 0x4300
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq 0x8089(%rip), %rdi      # 0xdfc8
callq 0x4300
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x42a0
jmp 0x638d
movq -0xb8(%rbp), %rax
cmpq %rax, -0xf8(%rbp)
je 0x6424
movl $0xc, %edx
movq 0x8048(%rip), %rdi      # 0xdfc8
leaq 0x41f7(%rip), %rsi      # 0xa17e
callq 0x4300
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq 0x802a(%rip), %rdi      # 0xdfc8
callq 0x4300
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x40b8(%rip), %rsi      # 0xa06d
callq 0x4300
movq %r13, %rdi
movl %r15d, %esi
callq 0x4470
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x41e0
jmp 0x6424
leaq -0xd8(%rbp), %r13
movq %r13, %rdi
leaq 0x4190(%rip), %rsi      # 0xa195
callq 0x40b0
testl %eax, %eax
je 0x60d4
movq %r13, %rdi
leaq 0x4180(%rip), %rsi      # 0xa19c
callq 0x40b0
testl %eax, %eax
je 0x6201
movq %r13, %rdi
leaq 0x4171(%rip), %rsi      # 0xa1a4
callq 0x40b0
testl %eax, %eax
je 0x62d5
movl $0xe, %edx
movq 0x7fa4(%rip), %rdi      # 0xdff0
leaq 0x401c(%rip), %rsi      # 0xa06f
callq 0x4300
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq 0x7f86(%rip), %rdi      # 0xdff0
callq 0x4300
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3fec(%rip), %rsi      # 0xa06d
callq 0x4300
movq %r13, %rdi
movl %r15d, %esi
callq 0x4470
movq %rax, %r13
movl $0x4, %edx
movq %rax, %rdi
leaq 0x4076(%rip), %rsi      # 0xa119
callq 0x4300
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r13, %rdi
callq 0x4300
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x42a0
jmp 0x638d
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x40(%rbp)
movb %cl, -0x38(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq %rcx, -0xa0(%rbp)
movb %cl, -0x98(%rbp)
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x4370
movq %r14, %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4d01
movq -0x48(%rbp), %rax
cmpb $0x23, (%rax)
je 0x6134
movq -0xa8(%rbp), %rax
cmpb $0x23, (%rax)
jne 0x645e
movl $0xe, %edx
movq 0x7eb0(%rip), %rdi      # 0xdff0
leaq 0x3f28(%rip), %rsi      # 0xa06f
callq 0x4300
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq 0x7e92(%rip), %rdi      # 0xdff0
callq 0x4300
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3ef8(%rip), %rsi      # 0xa06d
callq 0x4300
movq %r13, %rdi
movl %r15d, %esi
callq 0x4470
movq %rax, %r13
movl $0x4, %edx
movq %rax, %rdi
leaq 0x3f82(%rip), %rsi      # 0xa119
callq 0x4300
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r13, %rdi
callq 0x4300
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x41e0
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x63ce
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x42d0
jmp 0x63ce
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
movq %r14, %rdi
leaq -0x48(%rbp), %rsi
callq 0x4d01
movq -0x48(%rbp), %rax
cmpb $0x23, (%rax)
jne 0x63a2
movl $0xe, %edx
movq 0x7db6(%rip), %rdi      # 0xdff0
leaq 0x3e2e(%rip), %rsi      # 0xa06f
callq 0x4300
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq 0x7d98(%rip), %rdi      # 0xdff0
callq 0x4300
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3dfe(%rip), %rsi      # 0xa06d
callq 0x4300
movq %r13, %rdi
movl %r15d, %esi
callq 0x4470
movq %rax, %r13
movl $0x4, %edx
movq %rax, %rdi
leaq 0x3e88(%rip), %rsi      # 0xa119
callq 0x4300
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r13, %rdi
callq 0x4300
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x41e0
jmp 0x63ce
movq -0xb8(%rbp), %rax
cmpq %rax, -0xe8(%rbp)
je 0x63e7
movl $0x8, %edx
movq 0x7cd3(%rip), %rdi      # 0xdfc8
leaq 0x3eaf(%rip), %rsi      # 0xa1ab
callq 0x4300
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq 0x7cb5(%rip), %rdi      # 0xdfc8
callq 0x4300
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3d43(%rip), %rsi      # 0xa06d
callq 0x4300
movq %r13, %rdi
movl %r15d, %esi
callq 0x4470
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0x3d58(%rip), %rsi      # 0xa0a4
callq 0x4300
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %r13, %rdi
callq 0x4300
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3d32(%rip), %rsi      # 0xa0a5
callq 0x4300
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x41e0
jmp 0x63e7
cmpq $0x0, -0x40(%rbp)
je 0x63ce
movq -0xb0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0x68(%rbp), %rcx
movl %r15d, %r8d
movq -0xe0(%rbp), %r9
callq 0x5905
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x63e7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x42d0
movq %r14, %rdi
movq 0x7ba7(%rip), %rsi      # 0xdf98
callq 0x4210
leaq -0x408(%rbp), %rdi
callq 0x40f0
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x6424
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x42d0
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x6439
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x42d0
movq -0x300(%rbp), %rax
movq -0x18(%rax), %rcx
addq $-0x18, %rax
incl %r15d
cmpl $0x0, -0x2e0(%rbp,%rcx)
je 0x5e7a
jmp 0x650a
cmpq $0x0, -0x40(%rbp)
je 0x61d6
cmpq $0x0, -0xa0(%rbp)
je 0x61d6
movq -0xb0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
leaq -0x88(%rbp), %rcx
leaq -0x68(%rbp), %r8
movl %r15d, %r9d
callq 0x4de2
jmp 0x61d6
movq 0x7b48(%rip), %rdi      # 0xdff0
leaq 0x3d05(%rip), %rsi      # 0xa1b4
movl $0x14, %edx
callq 0x4300
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0x7b29(%rip), %rdi      # 0xdff0
callq 0x4300
movq %rax, %rbx
leaq 0x3cf3(%rip), %rsi      # 0xa1c9
movl $0x10, %edx
movq %rax, %rdi
callq 0x4300
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x42a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x41e0
leaq -0x300(%rbp), %rdi
callq 0x4090
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x6532
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x42d0
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6588
movq %rax, %rbx
movq -0x488(%rbp), %rdi
cmpq %r12, %rdi
je 0x6564
movq -0x478(%rbp), %rsi
incq %rsi
callq 0x42d0
movq -0x300(%rbp), %rdi
cmpq %r15, %rdi
je 0x667f
movq -0x2f0(%rbp), %rsi
incq %rsi
callq 0x42d0
jmp 0x667f
movq %rax, %rbx
jmp 0x667f
jmp 0x6598
jmp 0x65b8
jmp 0x6598
jmp 0x65b8
movq %rax, %rbx
movq -0x300(%rbp), %rdi
cmpq %r15, %rdi
je 0x65bb
movq -0x2f0(%rbp), %rsi
incq %rsi
callq 0x42d0
jmp 0x65bb
movq %rax, %rbx
movq %rbx, %rdi
callq 0x44a0
movq %rax, %rbx
jmp 0x65fa
movq %rax, %rbx
jmp 0x6673
movq %rax, %rbx
jmp 0x6637
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0x65fa
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x42d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x6618
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x42d0
jmp 0x6618
movq %rax, %rbx
movq 0x7979(%rip), %rsi      # 0xdf98
leaq -0x488(%rbp), %rdi
callq 0x4210
leaq -0x408(%rbp), %rdi
callq 0x40f0
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x665e
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x42d0
jmp 0x665e
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x6673
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x42d0
leaq -0x300(%rbp), %rdi
callq 0x4090
movq %rbx, %rdi
callq 0x4120
movq 0x7962(%rip), %rdi      # 0xdff0
leaq 0x3b1f(%rip), %rsi      # 0xa1b4
movl $0x14, %edx
callq 0x4300
movq 0x794a(%rip), %rdi      # 0xdff0
leaq -0x88(%rbp), %rsi
callq 0x6de3
movq %rax, %rbx
leaq 0x3b0d(%rip), %rsi      # 0xa1c9
movl $0x10, %edx
movq %rax, %rdi
callq 0x4300
movq %rbx, %rdi
callq 0x4160
callq 0x4430
jmp 0x6516
movq %rax, %rbx
jmp 0x66e8
movq %rax, %rbx
callq 0x4430
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x65bb
movq -0x78(%rbp), %rsi
jmp 0x65ae
movq %rax, %rdi
callq 0x6dd5