// File: /workspace/github_cpp_makefile_star2_O3/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 0x6b38
leaq -0x58(%rbp), %r12
leaq -0x38(%rbp), %r14
leaq -0xc8(%rbp), %r13
movq %r12, -0x68(%rbp)
xorl %ecx, %ecx
movq %rcx, -0x60(%rbp)
movb %cl, -0x58(%rbp)
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq %rcx, -0x80(%rbp)
movb %cl, -0x78(%rbp)
movq %r14, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
movb %cl, -0x38(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x6c6f
movl %eax, %ebx
testb %al, %al
je 0x4dbc
movl $0x13, %edx
movq 0x6550(%rip), %rdi      # 0xafc8
leaq 0x26d1(%rip), %rsi      # 0x7150
callq 0x3220
movq 0x654d(%rip), %rdi      # 0xafd8
leaq -0x48(%rbp), %rsi
callq 0x3250
movl $0x28, %edi
callq 0x31d0
movq %rax, %r14
leaq 0x61c0(%rip), %rax      # 0xac68
movq %rax, (%r14)
leaq 0x8(%r14), %rdi
movq %r14, %rax
addq $0x18, %rax
movq %rax, 0x8(%r14)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
callq 0x4486
movq %r14, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
movq %r14, %rsi
callq 0x549c
movl $0x28, %edi
callq 0x31d0
movq %rax, %r14
leaq 0x6174(%rip), %rax      # 0xac68
movq %rax, (%r14)
leaq 0x8(%r14), %rdi
movq %r14, %rax
addq $0x18, %rax
movq %rax, 0x8(%r14)
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
addq %rsi, %rdx
callq 0x4486
movq %r14, -0xe8(%rbp)
leaq -0xe0(%rbp), %rdi
movq %r14, %rsi
callq 0x549c
movl $0x48, %edi
callq 0x31d0
movq %rax, %r14
movq %rax, %rdi
leaq -0xf8(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
callq 0x528e
movq %r14, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
movq %r14, %rsi
callq 0x532e
movq -0xc8(%rbp), %rax
movq -0xc0(%rbp), %rdi
movq %rax, -0x108(%rbp)
movq %rdi, -0x100(%rbp)
testq %rdi, %rdi
je 0x4baf
movq 0x6430(%rip), %rax      # 0xafc0
cmpb $0x0, (%rax)
je 0x4b9a
incl 0x8(%rdi)
jmp 0x4baa
lock
incl 0x8(%rdi)
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x4baf
callq 0x441a
movl $0x28, %edi
callq 0x31d0
movq %rax, %r14
leaq 0x60a5(%rip), %rax      # 0xac68
movq %rax, (%r14)
leaq 0x8(%r14), %rdi
movq %r14, %rax
addq $0x18, %rax
movq %rax, 0x8(%r14)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x4486
movq %r14, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
movq %r14, %rsi
callq 0x549c
movl $0x48, %edi
callq 0x31d0
movq %rax, %r14
movq %rax, %rdi
leaq -0x108(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
callq 0x4fee
movq %r14, -0xc8(%rbp)
leaq -0xc0(%rbp), %rdi
movq %r14, %rsi
callq 0x51da
movq -0xc8(%rbp), %r12
movq -0xc0(%rbp), %r15
testq %r15, %r15
je 0x4c72
movq 0x6372(%rip), %rax      # 0xafc0
cmpb $0x0, (%rax)
je 0x4c5c
incl 0x8(%r15)
movq %r15, %rdi
jmp 0x4c6d
lock
incl 0x8(%r15)
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x4c72
callq 0x441a
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x4c83
callq 0x441a
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x4c94
callq 0x441a
movq -0xe0(%rbp), %rdi
testq %rdi, %rdi
je 0x4ca5
callq 0x441a
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x4cb6
callq 0x441a
movl $0x16, %edx
movq 0x6306(%rip), %rdi      # 0xafc8
leaq 0x249b(%rip), %rsi      # 0x7164
callq 0x3220
movq (%r12), %rax
movq %r13, %rdi
movq %r12, %rsi
callq *0x18(%rax)
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
movq 0x62d8(%rip), %rdi      # 0xafc8
callq 0x3220
movq %rax, %r14
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x4d1a
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31c0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
movq (%r12), %rax
movq %r13, %r14
movq %r13, %rdi
movq %r12, %rsi
leaq -0x148(%rbp), %rdx
callq *0x10(%rax)
movq 0x6269(%rip), %rdi      # 0xafc8
movq %r14, %rsi
leaq -0x58(%rbp), %r12
callq 0x5c90
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x4d7c
callq 0x441a
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x4d8d
callq 0x441a
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x4daf
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31e0
testq %r15, %r15
je 0x4dbc
movq %r15, %rdi
callq 0x441a
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %r14
cmpq %r14, %rdi
je 0x4dd5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31e0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x4df1
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31e0
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x4e06
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31e0
testb %bl, %bl
jne 0x4a28
leaq -0x138(%rbp), %rbx
movq %rbx, %rdi
callq 0x5556
movq -0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x4e2b
callq 0x441a
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
callq 0x31e0
jmp 0x4eeb
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
callq 0x31e0
jmp 0x4f0f
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rax
cmpq %rax, %rdi
je 0x4f54
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31e0
jmp 0x4f54
jmp 0x4f51
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
callq 0x31e0
jmp 0x4f65
movq %rax, %rbx
movl $0x48, %esi
movq %r14, %rdi
callq 0x31e0
jmp 0x4f24
movq %rax, %rbx
movl $0x48, %esi
movq %r14, %rdi
callq 0x31e0
jmp 0x4efe
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x3cc8
jmp 0x4f54
jmp 0x4f4c
movq %rax, %rbx
leaq -0x38(%rbp), %r13
jmp 0x4f39
movq %rax, %rbx
jmp 0x4f24
movq %rax, %rbx
jmp 0x4f0f
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x4f0f
callq 0x441a
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x4f20
callq 0x441a
leaq -0x58(%rbp), %r12
leaq -0x38(%rbp), %r13
movq -0xe0(%rbp), %rdi
testq %rdi, %rdi
je 0x4f39
callq 0x441a
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x4f69
callq 0x441a
jmp 0x4f69
movq %rax, %rbx
jmp 0x4f65
movq %rax, %rbx
testq %r15, %r15
je 0x4f61
movq %r15, %rdi
callq 0x441a
leaq -0x58(%rbp), %r12
leaq -0x38(%rbp), %r13
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x4f7e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31e0
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x4f9a
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31e0
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x4faf
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31e0
leaq -0x148(%rbp), %rdi
callq 0x4fc4
movq %rbx, %rdi
callq 0x32e0
nop