// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH11_AssociativeContainers/examples/restricted_count.cc
// Function: main
int main()
{
	// count the number of times each word occurs in the input
	map<string, size_t> word_count; // empty map from string to size_t
	set<string> exclude = {"The", "But", "And", "Or", "An", "A",
						   "the", "but", "and", "or", "an", "a"};
	string word;
	while (cin >> word)
		// count only words that are not in exclude
		if (exclude.find(word) == exclude.end())
			++word_count[word];   // fetch and increment the counter for word

	for (const auto& w : word_count) // for each element in the map
		// print the results
		cout <<  w.first << " occurs " << w.second
			 << ((w.second > 1) ? " times" : " time") << endl;

return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
leaq -0x58(%rbp), %rcx
movl $0x0, (%rcx)
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x200(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1cc6(%rip), %rsi      # 0x4004
leaq 0x1cc2(%rip), %rdx      # 0x4007
leaq -0x210(%rbp), %r14
movq %r14, %rdi
callq 0x29b2
leaq -0x1f0(%rbp), %rbx
leaq -0x1e0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1c9b(%rip), %rsi      # 0x4008
leaq 0x1c97(%rip), %rdx      # 0x400b
movq %rbx, %rdi
callq 0x29b2
leaq -0x1d0(%rbp), %rbx
leaq -0x1c0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1c77(%rip), %rsi      # 0x400c
leaq 0x1c73(%rip), %rdx      # 0x400f
movq %rbx, %rdi
callq 0x29b2
leaq -0x1b0(%rbp), %rbx
leaq -0x1a0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1c53(%rip), %rsi      # 0x4010
leaq 0x1c4e(%rip), %rdx      # 0x4012
movq %rbx, %rdi
callq 0x29b2
leaq -0x190(%rbp), %rbx
leaq -0x180(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1c2e(%rip), %rsi      # 0x4013
leaq 0x1c29(%rip), %rdx      # 0x4015
movq %rbx, %rdi
callq 0x29b2
leaq -0x170(%rbp), %rbx
leaq -0x160(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1c09(%rip), %rsi      # 0x4016
leaq 0x1c03(%rip), %rdx      # 0x4017
movq %rbx, %rdi
callq 0x29b2
leaq -0x150(%rbp), %rbx
leaq -0x140(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1be3(%rip), %rsi      # 0x4018
leaq 0x1bdf(%rip), %rdx      # 0x401b
movq %rbx, %rdi
callq 0x29b2
leaq -0x130(%rbp), %rbx
leaq -0x120(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1bbf(%rip), %rsi      # 0x401c
leaq 0x1bbb(%rip), %rdx      # 0x401f
movq %rbx, %rdi
callq 0x29b2
leaq -0x110(%rbp), %rbx
leaq -0x100(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1b9b(%rip), %rsi      # 0x4020
leaq 0x1b97(%rip), %rdx      # 0x4023
movq %rbx, %rdi
callq 0x29b2
leaq -0xf0(%rbp), %rbx
leaq -0xe0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1b77(%rip), %rsi      # 0x4024
leaq 0x1b72(%rip), %rdx      # 0x4026
movq %rbx, %rdi
callq 0x29b2
leaq -0xd0(%rbp), %rbx
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1b52(%rip), %rsi      # 0x4027
leaq 0x1b4d(%rip), %rdx      # 0x4029
movq %rbx, %rdi
callq 0x29b2
leaq -0xb0(%rbp), %rbx
leaq -0xa0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x1b2d(%rip), %rsi      # 0x402a
leaq 0x1b27(%rip), %rdx      # 0x402b
movq %rbx, %rdi
callq 0x29b2
leaq -0x90(%rbp), %rdi
leaq -0x210(%rbp), %rsi
leaq -0x2a(%rbp), %rcx
leaq -0x29(%rbp), %r8
movl $0xc, %edx
callq 0x2782
movq $-0x180, %rbx           # imm = 0xFE80
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x2547
movq (%r15), %rsi
incq %rsi
callq 0x2100
addq $-0x20, %r15
addq $0x20, %rbx
jne 0x2533
leaq -0x210(%rbp), %rbx
leaq -0x200(%rbp), %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq -0x88(%rbp), %r13
movq 0x3a64(%rip), %r14      # 0x5fe0
leaq -0x90(%rbp), %r15
leaq -0x60(%rbp), %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2130
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x25c0
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2dc4
cmpq %r13, %rax
jne 0x2587
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2804
incq (%rax)
jmp 0x2587
movq -0x48(%rbp), %rbx
leaq -0x58(%rbp), %rax
cmpq %rax, %rbx
je 0x2679
leaq 0x1a54(%rip), %r15      # 0x402c
leaq 0x1a56(%rip), %r13      # 0x4035
leaq 0x1a56(%rip), %r14      # 0x403c
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq 0x39db(%rip), %rdi      # 0x5fd0
callq 0x2120
movq %rax, %r12
movl $0x8, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2120
movq 0x40(%rbx), %rsi
movq %r12, %rdi
callq 0x2080
movq %rax, %r12
cmpq $0x2, 0x40(%rbx)
movq %r14, %rsi
cmovaeq %r13, %rsi
movl $0x5, %edx
sbbq $-0x1, %rdx
movq %rax, %rdi
callq 0x2120
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x20a0
movq %rax, %rbx
leaq -0x58(%rbp), %rax
cmpq %rax, %rbx
jne 0x25e6
movq -0x210(%rbp), %rdi
leaq -0x200(%rbp), %rax
cmpq %rax, %rdi
je 0x269b
movq -0x200(%rbp), %rsi
incq %rsi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2892
leaq -0x60(%rbp), %rdi
callq 0x2922
xorl %eax, %eax
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
leaq -0x90(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x21a0
movb $0x1, %al
jmp 0x26f7
jmp 0x26f2
jmp 0x26f2
jmp 0x26f2
jmp 0x26f2
jmp 0x26f2
jmp 0x26f2
jmp 0x26f2
jmp 0x26f2
jmp 0x26f2
jmp 0x26f2
movq %rax, %r15
xorl %eax, %eax
cmpq %rbx, %r14
sete %cl
orb %al, %cl
jne 0x2771
addq $-0x10, %rbx
leaq -0x210(%rbp), %r14
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0x2720
movq (%rbx), %rsi
incq %rsi
callq 0x2100
leaq -0x20(%rbx), %rax
addq $-0x10, %rbx
cmpq %r14, %rbx
movq %rax, %rbx
jne 0x270c
jmp 0x2771
movq %rax, %r15
xorl %eax, %eax
movq %r14, %rbx
jmp 0x26f7
jmp 0x2740
jmp 0x2740
movq %rax, %r15
movq -0x210(%rbp), %rdi
leaq -0x200(%rbp), %rax
cmpq %rax, %rdi
je 0x2765
movq -0x200(%rbp), %rsi
incq %rsi
callq 0x2100
leaq -0x90(%rbp), %rdi
callq 0x2892
leaq -0x60(%rbp), %rdi
callq 0x2922
movq %r15, %rdi
callq 0x2170