// File: /workspace/github_cpp_makefile_star2_O1/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 0x494e
movq -0x30(%rbp), %rdi
movq -0xe0(%rbp), %rdx
movq 0x18(%rdx), %rsi
addq $0x8, %rdx
callq 0x4a20
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 0x3b19
movq 0x64b5(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x3b15
incl 0x8(%rax)
jmp 0x3b19
lock
incl 0x8(%rax)
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rax, -0x38(%rbp)
testq %rax, %rax
je 0x3b43
movq 0x648b(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x3b3f
incl 0x8(%rax)
jmp 0x3b43
lock
incl 0x8(%rax)
leaq -0x70(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x40(%rbp), %rcx
movq %rbx, %rdi
callq 0x3ca0
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x3b65
callq 0x447c
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x3b73
callq 0x447c
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b8c
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31e0
movq -0x28(%rbp), %rdi
testq %rdi, %rdi
je 0x3b9a
callq 0x447c
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x3ba8
callq 0x447c
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x3bb9
callq 0x447c
leaq -0xa0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3bd8
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x31e0
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x3be9
callq 0x447c
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x3bfa
callq 0x447c
leaq -0xf0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c19
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 0x3c3b
callq 0x447c
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x3c49
callq 0x447c
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c71
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x31e0
jmp 0x3c71
movq %rax, %rbx
jmp 0x3c7f
movq %rax, %rbx
jmp 0x3c8b
movq %rax, %rbx
movq -0x28(%rbp), %rdi
testq %rdi, %rdi
je 0x3c7f
callq 0x447c
leaq -0xb0(%rbp), %rdi
callq 0x3d2a
leaq -0x100(%rbp), %rdi
callq 0x3d2a
movq %rbx, %rdi
callq 0x32e0
nop