// File: 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
subq $0x3c0, %rsp            # imm = 0x3C0
movl $0x0, -0x4(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x2c80
movb $0x1, -0x220(%rbp)
leaq -0x1f8(%rbp), %rax
movq %rax, -0x288(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x201(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x21d0
movq -0x288(%rbp), %rdi
movq -0x280(%rbp), %rdx
leaq 0x3c85(%rip), %rsi      # 0x6004
callq 0x2170
jmp 0x2386
leaq -0x1d8(%rbp), %rax
movq %rax, -0x298(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x215(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x21d0
movq -0x298(%rbp), %rdi
movq -0x290(%rbp), %rdx
leaq 0x3c45(%rip), %rsi      # 0x6008
callq 0x2170
jmp 0x23ca
leaq -0x1b8(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x216(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x21d0
movq -0x2a8(%rbp), %rdi
movq -0x2a0(%rbp), %rdx
leaq 0x3c05(%rip), %rsi      # 0x600c
callq 0x2170
jmp 0x240e
leaq -0x198(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x217(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x21d0
movq -0x2b8(%rbp), %rdi
movq -0x2b0(%rbp), %rdx
leaq 0x3bc5(%rip), %rsi      # 0x6010
callq 0x2170
jmp 0x2452
leaq -0x178(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x218(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
callq 0x21d0
movq -0x2c8(%rbp), %rdi
movq -0x2c0(%rbp), %rdx
leaq 0x3b84(%rip), %rsi      # 0x6013
callq 0x2170
jmp 0x2496
leaq -0x158(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x219(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x21d0
movq -0x2d8(%rbp), %rdi
movq -0x2d0(%rbp), %rdx
leaq 0x3b43(%rip), %rsi      # 0x6016
callq 0x2170
jmp 0x24da
leaq -0x138(%rbp), %rax
movq %rax, -0x2e8(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x21a(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x21d0
movq -0x2e8(%rbp), %rdi
movq -0x2e0(%rbp), %rdx
leaq 0x3b01(%rip), %rsi      # 0x6018
callq 0x2170
jmp 0x251e
leaq -0x118(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x21b(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x21d0
movq -0x2f8(%rbp), %rdi
movq -0x2f0(%rbp), %rdx
leaq 0x3ac1(%rip), %rsi      # 0x601c
callq 0x2170
jmp 0x2562
leaq -0xf8(%rbp), %rax
movq %rax, -0x308(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x21c(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x21d0
movq -0x308(%rbp), %rdi
movq -0x300(%rbp), %rdx
leaq 0x3a81(%rip), %rsi      # 0x6020
callq 0x2170
jmp 0x25a6
leaq -0xd8(%rbp), %rax
movq %rax, -0x318(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x21d(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x21d0
movq -0x318(%rbp), %rdi
movq -0x310(%rbp), %rdx
leaq 0x3a41(%rip), %rsi      # 0x6024
callq 0x2170
jmp 0x25ea
leaq -0xb8(%rbp), %rax
movq %rax, -0x328(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x21e(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x21d0
movq -0x328(%rbp), %rdi
movq -0x320(%rbp), %rdx
leaq 0x3a00(%rip), %rsi      # 0x6027
callq 0x2170
jmp 0x262e
leaq -0x98(%rbp), %rax
movq %rax, -0x338(%rbp)
movq %rax, -0x200(%rbp)
leaq -0x21f(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x21d0
movq -0x338(%rbp), %rdi
movq -0x330(%rbp), %rdx
leaq 0x39bf(%rip), %rsi      # 0x602a
callq 0x2170
jmp 0x2672
movb $0x0, -0x220(%rbp)
leaq -0x1f8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq $0xc, -0x70(%rbp)
leaq -0x222(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x2ca0
movq -0x340(%rbp), %r8
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x68(%rbp), %rdi
leaq -0x221(%rbp), %rcx
callq 0x2cc0
jmp 0x26c0
leaq -0x222(%rbp), %rdi
callq 0x2d90
leaq -0x1f8(%rbp), %rax
movq %rax, -0x350(%rbp)
addq $0x180, %rax            # imm = 0x180
movq %rax, -0x348(%rbp)
movq -0x348(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x358(%rbp)
callq 0x20a0
movq -0x350(%rbp), %rcx
movq -0x358(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x348(%rbp)
jne 0x26e7
leaq -0x21f(%rbp), %rdi
callq 0x2140
leaq -0x21e(%rbp), %rdi
callq 0x2140
leaq -0x21d(%rbp), %rdi
callq 0x2140
leaq -0x21c(%rbp), %rdi
callq 0x2140
leaq -0x21b(%rbp), %rdi
callq 0x2140
leaq -0x21a(%rbp), %rdi
callq 0x2140
leaq -0x219(%rbp), %rdi
callq 0x2140
leaq -0x218(%rbp), %rdi
callq 0x2140
leaq -0x217(%rbp), %rdi
callq 0x2140
leaq -0x216(%rbp), %rdi
callq 0x2140
leaq -0x215(%rbp), %rdi
callq 0x2140
leaq -0x201(%rbp), %rdi
callq 0x2140
leaq -0x248(%rbp), %rdi
callq 0x2180
movq 0x7825(%rip), %rdi      # 0x9fe0
leaq -0x248(%rbp), %rsi
callq 0x2160
movq %rax, -0x360(%rbp)
jmp 0x27d0
movq -0x360(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2150
movb %al, -0x361(%rbp)
jmp 0x27ee
movb -0x361(%rbp), %al
testb $0x1, %al
jne 0x27fd
jmp 0x2b1a
leaq -0x68(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x2de0
movq %rax, -0x370(%rbp)
jmp 0x2816
movq -0x370(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2e20
movq %rax, -0x258(%rbp)
leaq -0x250(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x2db0
testb $0x1, %al
jne 0x2850
jmp 0x2b15
leaq -0x38(%rbp), %rdi
leaq -0x248(%rbp), %rsi
callq 0x2e50
movq %rax, -0x378(%rbp)
jmp 0x2869
movq -0x378(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x2b15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a80
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a5c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x2a08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
jmp 0x29fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x222(%rbp), %rdi
callq 0x2d90
leaq -0x1f8(%rbp), %rax
movq %rax, -0x388(%rbp)
addq $0x180, %rax            # imm = 0x180
movq %rax, -0x380(%rbp)
movq -0x380(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x390(%rbp)
callq 0x20a0
movq -0x388(%rbp), %rcx
movq -0x390(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x380(%rbp)
jne 0x29c9
jmp 0x29fc
leaq -0x21f(%rbp), %rdi
callq 0x2140
leaq -0x21e(%rbp), %rdi
callq 0x2140
leaq -0x21d(%rbp), %rdi
callq 0x2140
leaq -0x21c(%rbp), %rdi
callq 0x2140
leaq -0x21b(%rbp), %rdi
callq 0x2140
leaq -0x21a(%rbp), %rdi
callq 0x2140
leaq -0x219(%rbp), %rdi
callq 0x2140
leaq -0x218(%rbp), %rdi
callq 0x2140
leaq -0x217(%rbp), %rdi
callq 0x2140
leaq -0x216(%rbp), %rdi
callq 0x2140
leaq -0x215(%rbp), %rdi
callq 0x2140
leaq -0x201(%rbp), %rdi
callq 0x2140
testb $0x1, -0x220(%rbp)
jne 0x2a97
jmp 0x2ae4
movq -0x200(%rbp), %rax
leaq -0x1f8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x398(%rbp)
je 0x2ae2
movq -0x398(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x20a0
movq -0x3a0(%rbp), %rax
leaq -0x1f8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x398(%rbp)
jne 0x2ab1
jmp 0x2ae4
jmp 0x2c61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x210(%rbp)
movl %eax, -0x214(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x20a0
leaq -0x68(%rbp), %rdi
callq 0x3010
jmp 0x2c61
jmp 0x27b4
leaq -0x38(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x260(%rbp), %rdi
callq 0x2f30
movq %rax, -0x268(%rbp)
movq -0x260(%rbp), %rdi
callq 0x2f60
movq %rax, -0x270(%rbp)
leaq -0x268(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x2f90
testb $0x1, %al
jne 0x2b67
jmp 0x2c30
leaq -0x268(%rbp), %rdi
callq 0x2fc0
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rsi
movq 0x7448(%rip), %rdi      # 0x9fd0
callq 0x20e0
movq %rax, -0x3a8(%rbp)
jmp 0x2b96
movq -0x3a8(%rbp), %rdi
leaq 0x3488(%rip), %rsi      # 0x602c
callq 0x20f0
movq %rax, -0x3b0(%rbp)
jmp 0x2bb2
movq -0x3b0(%rbp), %rdi
movq -0x278(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x2050
movq %rax, -0x3b8(%rbp)
jmp 0x2bd2
movq -0x3b8(%rbp), %rdi
movq -0x278(%rbp), %rax
movq 0x20(%rax), %rax
subq $0x2, %rax
leaq 0x3446(%rip), %rax      # 0x6035
leaq 0x3446(%rip), %rsi      # 0x603c
cmovaeq %rax, %rsi
callq 0x20f0
movq %rax, -0x3c0(%rbp)
jmp 0x2c08
movq -0x3c0(%rbp), %rdi
movq 0x73aa(%rip), %rsi      # 0x9fc0
callq 0x2130
jmp 0x2c1d
jmp 0x2c1f
leaq -0x268(%rbp), %rdi
callq 0x2fe0
jmp 0x2b4b
movl $0x0, -0x4(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x20a0
leaq -0x68(%rbp), %rdi
callq 0x3010
leaq -0x38(%rbp), %rdi
callq 0x3030
movl -0x4(%rbp), %eax
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x3030
movq -0x210(%rbp), %rdi
callq 0x21c0
nopw %cs:(%rax,%rax)