// File: iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_27_30.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
{
	static shared_ptr<set<line_no>> nodata(new set<line_no>);

	auto loc = wm.find(clean_str(sought));

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0xf0(%rbp)
movq %rdi, %rax
movq %rax, -0xe8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpb $0x0, 0xa00e(%rip)      # 0xd1b8
jne 0x3217
leaq 0xa005(%rip), %rdi      # 0xd1b8
callq 0x22d0
cmpl $0x0, %eax
je 0x3217
movl $0x30, %edi
callq 0x21c0
movq %rax, -0xf8(%rbp)
jmp 0x31d0
movq -0xf8(%rbp), %rdi
callq 0x3990
movq -0xf8(%rbp), %rsi
leaq 0x9fbe(%rip), %rdi      # 0xd1a8
callq 0x3aa0
jmp 0x31f1
leaq -0x9f8(%rip), %rdi      # 0x2800
leaq 0x9fa9(%rip), %rsi      # 0xd1a8
leaq 0x9f82(%rip), %rdx      # 0xd188
callq 0x2180
leaq 0x9fa6(%rip), %rdi      # 0xd1b8
callq 0x2150
movq -0xe0(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x110(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x3090
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x3ad0
movq %rax, -0x100(%rbp)
jmp 0x3259
movq -0x100(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2110
movq -0xe0(%rbp), %rdi
addq $0x10, %rdi
callq 0x3b30
movq %rax, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3b00
testb $0x1, %al
jne 0x3297
jmp 0x3391
movq -0x18(%rbp), %rsi
leaq -0x78(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x20c0
leaq 0x9ef6(%rip), %rsi      # 0xd1a8
leaq -0x88(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x3b60
movq -0xe0(%rbp), %rsi
leaq -0x98(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0x3b90
movq -0xf0(%rbp), %rdi
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rdx
movq -0x118(%rbp), %rcx
callq 0x3bc0
jmp 0x3302
leaq -0x98(%rbp), %rdi
callq 0x27e0
leaq -0x88(%rbp), %rdi
callq 0x2800
leaq -0x78(%rbp), %rdi
callq 0x2110
jmp 0x3460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq 0x9e7d(%rip), %rdi      # 0xd1b8
callq 0x2140
jmp 0x3470
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x2110
jmp 0x3470
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x27e0
leaq -0x88(%rbp), %rdi
callq 0x2800
leaq -0x78(%rbp), %rdi
callq 0x2110
jmp 0x3470
movq -0x18(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x20c0
leaq -0x30(%rbp), %rdi
callq 0x3c20
movq %rax, %rsi
addq $0x20, %rsi
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x138(%rbp)
callq 0x3b60
movq -0xe0(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x3b90
movq -0xf0(%rbp), %rdi
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
movq -0x130(%rbp), %rcx
callq 0x3bc0
jmp 0x3408
leaq -0xd8(%rbp), %rdi
callq 0x27e0
leaq -0xc8(%rbp), %rdi
callq 0x2800
leaq -0xb8(%rbp), %rdi
callq 0x2110
jmp 0x3460
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x27e0
leaq -0xc8(%rbp), %rdi
callq 0x2800
leaq -0xb8(%rbp), %rdi
callq 0x2110
jmp 0x3470
movq -0xe8(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x22c0
nopl (%rax)