// File: /workspace/github_cpp_makefile_star2_O1/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 0x4f29(%rip), %al       # 0xa1d8
testb %al, %al
je 0x548c
leaq 0x10(%r14), %r12
leaq -0xc8(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x51f6
movq %r12, %rdi
movq %r13, %rsi
callq 0x6472
movq %rax, %r12
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x52fa
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31e0
leaq 0x18(%r14), %rax
cmpq %rax, %r12
je 0x5349
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x44e8
movq 0x40(%r12), %rax
movq %rax, -0x48(%rbp)
movq 0x48(%r12), %rax
movq %rax, -0x40(%rbp)
testq %rax, %rax
je 0x539a
movq 0x4c81(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x5396
incl 0x8(%rax)
jmp 0x539a
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %rdi
callq 0x44e8
movq 0x4e57(%rip), %rax      # 0xa1c8
movq %rax, -0x68(%rbp)
movq 0x4e54(%rip), %rax      # 0xa1d0
movq %rax, -0x60(%rbp)
testq %rax, %rax
je 0x5403
movq 0x4c34(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x53ff
incl 0x8(%rax)
jmp 0x5403
lock
incl 0x8(%rax)
movq (%r14), %rax
movq %rax, -0x38(%rbp)
movq 0x8(%r14), %rax
movq %rax, -0x30(%rbp)
testq %rax, %rax
je 0x53c3
movq 0x4c0b(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x53bf
incl 0x8(%rax)
jmp 0x53c3
lock
incl 0x8(%rax)
leaq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rdx
leaq -0x38(%rbp), %rcx
movq %rbx, %rdi
callq 0x3ca0
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x53e8
callq 0x447c
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x53f6
callq 0x447c
movq -0x88(%rbp), %rdi
jmp 0x5466
lock
incl 0x8(%rax)
movq (%r14), %rax
movq %rax, -0x58(%rbp)
movq 0x8(%r14), %rax
movq %rax, -0x50(%rbp)
testq %rax, %rax
je 0x542c
movq 0x4ba2(%rip), %rcx      # 0x9fc0
cmpb $0x0, (%rcx)
je 0x5428
incl 0x8(%rax)
jmp 0x542c
lock
incl 0x8(%rax)
leaq -0xa8(%rbp), %rsi
leaq -0x68(%rbp), %rdx
leaq -0x58(%rbp), %rcx
movq %rbx, %rdi
callq 0x3ca0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5451
callq 0x447c
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x545f
callq 0x447c
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x5477
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 0x4d45(%rip), %rdi      # 0xa1d8
callq 0x3300
testl %eax, %eax
je 0x52b7
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, 0x4cf7(%rip)      # 0xa1c8
leaq 0x4cf8(%rip), %rdi      # 0xa1d0
movq %rax, %rsi
callq 0x62ea
leaq 0xded(%rip), %rdi       # 0x62d4
leaq 0x4cda(%rip), %rsi      # 0xa1c8
leaq 0x4cb3(%rip), %rdx      # 0xa1a8
callq 0x31b0
leaq 0x4cd7(%rip), %rdi      # 0xa1d8
callq 0x3120
jmp 0x52b7
movq %rax, %rbx
leaq 0x4cc3(%rip), %rdi      # 0xa1d8
callq 0x3110
jmp 0x55a6
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5530
callq 0x447c
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x553e
callq 0x447c
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x55a6
movq -0x98(%rbp), %rsi
jmp 0x559e
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x5564
callq 0x447c
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x5572
callq 0x447c
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x55a6
movq -0x78(%rbp), %rsi
jmp 0x559e
movq %rax, %rbx
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x55a6
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x31e0
movq %rbx, %rdi
callq 0x32e0