// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH15_ObjectOrientedProgramming/examples/Query.cc
// Function: NotQuery::eval(TextQuery const&) const
QueryResult
NotQuery::eval(const TextQuery& text) const
{
    // virtual call to eval through the Query operand 
    auto result = query.eval(text);

	// start out with an empty result set
    auto ret_lines = make_shared<set<line_no>>();

	// we have to iterate through the lines on which our operand appears
	auto beg = result.begin(), end = result.end();

    // for each line in the input file, if that line is not in result,
    // add that line number to ret_lines
	auto sz = result.get_file()->size();
    for (size_t n = 0; n != sz; ++n) {
		// if we haven't processed all the lines in result
		// check whether this line is present
		if (beg == end || *beg != n) 
			ret_lines->insert(n);  // if not in result, add this line 
		else if (beg != end) 
			++beg; // otherwise get the next line number in result if there is one
	}
	return QueryResult(rep(), ret_lines, result.get_file());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
movq (%rsi), %rax
leaq -0xc8(%rbp), %rdi
callq *0x10(%rax)
movl $0x40, %edi
callq 0x31d0
movq %rax, %r12
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r12)
leaq 0x6686(%rip), %rax      # 0x9bf0
movq %rax, (%r12)
leaq 0x18(%r12), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
xorl %ecx, %ecx
movq %rcx, 0x20(%r12)
movq %rax, 0x28(%r12)
movq %rax, 0x30(%r12)
movq %r12, -0x38(%rbp)
movq %rcx, 0x38(%r12)
movq -0xa8(%rbp), %r15
movq -0x98(%rbp), %rax
movq 0x18(%r15), %r13
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
movq %rbx, -0x60(%rbp)
movq %r14, -0x68(%rbp)
je 0x35cd
movq 0x69fd(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x35d6
incl 0x8(%rdi)
jmp 0x35da
movq 0x8(%rax), %r14
subq (%rax), %r14
jmp 0x35e6
lock
incl 0x8(%rdi)
movq 0x8(%rax), %r14
subq (%rax), %r14
callq 0x441a
addq $0x10, %r12
movq $0x0, -0x30(%rbp)
testq %r14, %r14
je 0x3635
addq $0x8, %r15
sarq $0x5, %r14
xorl %ebx, %ebx
cmpq %r15, %r13
je 0x3619
cmpq %rbx, 0x20(%r13)
jne 0x3619
movq %r13, %rdi
callq 0x3230
movq %rax, %r13
jmp 0x3629
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
callq 0x4600
movq -0x30(%rbp), %rbx
incq %rbx
movq %rbx, -0x30(%rbp)
cmpq %r14, %rbx
jne 0x3601
movq -0x68(%rbp), %rsi
movq (%rsi), %rax
leaq -0x88(%rbp), %rdi
callq *0x18(%rax)
movq %r12, -0x58(%rbp)
movq -0x38(%rbp), %r14
movq %r14, -0x50(%rbp)
movq 0x6967(%rip), %rax      # 0x9fc0
cmpb $0x0, (%rax)
movq -0x60(%rbp), %rbx
je 0x3668
incl 0x8(%r14)
jmp 0x366d
lock
incl 0x8(%r14)
movq -0x98(%rbp), %rdx
movq -0x90(%rbp), %rcx
movq %rdx, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
testq %rcx, %rcx
je 0x3696
cmpb $0x0, (%rax)
je 0x3692
incl 0x8(%rcx)
jmp 0x3696
lock
incl 0x8(%rcx)
leaq -0x88(%rbp), %rsi
leaq -0x58(%rbp), %rdx
leaq -0x48(%rbp), %rcx
movq %rbx, %rdi
callq 0x3c3e
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x36bb
callq 0x441a
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x36c9
callq 0x441a
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x36e2
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31e0
movq %r14, %rdi
callq 0x441a
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x36fb
callq 0x441a
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x370c
callq 0x441a
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x372b
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31e0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3751
callq 0x441a
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x375f
callq 0x441a
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3784
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31e0
jmp 0x3784
jmp 0x3781
movq %rax, %rbx
jmp 0x378d
movq %rax, %rbx
movq -0x38(%rbp), %rdi
callq 0x441a
leaq -0xc8(%rbp), %rdi
callq 0x3cc8
movq %rbx, %rdi
callq 0x32e0
nop