// File: /workspace/github_cpp_makefile_star2_O2/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 $0x1f8, %rsp            # imm = 0x1F8
leaq -0x60(%rbp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0xcf4(%rip), %rsi       # 0x3004
leaq -0x218(%rbp), %rbx
leaq -0x36(%rbp), %rdx
movq %rbx, %rdi
callq 0x2070
leaq -0x1f8(%rbp), %r14
leaq 0xcd7(%rip), %rsi       # 0x3008
leaq -0x35(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0x1d8(%rbp), %r14
leaq 0xcc1(%rip), %rsi       # 0x300c
leaq -0x34(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0x1b8(%rbp), %r14
leaq 0xcab(%rip), %rsi       # 0x3010
leaq -0x33(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0x198(%rbp), %r14
leaq 0xc94(%rip), %rsi       # 0x3013
leaq -0x32(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0x178(%rbp), %r14
leaq 0xc7d(%rip), %rsi       # 0x3016
leaq -0x31(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0x158(%rbp), %r14
leaq 0xc65(%rip), %rsi       # 0x3018
leaq -0x30(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0x138(%rbp), %r14
leaq 0xc4f(%rip), %rsi       # 0x301c
leaq -0x2f(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0x118(%rbp), %r14
leaq 0xc39(%rip), %rsi       # 0x3020
leaq -0x2e(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0xf8(%rbp), %r14
leaq 0xc23(%rip), %rsi       # 0x3024
leaq -0x2d(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0xd8(%rbp), %r14
leaq 0xc0c(%rip), %rsi       # 0x3027
leaq -0x2c(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0xb8(%rbp), %r14
leaq 0xbf5(%rip), %rsi       # 0x302a
leaq -0x2b(%rbp), %rdx
movq %r14, %rdi
callq 0x2070
leaq -0x98(%rbp), %rdi
leaq -0x218(%rbp), %rsi
pushq $0xc
popq %rdx
leaq -0x2a(%rbp), %rcx
leaq -0x29(%rbp), %r8
callq 0x262a
movl $0x160, %ebx            # imm = 0x160
leaq (%rbx,%rbp), %rdi
addq $-0x218, %rdi           # imm = 0xFDE8
callq 0x2090
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x2464
leaq -0x208(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x90(%rbp), %r13
movq 0x2b41(%rip), %rbx      # 0x4fe0
leaq -0x218(%rbp), %r14
leaq -0x98(%rbp), %r15
leaq -0x68(%rbp), %r12
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x24ea
movq %r15, %rdi
movq %r14, %rsi
callq 0x2b62
cmpq %r13, %rax
jne 0x24b1
movq %r12, %rdi
movq %r14, %rsi
callq 0x2672
incq (%rax)
jmp 0x24b1
movq -0x50(%rbp), %r15
movq 0x2adb(%rip), %rbx      # 0x4fd0
leaq 0xb30(%rip), %r14       # 0x302c
leaq 0xb32(%rip), %r12       # 0x3035
leaq 0xb32(%rip), %r13       # 0x303c
leaq -0x60(%rbp), %rax
cmpq %rax, %r15
je 0x255f
leaq 0x20(%r15), %rsi
movq %rbx, %rdi
callq 0x20f0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2100
movq 0x40(%r15), %rsi
movq %rax, %rdi
callq 0x20b0
cmpq $0x2, 0x40(%r15)
movq %r13, %rsi
cmovaeq %r12, %rsi
movq %rax, %rdi
callq 0x2100
movq %rax, %rdi
callq 0x20a0
movq %r15, %rdi
callq 0x20c0
movq %rax, %r15
jmp 0x250a
leaq -0x218(%rbp), %rdi
callq 0x2090
leaq -0x98(%rbp), %rdi
callq 0x26ea
leaq -0x68(%rbp), %rdi
callq 0x2766
xorl %eax, %eax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movl $0x160, %r12d           # imm = 0x160
leaq (%r12,%rbp), %rdi
addq $-0x218, %rdi           # imm = 0xFDE8
callq 0x2090
addq $-0x20, %r12
cmpq $-0x20, %r12
jne 0x259d
movb $0x1, %al
jmp 0x25d4
jmp 0x25cf
jmp 0x25cf
jmp 0x25cf
jmp 0x25cf
jmp 0x25cf
jmp 0x25cf
jmp 0x25cf
jmp 0x25cf
jmp 0x25cf
jmp 0x25cf
movq %rax, %r15
xorl %eax, %eax
cmpq %r14, %rbx
sete %cl
testb %al, %al
jne 0x2619
testb %cl, %cl
jne 0x2619
addq $-0x20, %r14
movq %r14, %rdi
callq 0x2090
cmpq %rbx, %r14
jne 0x25e2
jmp 0x2619
movq %rax, %r15
jmp 0x2619
jmp 0x25fe
jmp 0x25fe
movq %rax, %r15
leaq -0x218(%rbp), %rdi
callq 0x2090
leaq -0x98(%rbp), %rdi
callq 0x26ea
leaq -0x68(%rbp), %rdi
callq 0x2766
movq %r15, %rdi
callq 0x2190