// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH14_OverloadedOperationsAndConversions/examples/newcount-size.cc
// Function: biggies(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&, unsigned long)
void biggies(vector<string>& words, vector<string>::size_type sz)
{
	elimDups(words);  // puts words in alphabetic order and removes duplicates

    // sort words by size using object of type ShorterString
	// maintaining alphabetic order for words of the same size
    stable_sort(words.begin(), words.end(), ShorterString());

	// use object of type SizeComp to find
	// the first element whose size() is >= sz
    auto wc = find_if(words.begin(), words.end(), SizeComp(sz));

	// compute the number of elements with size >= sz
	auto count = words.end() - wc;

	// print results
    cout << count << " " << make_plural(count, "word", "s")
         << " " << sz << " characters or longer" << endl;

	// use object of type PrintString
	// to print the contents of words, each one followed by a space
	for_each(wc, words.end(), PrintString(cout));
	cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r12
movq %rdi, %rbx
callq 0x238a
movq (%rbx), %r15
movq 0x8(%rbx), %r14
cmpq %r14, %r15
je 0x24e9
movq %r14, %rax
subq %r15, %rax
sarq $0x5, %rax
leaq 0x1(%rax), %rcx
shrq $0x3f, %rcx
leaq (%rax,%rcx), %rdx
incq %rdx
sarq %rdx
leaq -0x48(%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x341e
movq 0x10(%r13), %rdx
testq %rdx, %rdx
je 0x24d5
movq -0x40(%rbp), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3528
jmp 0x24e0
movq %r15, %rdi
movq %r14, %rsi
callq 0x34ae
leaq -0x48(%rbp), %rdi
callq 0x35de
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
movq %r12, %rdx
callq 0x455c
movq %rax, %r15
movq 0x8(%rbx), %r14
subq %rax, %r14
sarq $0x5, %r14
movq 0x4abb(%rip), %rdi      # 0x6fc8
movq %r14, %rsi
callq 0x2110
movq %rax, %r13
leaq 0x2ae5(%rip), %rsi      # 0x5004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2160
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2acb(%rip), %rsi      # 0x5006
leaq 0x2ac8(%rip), %rdx      # 0x500a
leaq -0x68(%rbp), %rdi
callq 0x45fc
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2ab1(%rip), %rsi      # 0x500b
leaq 0x2aab(%rip), %rdx      # 0x500c
leaq -0x88(%rbp), %rdi
callq 0x45fc
cmpq $0x2, %r14
jb 0x2589
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x28f8
jmp 0x25a5
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x295c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r13, %rdi
callq 0x2160
movq %rax, %r14
leaq 0x2a45(%rip), %rsi      # 0x5004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2160
movq %r14, %rdi
movq %r12, %rsi
callq 0x20a0
movq %rax, %r14
leaq 0x2a2c(%rip), %rsi      # 0x500d
movl $0x15, %edx
movq %rax, %rdi
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x262e
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x264a
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2663
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x8(%rbx), %rsi
movq %r15, %rdi
movq 0x4957(%rip), %rbx      # 0x6fc8
movq %rbx, %rdx
callq 0x27ee
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x35de
jmp 0x271d
movq %rax, %rbx
jmp 0x26e8
movq %rax, %rbx
jmp 0x2704
movq %rax, %rbx
jmp 0x271d
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26e8
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2704
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x271d
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21c0