// File: 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
subq $0x230, %rsp            # imm = 0x230
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0xc020
leaq -0x70(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x32e0
leaq -0x90(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x32e0
movq -0x1e8(%rbp), %rdi
movq -0x1e0(%rbp), %rsi
callq 0xc1f0
movb %al, -0x1d1(%rbp)
jmp 0x72c7
movb -0x1d1(%rbp), %al
testb $0x1, %al
jne 0x72f9
jmp 0x72d3
movl $0x2, -0xa0(%rbp)
jmp 0x75b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x770c
leaq -0xc0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x77f0
jmp 0x730b
leaq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x77f0
jmp 0x7320
leaq -0xb0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0x7740
jmp 0x733c
leaq -0xd0(%rbp), %rdi
callq 0x4cd0
leaq -0xc0(%rbp), %rdi
callq 0x4cd0
movq 0xcc6d(%rip), %rdi      # 0x13fc8
leaq 0x5dc6(%rip), %rsi      # 0xd128
callq 0x3220
movq %rax, -0x1f0(%rbp)
jmp 0x7370
movq -0x1f0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x7860
movq %rax, -0x1f8(%rbp)
jmp 0x738c
movq -0x1f8(%rbp), %rdi
movq 0xcc0e(%rip), %rsi      # 0x13fa8
callq 0x3260
jmp 0x73a1
leaq -0x110(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x3e80
jmp 0x73ba
movq 0xcc07(%rip), %rdi      # 0x13fc8
leaq -0x110(%rbp), %rsi
callq 0x8f90
jmp 0x73cf
leaq -0x160(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x77f0
jmp 0x73e1
leaq -0x150(%rbp), %rdi
leaq -0x160(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x3e80
jmp 0x73fa
leaq -0x110(%rbp), %rdi
leaq -0x150(%rbp), %rsi
movq %rsi, -0x208(%rbp)
callq 0x78d0
movq -0x208(%rbp), %rdi
callq 0x4210
leaq -0x160(%rbp), %rdi
callq 0x4cd0
movq 0xcb95(%rip), %rdi      # 0x13fc8
leaq 0x5d05(%rip), %rsi      # 0xd13f
callq 0x3220
movq %rax, -0x200(%rbp)
jmp 0x7448
leaq -0x170(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x77f0
jmp 0x745a
movq -0x200(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x7860
movq %rax, -0x210(%rbp)
jmp 0x7476
movq -0x210(%rbp), %rdi
movq 0xcb24(%rip), %rsi      # 0x13fa8
callq 0x3260
jmp 0x748b
leaq -0x170(%rbp), %rdi
callq 0x4cd0
movq 0xcb2a(%rip), %rdi      # 0x13fc8
leaq -0x110(%rbp), %rsi
callq 0x8f90
jmp 0x74ac
leaq -0x1c0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x77f0
jmp 0x74c1
leaq -0x1b0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x3e80
jmp 0x74da
leaq -0x110(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
movq %rsi, -0x220(%rbp)
callq 0x78d0
movq -0x220(%rbp), %rdi
callq 0x4210
leaq -0x1c0(%rbp), %rdi
callq 0x4cd0
movq 0xcab5(%rip), %rdi      # 0x13fc8
leaq 0x5c25(%rip), %rsi      # 0xd13f
callq 0x3220
movq %rax, -0x218(%rbp)
jmp 0x7528
leaq -0x1d0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x77f0
jmp 0x753d
movq -0x218(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x7860
movq %rax, -0x228(%rbp)
jmp 0x7559
movq -0x228(%rbp), %rdi
movq 0xca41(%rip), %rsi      # 0x13fa8
callq 0x3260
jmp 0x756e
leaq -0x1d0(%rbp), %rdi
callq 0x4cd0
movq 0xca47(%rip), %rdi      # 0x13fc8
leaq -0x110(%rbp), %rsi
callq 0x8f90
jmp 0x758f
leaq -0x110(%rbp), %rdi
callq 0x4210
leaq -0xb0(%rbp), %rdi
callq 0x4cd0
movl $0x0, -0xa0(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3160
leaq -0x70(%rbp), %rdi
callq 0x3160
movl -0xa0(%rbp), %eax
testl %eax, %eax
je 0x75d4
jmp 0x75d2
jmp 0x75e2
jmp 0x75d6
movb $0x1, %al
testb $0x1, %al
jne 0x7289
jmp 0x75e2
movl $0x0, -0x4(%rbp)
movl $0x1, -0xa0(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x7930
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x763a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x4cd0
leaq -0xc0(%rbp), %rdi
callq 0x4cd0
jmp 0x770c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x7700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x76f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x4cd0
jmp 0x76f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x4cd0
jmp 0x76f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x4cd0
jmp 0x76f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x4cd0
leaq -0x110(%rbp), %rdi
callq 0x4210
leaq -0xb0(%rbp), %rdi
callq 0x4cd0
leaq -0x90(%rbp), %rdi
callq 0x3160
leaq -0x70(%rbp), %rdi
callq 0x3160
leaq -0x50(%rbp), %rdi
callq 0x7930
movq -0x98(%rbp), %rdi
callq 0x3370
nopw %cs:(%rax,%rax)