// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH12_DynamicMemory/examples/TextQuery.cc
// Function: TextQuery::query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
QueryResult
TextQuery::query(const string& sought) const
{
	// we'll return a pointer to this set if we don't find sought
	static shared_ptr<set<line_no>> nodata(new set<line_no>);

    // use find and not a subscript to avoid adding words to wm!
    auto loc = wm.find(cleanup_str(sought));

	if (loc == wm.end())
		return QueryResult(sought, nodata, file);  // not found
	else
		return QueryResult(sought, loc->second, file);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movb 0x4f8b(%rip), %al       # 0xa1d8
testb %al, %al
je 0x542a
leaq 0x10(%r14), %r12
leaq -0xc8(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x517a
movq %r12, %rdi
movq %r13, %rsi
callq 0x63f2
movq %rax, %r12
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5298
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31e0
leaq 0x18(%r14), %rax
cmpq %rax, %r12
je 0x52e7
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x4486
movq 0x40(%r12), %rax
movq %rax, -0x48(%rbp)
movq 0x48(%r12), %rax
movq %rax, -0x40(%rbp)
testq %rax, %rax
je 0x5338
movq 0x4ce3(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x5334
incl 0x8(%rax)
jmp 0x5338
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x4486
movq 0x4eb9(%rip), %rax      # 0xa1c8
movq %rax, -0x68(%rbp)
movq 0x4eb6(%rip), %rax      # 0xa1d0
movq %rax, -0x60(%rbp)
testq %rax, %rax
je 0x53a1
movq 0x4c96(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x539d
incl 0x8(%rax)
jmp 0x53a1
lock
incl 0x8(%rax)
movq (%r14), %rax
movq %rax, -0x38(%rbp)
movq 0x8(%r14), %rax
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x5361
movq 0x4c6d(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x535d
incl 0x8(%rax)
jmp 0x5361
lock
incl 0x8(%rax)
leaq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rdx
leaq -0x38(%rbp), %rcx
movq %rbx, %rdi
callq 0x3c3e
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x5386
callq 0x441a
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x5394
callq 0x441a
movq -0x88(%rbp), %rdi
jmp 0x5404
lock
incl 0x8(%rax)
movq (%r14), %rax
movq %rax, -0x58(%rbp)
movq 0x8(%r14), %rax
movq %rax, -0x50(%rbp)
testq %rax, %rax
je 0x53ca
movq 0x4c04(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x53c6
incl 0x8(%rax)
jmp 0x53ca
lock
incl 0x8(%rax)
leaq -0xa8(%rbp), %rsi
leaq -0x68(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movq %rbx, %rdi
callq 0x3c3e
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x53ef
callq 0x441a
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x53fd
callq 0x441a
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x5415
movq (%r13), %rsi
incq %rsi
callq 0x31e0
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4da7(%rip), %rdi      # 0xa1d8
callq 0x3300
testl %eax, %eax
je 0x5255
movl $0x30, %edi
callq 0x31d0
movq %rax, %rcx
addq $0x8, %rcx
movl $0x0, 0x8(%rax)
xorl %edx, %edx
movq %rdx, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rdx, 0x28(%rax)
movq %rax, 0x4d59(%rip)      # 0xa1c8
leaq 0x4d5a(%rip), %rdi      # 0xa1d0
movq %rax, %rsi
callq 0x6264
leaq 0xdc9(%rip), %rdi       # 0x624e
leaq 0x4d3c(%rip), %rsi      # 0xa1c8
leaq 0x4d15(%rip), %rdx      # 0xa1a8
callq 0x31b0
leaq 0x4d39(%rip), %rdi      # 0xa1d8
callq 0x3120
jmp 0x5255
movq %rax, %rbx
leaq 0x4d25(%rip), %rdi      # 0xa1d8
callq 0x3110
jmp 0x5544
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x54ce
callq 0x441a
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x54dc
callq 0x441a
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x5544
movq -0x98(%rbp), %rsi
jmp 0x553c
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x5502
callq 0x441a
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x5510
callq 0x441a
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x5544
movq -0x78(%rbp), %rsi
jmp 0x553c
movq %rax, %rbx
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5544
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31e0
movq %rbx, %rdi
callq 0x32e0