// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH10_GenericAlgorithms/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); // put words in alphabetical order and remove duplicates
    // sort words by size, but maintain alphabetical order for words of the same size
    stable_sort(words.begin(), words.end(), 
	            [](const string &a, const string &b) 
	              { return a.size() < b.size();});

	// get an iterator to the first element whose size() is >= sz
    auto wc = find_if(words.begin(), words.end(), 
                [sz](const string &a) 
	                { return a.size() >= sz; });

	// compute the number of elements with size >= sz 
	auto count = words.end() - wc;
    cout << count << " " << make_plural(count, "word", "s")
         << " of length " << sz << " or longer" << endl;

	// print words of the given size or longer, each one followed by a space
	for_each(wc, words.end(), 
	         [](const string &s){cout << s << " ";});
	cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x238a
movq (%rbx), %r12
movq 0x8(%rbx), %r15
cmpq %r15, %r12
je 0x25d2
movq %r15, %rax
subq %r12, %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 %r12, %rsi
callq 0x42c2
movq 0x10(%r13), %rdx
testq %rdx, %rdx
je 0x25be
movq -0x40(%rbp), %rcx
movq %r12, %rdi
movq %r15, %rsi
callq 0x2c25
jmp 0x25c9
movq %r12, %rdi
movq %r15, %rsi
callq 0x2bab
leaq -0x48(%rbp), %rdi
callq 0x4352
movq (%rbx), %rax
movq 0x8(%rbx), %r15
movq %r15, %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x7, %rdx
testq %rdx, %rdx
jle 0x2628
andq $-0x80, %rcx
addq %rax, %rcx
incq %rdx
addq $0x40, %rax
movq %rax, %r12
cmpq %r14, -0x38(%r12)
jae 0x2668
cmpq %r14, -0x18(%r12)
jae 0x266e
cmpq %r14, 0x8(%r12)
jae 0x2678
cmpq %r14, 0x28(%r12)
jae 0x2674
decq %rdx
subq $-0x80, %r12
cmpq $0x1, %rdx
jg 0x25fc
movq %rcx, %rax
movq %r15, %rcx
subq %rax, %rcx
sarq $0x5, %rcx
cmpq $0x1, %rcx
je 0x265b
cmpq $0x2, %rcx
je 0x2651
movq %r15, %r12
cmpq $0x3, %rcx
jne 0x2678
cmpq %r14, 0x8(%rax)
jae 0x2663
addq $0x20, %rax
cmpq %r14, 0x8(%rax)
jae 0x2663
addq $0x20, %rax
cmpq %r14, 0x8(%rax)
cmovbq %r15, %rax
movq %rax, %r12
jmp 0x2678
addq $-0x40, %r12
jmp 0x2678
addq $-0x20, %r12
jmp 0x2678
addq $0x20, %r12
subq %r12, %r15
sarq $0x5, %r15
movq 0x494a(%rip), %rdi      # 0x6fd0
movq %r15, %rsi
callq 0x2110
movq %rax, %r13
leaq 0x297d(%rip), %rsi      # 0x5015
movl $0x1, %edx
movq %rax, %rdi
callq 0x2160
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2950(%rip), %rsi      # 0x5004
leaq 0x294d(%rip), %rdx      # 0x5008
leaq -0x68(%rbp), %rdi
callq 0x47e0
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2936(%rip), %rsi      # 0x5009
leaq 0x2930(%rip), %rdx      # 0x500a
leaq -0x88(%rbp), %rdi
callq 0x47e0
cmpq $0x2, %r15
jb 0x2702
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x379c
jmp 0x271e
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x3800
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r13, %rdi
callq 0x2160
movq %rax, %r15
leaq 0x28d3(%rip), %rsi      # 0x500b
movl $0xb, %edx
movq %rax, %rdi
callq 0x2160
movq %r15, %rdi
movq %r14, %rsi
callq 0x20a0
movq %rax, %r14
leaq 0x28bd(%rip), %rsi      # 0x5017
movl $0xa, %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 0x27a7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x27c3
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x27dc
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x8(%rbx), %r15
cmpq %r15, %r12
je 0x281d
movq 0x47e4(%rip), %rbx      # 0x6fd0
leaq 0x2822(%rip), %r14      # 0x5015
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %rbx, %rdi
callq 0x2160
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2160
addq $0x20, %r12
cmpq %r15, %r12
jne 0x27f3
movq 0x47ac(%rip), %rbx      # 0x6fd0
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 0x4352
jmp 0x28c8
movq %rax, %rbx
jmp 0x2893
movq %rax, %rbx
jmp 0x28af
movq %rax, %rbx
jmp 0x28c8
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2893
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x28af
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x28c8
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21c0