// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/andQueryTest.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);

    do {
        string sought1, sought2;
        // stop if hit eof on input or a "q" is entered
        if (!get_words(sought1, sought2)) break;
    
        // find all the occurrences of the requested string
        Query andq = Query(sought1) & Query(sought2);
        cout << "\nExecuting query for: " << andq << endl;
        auto results = andq.eval(file);
        // report matches
        print(cout, results);
    
        results = Query(sought1).eval(file);
        cout << "\nExecuted query: " << Query(sought1) << endl;
        // report matches
        print(cout, results);
    
        results = Query(sought2).eval(file);
        cout << "\nExecuted query: " << Query(sought2) << endl;
        // report matches
        print(cout, results);
    } while(true);

    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 -0x108(%rbp), %rdi
callq 0x6088
leaq -0x88(%rbp), %rbx
leaq -0x68(%rbp), %r15
leaq -0x148(%rbp), %r14
leaq -0xc8(%rbp), %r12
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
andq $0x0, -0x80(%rbp)
xorl %ecx, %ecx
movb %cl, -0x78(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
andq $0x0, -0x60(%rbp)
movb %cl, -0x58(%rbp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x61b3
testb %al, %al
je 0x47dd
movq %r14, %rdi
movq %rbx, %rsi
callq 0x491e
movq %r12, %rdi
movq %r15, %rsi
callq 0x491e
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x48a4
leaq -0xc0(%rbp), %rdi
callq 0x3d18
leaq -0x140(%rbp), %rdi
callq 0x3d18
movq 0x696a(%rip), %rdi      # 0xafc8
leaq 0x2ac3(%rip), %rsi      # 0x7128
callq 0x31d0
movq %rax, %rdi
leaq -0x48(%rbp), %rsi
callq 0x496f
movq %rax, %rdi
callq 0x3100
movq -0x48(%rbp), %rsi
movq (%rsi), %rax
movq %r14, %rdi
leaq -0x108(%rbp), %rdx
callq *0x10(%rax)
movq 0x692f(%rip), %rdi      # 0xafc8
movq %r14, %rsi
callq 0x52eb
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
callq 0x491e
movq -0x38(%rbp), %rsi
movq (%rsi), %rax
movq %r12, %rdi
leaq -0x108(%rbp), %rdx
callq *0x10(%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x49c4
movq %r12, %rdi
callq 0x39c0
leaq -0x30(%rbp), %rdi
callq 0x3d18
movq 0x68e4(%rip), %rdi      # 0xafc8
leaq 0x2a54(%rip), %rsi      # 0x713f
callq 0x31d0
movq %rax, %r13
movq %r12, %rdi
movq %rbx, %rsi
callq 0x491e
movq %r13, %rdi
movq %r12, %rsi
callq 0x496f
movq %rax, %rdi
callq 0x3100
leaq -0xc0(%rbp), %rdi
callq 0x3d18
movq 0x68a4(%rip), %rdi      # 0xafc8
movq %r14, %rsi
callq 0x52eb
leaq -0x38(%rbp), %rdi
movq %r15, %rsi
callq 0x491e
movq -0x38(%rbp), %rsi
movq (%rsi), %rax
movq %r12, %rdi
leaq -0x108(%rbp), %rdx
callq *0x10(%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x49c4
movq %r12, %rdi
callq 0x39c0
leaq -0x30(%rbp), %rdi
callq 0x3d18
movq 0x6859(%rip), %rdi      # 0xafc8
leaq 0x29c9(%rip), %rsi      # 0x713f
callq 0x31d0
movq %rax, %r13
movq %r12, %rdi
movq %r15, %rsi
callq 0x491e
movq %r13, %rdi
movq %r12, %rsi
callq 0x496f
movq %rax, %rdi
callq 0x3100
leaq -0xc0(%rbp), %rdi
callq 0x3d18
movq 0x6819(%rip), %rdi      # 0xafc8
movq %r14, %rsi
callq 0x52eb
movq %r14, %rdi
callq 0x39c0
leaq -0x40(%rbp), %rdi
callq 0x3d18
movq %r15, %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x30e0
jmp 0x45e2
leaq -0x68(%rbp), %rdi
callq 0x30e0
leaq -0x88(%rbp), %rdi
callq 0x30e0
leaq -0x108(%rbp), %rdi
callq 0x49fc
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4829
jmp 0x4863
jmp 0x4863
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x3d18
jmp 0x483d
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
jmp 0x4857
jmp 0x4863
jmp 0x4863
jmp 0x485e
jmp 0x4846
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
jmp 0x4876
movq %rax, %rbx
jmp 0x487b
jmp 0x484d
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0x3d18
jmp 0x4866
movq %rax, %rbx
jmp 0x4872
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
callq 0x39c0
leaq -0x40(%rbp), %rdi
callq 0x3d18
leaq -0x68(%rbp), %rdi
callq 0x30e0
leaq -0x88(%rbp), %rdi
callq 0x30e0
leaq -0x108(%rbp), %rdi
callq 0x49fc
movq %rbx, %rdi
callq 0x32f0