// File: /workspace/github_cpp_makefile_star2_O1/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 0x65fe(%rip), %rax      # 0x9bb8
movq %rax, (%r12)
leaq 0x18(%r12), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x30(%r12)
movups %xmm0, 0x10(%r12)
movq %rax, 0x28(%r12)
movq %rax, 0x30(%r12)
movq %r12, -0x38(%rbp)
movq $0x0, 0x38(%r12)
movq -0xa8(%rbp), %r15
movq -0x98(%rbp), %rax
movq 0x18(%r15), %r13
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x3622
movq 0x69ac(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x361e
incl 0x8(%rdi)
jmp 0x3622
lock
incl 0x8(%rdi)
movq %r14, -0x68(%rbp)
movq %rbx, -0x60(%rbp)
movq (%rax), %rbx
movq 0x8(%rax), %r14
testq %rdi, %rdi
je 0x363b
callq 0x447c
addq $0x10, %r12
movq $0x0, -0x30(%rbp)
cmpq %rbx, %r14
je 0x3690
subq %rbx, %r14
addq $0x8, %r15
sarq $0x5, %r14
xorl %eax, %eax
leaq -0x30(%rbp), %rbx
cmpq %r15, %r13
je 0x3675
cmpq %rax, 0x20(%r13)
jne 0x3675
movq %r13, %rdi
callq 0x3230
movq %rax, %r13
jmp 0x3680
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4676
movq -0x30(%rbp), %rax
incq %rax
movq %rax, -0x30(%rbp)
cmpq %r14, %rax
jne 0x365d
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 0x690c(%rip), %rax      # 0x9fc0
cmpb $0x0, (%rax)
movq -0x60(%rbp), %rbx
je 0x36c3
incl 0x8(%r14)
jmp 0x36c8
lock
incl 0x8(%r14)
movq -0x98(%rbp), %rdx
movq -0x90(%rbp), %rcx
movq %rdx, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
testq %rcx, %rcx
je 0x36f1
cmpb $0x0, (%rax)
je 0x36ed
incl 0x8(%rcx)
jmp 0x36f1
lock
incl 0x8(%rcx)
leaq -0x88(%rbp), %rsi
leaq -0x58(%rbp), %rdx
leaq -0x48(%rbp), %rcx
movq %rbx, %rdi
callq 0x3ca0
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x3716
callq 0x447c
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x3724
callq 0x447c
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x373d
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31e0
movq %r14, %rdi
callq 0x447c
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x3756
callq 0x447c
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x3767
callq 0x447c
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3786
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 0x37ac
callq 0x447c
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x37ba
callq 0x447c
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x37df
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x31e0
jmp 0x37df
jmp 0x37dc
movq %rax, %rbx
jmp 0x37e8
movq %rax, %rbx
movq -0x38(%rbp), %rdi
callq 0x447c
leaq -0xc8(%rbp), %rdi
callq 0x3d2a
movq %rbx, %rdi
callq 0x32e0