// File: /workspace/github_cpp_makefile_star2_O3/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, %r15
movq %rdi, %rbx
callq 0x238a
movq (%rbx), %r14
movq 0x8(%rbx), %r13
cmpq %r13, %r14
je 0x25da
movq %r13, %rax
subq %r14, %rax
sarq $0x5, %rax
leaq 0x1(%rax), %rcx
shrq $0x3f, %rcx
leaq (%rax,%rcx), %rdx
incq %rdx
sarq %rdx
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x42f2
movq 0x10(%r12), %rdx
testq %rdx, %rdx
je 0x25bf
movq -0x40(%rbp), %rcx
movq %r14, %rdi
movq %r13, %rsi
callq 0x2c22
jmp 0x25ca
movq %r14, %rdi
movq %r13, %rsi
callq 0x2ba8
leaq -0x48(%rbp), %rdi
callq 0x4382
movq (%rbx), %r14
movq 0x8(%rbx), %r13
movq %r13, %rdx
subq %r14, %rdx
movq %rdx, %rcx
sarq $0x7, %rcx
testq %rcx, %rcx
jle 0x262a
andq $-0x80, %rdx
movq %rdx, %rax
addq %r14, %rax
incq %rcx
addq $0x40, %r14
cmpq %r15, -0x38(%r14)
jae 0x2667
cmpq %r15, -0x18(%r14)
jae 0x266d
cmpq %r15, 0x8(%r14)
jae 0x2677
cmpq %r15, 0x28(%r14)
jae 0x2673
decq %rcx
subq $-0x80, %r14
cmpq $0x1, %rcx
jg 0x25fd
movq %r13, %rdx
subq %rax, %rdx
jmp 0x262d
movq %r14, %rax
sarq $0x5, %rdx
cmpq $0x1, %rdx
je 0x265a
cmpq $0x2, %rdx
je 0x2650
movq %r13, %r14
cmpq $0x3, %rdx
jne 0x2677
cmpq %r15, 0x8(%rax)
jae 0x2662
addq $0x20, %rax
cmpq %r15, 0x8(%rax)
jae 0x2662
addq $0x20, %rax
cmpq %r15, 0x8(%rax)
cmovbq %r13, %rax
movq %rax, %r14
jmp 0x2677
addq $-0x40, %r14
jmp 0x2677
addq $-0x20, %r14
jmp 0x2677
addq $0x20, %r14
subq %r14, %r13
sarq $0x5, %r13
movq 0x494b(%rip), %rdi      # 0x6fd0
movq %r13, %rsi
callq 0x2110
movq %rax, %r12
leaq 0x297e(%rip), %rsi      # 0x5015
movl $0x1, %edx
movq %rax, %rdi
callq 0x2160
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2951(%rip), %rsi      # 0x5004
leaq 0x294e(%rip), %rdx      # 0x5008
leaq -0x68(%rbp), %rdi
callq 0x4810
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2937(%rip), %rsi      # 0x5009
leaq 0x2931(%rip), %rdx      # 0x500a
leaq -0x88(%rbp), %rdi
callq 0x4810
cmpq $0x2, %r13
jb 0x2701
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x3803
jmp 0x271d
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x3868
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r12, %rdi
callq 0x2160
movq %rax, %r12
leaq 0x28d4(%rip), %rsi      # 0x500b
movl $0xb, %edx
movq %rax, %rdi
callq 0x2160
movq %r12, %rdi
movq %r15, %rsi
callq 0x20a0
movq %rax, %r15
leaq 0x28be(%rip), %rsi      # 0x5017
movl $0xa, %edx
movq %rax, %rdi
callq 0x2160
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x27a6
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x27c2
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x27db
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq 0x8(%rbx), %r12
cmpq %r12, %r14
je 0x281a
movq 0x47e5(%rip), %rbx      # 0x6fd0
leaq 0x2823(%rip), %r15      # 0x5015
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %rdi
callq 0x2160
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2160
addq $0x20, %r14
cmpq %r12, %r14
jne 0x27f2
movq 0x47af(%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 0x4382
jmp 0x28c5
movq %rax, %rbx
jmp 0x2890
movq %rax, %rbx
jmp 0x28ac
movq %rax, %rbx
jmp 0x28c5
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2890
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x28ac
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2140
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x28c5
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x21c0