// File: /workspace/github_cpp_makefile_star2_O3/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 0x24f5
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 0x33f6
movq 0x10(%r13), %rdx
testq %rdx, %rdx
je 0x24da
movq -0x40(%rbp), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x3500
jmp 0x24e5
movq %r15, %rdi
movq %r14, %rsi
callq 0x3486
leaq -0x48(%rbp), %rdi
callq 0x35b6
movq (%rbx), %r15
movq 0x8(%rbx), %r14
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x456a
movq %rax, %r15
movq 0x8(%rbx), %r14
subq %rax, %r14
sarq $0x5, %r14
movq 0x4ab0(%rip), %rdi      # 0x6fc8
movq %r14, %rsi
callq 0x2110
movq %rax, %r13
leaq 0x2ada(%rip), %rsi      # 0x5004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2160
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2ac0(%rip), %rsi      # 0x5006
leaq 0x2abd(%rip), %rdx      # 0x500a
leaq -0x68(%rbp), %rdi
callq 0x4612
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2aa6(%rip), %rsi      # 0x500b
leaq 0x2aa0(%rip), %rdx      # 0x500c
leaq -0x88(%rbp), %rdi
callq 0x4612
cmpq $0x2, %r14
jb 0x2594
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x2907
jmp 0x25b0
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x296c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r13, %rdi
callq 0x2160
movq %rax, %r14
leaq 0x2a3a(%rip), %rsi      # 0x5004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2160
movq %r14, %rdi
movq %r12, %rsi
callq 0x20a0
movq %rax, %r14
leaq 0x2a21(%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 0x2639
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x2655
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x266e
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x8(%rbx), %rsi
movq %r15, %rdi
movq 0x494c(%rip), %rbx      # 0x6fc8
movq %rbx, %rdx
callq 0x27f9
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 0x35b6
jmp 0x2728
movq %rax, %rbx
jmp 0x26f3
movq %rax, %rbx
jmp 0x270f
movq %rax, %rbx
jmp 0x2728
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26f3
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x270f
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2728
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21c0