// File: iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/Query.cc
// Function: OrQuery::eval(TextQuery const&) const
QueryResult
OrQuery::eval(const TextQuery& text) const
{
    // virtual calls through the Query members, lhs and rhs 
	// the calls to eval return the QueryResult for each operand
    auto right = rhs.eval(text), left = lhs.eval(text);  

	// copy the line numbers from the left-hand operand into the result set
	auto ret_lines = 
	     make_shared<set<line_no>>(left.begin(), left.end());

	// insert lines from the right-hand operand
	ret_lines->insert(right.begin(), right.end());
	// return the new QueryResult representing the union of lhs and rhs
    return QueryResult(rep(), ret_lines, left.get_file());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x130(%rbp)
movq %rdi, %rax
movq %rax, -0x128(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x120(%rbp)
addq $0x18, %rsi
movq -0x18(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x3e80
movq -0x120(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rdx
leaq -0x98(%rbp), %rdi
callq 0x3e80
jmp 0x3c31
leaq -0x98(%rbp), %rdi
callq 0x3f40
movq %rax, -0x138(%rbp)
jmp 0x3c46
movq -0x138(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x3f70
movq %rax, -0x140(%rbp)
jmp 0x3c69
movq -0x140(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0x4380
jmp 0x3c93
leaq -0xb8(%rbp), %rdi
callq 0x4090
movq %rax, -0x150(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3f40
movq %rax, -0x148(%rbp)
jmp 0x3cb8
movq -0x148(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3f70
movq %rax, -0x158(%rbp)
jmp 0x3cd8
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
callq 0x4400
jmp 0x3d02
movq -0x120(%rbp), %rsi
movq (%rsi), %rax
movq 0x18(%rax), %rax
leaq -0xf8(%rbp), %rdi
callq *%rax
jmp 0x3d1b
leaq -0x108(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4160
leaq -0x118(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x3fa0
jmp 0x3d43
movq -0x130(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x108(%rbp), %rdx
leaq -0x118(%rbp), %rcx
callq 0x4190
jmp 0x3d66
leaq -0x118(%rbp), %rdi
callq 0x4010
leaq -0x108(%rbp), %rdi
callq 0x41f0
leaq -0xf8(%rbp), %rdi
callq 0x3160
leaq -0xb8(%rbp), %rdi
callq 0x41f0
leaq -0x98(%rbp), %rdi
callq 0x4210
leaq -0x58(%rbp), %rdi
callq 0x4210
movq -0x128(%rbp), %rax
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x3e5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x3e50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x3e44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x3e2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x4010
leaq -0x108(%rbp), %rdi
callq 0x41f0
leaq -0xf8(%rbp), %rdi
callq 0x3160
leaq -0xb8(%rbp), %rdi
callq 0x41f0
leaq -0x98(%rbp), %rdi
callq 0x4210
leaq -0x58(%rbp), %rdi
callq 0x4210
movq -0xa0(%rbp), %rdi
callq 0x3370
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)