// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rsi), %rsi
movq (%rsi), %rax
leaq -0x100(%rbp), %rdi
callq *0x10(%rax)
movq 0x8(%r14), %rsi
movq (%rsi), %rax
leaq -0xb0(%rbp), %rdi
movq %r15, %rdx
callq *0x10(%rax)
movq -0x90(%rbp), %rax
movq 0x18(%rax), %rdx
leaq -0xc0(%rbp), %rcx
movq %rdx, (%rcx)
addq $0x8, %rax
leaq -0xb8(%rbp), %r8
movq %rax, (%r8)
leaq -0x28(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x30(%rbp), %rsi
leaq -0x19(%rbp), %rdx
callq 0x48ce
movq -0x30(%rbp), %rdi
movq -0xe0(%rbp), %rdx
movq 0x18(%rdx), %rsi
addq $0x8, %rdx
callq 0x499a
movq (%r14), %rax
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
callq *0x18(%rax)
movq -0x30(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0x3ab7
movq 0x6517(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x3ab3
incl 0x8(%rax)
jmp 0x3ab7
lock
incl 0x8(%rax)
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rax, -0x38(%rbp)
testq %rax, %rax
je 0x3ae1
movq 0x64ed(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x3add
incl 0x8(%rax)
jmp 0x3ae1
lock
incl 0x8(%rax)
leaq -0x70(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
callq 0x3c3e
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x3b03
callq 0x441a
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x3b11
callq 0x441a
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b2a
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31e0
movq -0x28(%rbp), %rdi
testq %rdi, %rdi
je 0x3b38
callq 0x441a
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x3b46
callq 0x441a
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x3b57
callq 0x441a
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b76
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x31e0
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x3b87
callq 0x441a
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x3b98
callq 0x441a
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bb7
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x31e0
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x3bd9
callq 0x441a
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x3be7
callq 0x441a
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c0f
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31e0
jmp 0x3c0f
movq %rax, %rbx
jmp 0x3c1d
movq %rax, %rbx
jmp 0x3c29
movq %rax, %rbx
movq -0x28(%rbp), %rdi
testq %rdi, %rdi
je 0x3c1d
callq 0x441a
leaq -0xb0(%rbp), %rdi
callq 0x3cc8
leaq -0x100(%rbp), %rdi
callq 0x3cc8
movq %rbx, %rdi
callq 0x32e0
nop