// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/and_orQueryTest.cc
// Function: main
int main(int argc, char **argv)
{
    // gets file to read and builds map to support queries
    TextQuery file = get_file(argc, argv);

    // iterate with the user: prompt for a word to find and print results
    while (true) {
        string sought1, sought2, sought3;
        if (!get_words(sought1, sought2)) break;
        cout << "\nenter third word: " ;
        cin  >> sought3;
        // find all the occurrences of the requested string
        Query q = Query(sought1) & Query(sought2) 
                             | Query(sought3);
        cout << "\nExecuting Query for: " << q << endl;
        const auto results = q.eval(file);
        // report matches
		print(cout, results);
     } 
     return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, %rdx
movl %edi, %esi
leaq -0x148(%rbp), %rdi
callq 0x6118
leaq -0xa8(%rbp), %rdi
leaq -0x88(%rbp), %r15
leaq -0x68(%rbp), %rbx
leaq -0x108(%rbp), %r13
leaq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
andq $0x0, -0xa0(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
andq $0x0, -0x80(%rbp)
xorl %ecx, %ecx
movb %cl, -0x98(%rbp)
movb %cl, -0x78(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
andq $0x0, -0x60(%rbp)
movb %cl, -0x58(%rbp)
movq %rdi, %r12
movq %r15, %rsi
callq 0x6243
testb %al, %al
je 0x474e
movq 0x698b(%rip), %rdi      # 0xafc8
leaq 0x2ae4(%rip), %rsi      # 0x7128
callq 0x31d0
movq 0x6988(%rip), %rdi      # 0xafd8
movq %rbx, %rsi
callq 0x3240
leaq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0x491a
leaq -0xc8(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x491a
movq %r13, %rdi
leaq -0x48(%rbp), %rsi
movq %r14, %rdx
callq 0x48a0
leaq -0xb8(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x491a
leaq -0x38(%rbp), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x4826
leaq -0xb0(%rbp), %rdi
callq 0x3d18
leaq -0x100(%rbp), %rdi
callq 0x3d18
leaq -0xc0(%rbp), %rdi
callq 0x3d18
leaq -0x40(%rbp), %rdi
callq 0x3d18
movq 0x68ee(%rip), %rdi      # 0xafc8
leaq 0x2a5b(%rip), %rsi      # 0x713c
callq 0x31d0
movq %rax, %rdi
leaq -0x38(%rbp), %rsi
callq 0x496b
movq %rax, %rdi
callq 0x3100
movq -0x38(%rbp), %rsi
movq (%rsi), %rax
movq %r13, %rdi
leaq -0x148(%rbp), %rdx
callq *0x10(%rax)
movq 0x68b3(%rip), %rdi      # 0xafc8
movq %r13, %rsi
callq 0x537b
movq %r13, %rdi
callq 0x39c0
leaq -0x30(%rbp), %rdi
callq 0x3d18
movq %rbx, %rdi
callq 0x30e0
movq %r15, %rdi
callq 0x30e0
movq %r12, %rdi
callq 0x30e0
movq %r12, %rdi
jmp 0x45e2
leaq -0x68(%rbp), %rdi
callq 0x30e0
leaq -0x88(%rbp), %rdi
callq 0x30e0
leaq -0xa8(%rbp), %rdi
callq 0x30e0
leaq -0x148(%rbp), %rdi
callq 0x49c0
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x47da
jmp 0x47ee
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x39c0
jmp 0x47e3
jmp 0x47e0
movq %rax, %rbx
jmp 0x47ce
movq %rax, %rbx
jmp 0x47c2
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x3d18
leaq -0x100(%rbp), %rdi
callq 0x3d18
leaq -0xc0(%rbp), %rdi
callq 0x3d18
leaq -0x40(%rbp), %rdi
jmp 0x47e7
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3d18
jmp 0x47f1
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x30e0
leaq -0x88(%rbp), %rdi
callq 0x30e0
leaq -0xa8(%rbp), %rdi
callq 0x30e0
leaq -0x148(%rbp), %rdi
callq 0x49c0
movq %rbx, %rdi
callq 0x32f0