// File: iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/exercises/ex16_04.cc
// Function: main
int main(int argc, char const *argv[])
{
	std::vector<int> v = {1, 2, 3, 4, 5, 6};
	auto iterv = find(v.begin(), v.end(), 3);
	std::cout << (iterv != v.end() ? "found\n" : "not found\n");

	std::list<std::string> l = {"hello", "world", "cplusplus", "primer"};
	auto iterl = find(l.begin(), l.end(), "cplusplus");
	std::cout << (iterl != l.end() ? "found\n" : "not found\n");

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movabsq $0x600000005, %rax      # imm = 0x600000005
movq %rax, -0x40(%rbp)
movups 0x1d36(%rip), %xmm0     # 0x3004
movaps %xmm0, -0x50(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x6, -0x30(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x1800
movq -0x170(%rbp), %rcx
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq -0x28(%rbp), %rdi
callq 0x1820
jmp 0x130c
leaq -0x51(%rbp), %rdi
callq 0x18a0
leaq -0x28(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x1930
movq -0x180(%rbp), %rdi
movq %rax, -0x78(%rbp)
callq 0x1960
movq %rax, -0x80(%rbp)
movl $0x3, -0x84(%rbp)
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
leaq -0x84(%rbp), %rdx
callq 0x18c0
movq %rax, -0x178(%rbp)
jmp 0x1360
movq -0x178(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1960
movq %rax, -0x90(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1990
movb %al, %cl
leaq 0x1c8c(%rip), %rax      # 0x3020
leaq 0x1c81(%rip), %rsi      # 0x301c
testb %cl, %cl
cmovneq %rax, %rsi
movq 0x4c30(%rip), %rdi      # 0x5fd8
callq 0x10d0
jmp 0x13af
movb $0x1, -0x145(%rbp)
leaq -0x138(%rbp), %rax
movq %rax, -0x190(%rbp)
movq %rax, -0x140(%rbp)
leaq -0x141(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x1150
movq -0x190(%rbp), %rdi
movq -0x188(%rbp), %rdx
leaq 0x1c34(%rip), %rsi      # 0x3027
callq 0x1110
jmp 0x13fa
leaq -0x118(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq %rax, -0x140(%rbp)
leaq -0x142(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x1150
movq -0x1a0(%rbp), %rdi
movq -0x198(%rbp), %rdx
leaq 0x1bf6(%rip), %rsi      # 0x302d
callq 0x1110
jmp 0x143e
leaq -0xf8(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq %rax, -0x140(%rbp)
leaq -0x143(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x1150
movq -0x1b0(%rbp), %rdi
movq -0x1a8(%rbp), %rdx
leaq 0x1bb8(%rip), %rsi      # 0x3033
callq 0x1110
jmp 0x1482
leaq -0xd8(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq %rax, -0x140(%rbp)
leaq -0x144(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x1150
movq -0x1c0(%rbp), %rdi
movq -0x1b8(%rbp), %rdx
leaq 0x1b7e(%rip), %rsi      # 0x303d
callq 0x1110
jmp 0x14c6
movb $0x0, -0x145(%rbp)
leaq -0x138(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq $0x4, -0xb0(%rbp)
leaq -0x146(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x19d0
movq -0x1c8(%rbp), %rcx
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
callq 0x19f0
jmp 0x151c
leaq -0x146(%rbp), %rdi
callq 0x1aa0
leaq -0x138(%rbp), %rax
movq %rax, -0x1d8(%rbp)
addq $0x80, %rax
movq %rax, -0x1d0(%rbp)
movq -0x1d0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x10a0
movq -0x1d8(%rbp), %rcx
movq -0x1e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1d0(%rbp)
jne 0x1543
leaq -0x144(%rbp), %rdi
callq 0x1100
leaq -0x143(%rbp), %rdi
callq 0x1100
leaq -0x142(%rbp), %rdi
callq 0x1100
leaq -0x141(%rbp), %rdi
callq 0x1100
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x1b30
movq -0x1f0(%rbp), %rdi
movq %rax, -0x158(%rbp)
callq 0x1b60
movq %rax, -0x160(%rbp)
movq -0x158(%rbp), %rdi
movq -0x160(%rbp), %rsi
leaq 0x1a4d(%rip), %rdx      # 0x3033
callq 0x1ac0
movq %rax, -0x1e8(%rbp)
jmp 0x15f4
movq -0x1e8(%rbp), %rax
movq %rax, -0x150(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x1b60
movq %rax, -0x168(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x1b90
movb %al, %cl
leaq 0x19ef(%rip), %rax      # 0x3020
leaq 0x19e4(%rip), %rsi      # 0x301c
testb %cl, %cl
cmovneq %rax, %rsi
movq 0x4993(%rip), %rdi      # 0x5fd8
callq 0x10d0
jmp 0x164c
movl $0x0, -0x4(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x1bc0
leaq -0x28(%rbp), %rdi
callq 0x1be0
movl -0x4(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x18a0
jmp 0x17f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x17e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x176a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x175e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1752
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x1746
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x146(%rbp), %rdi
callq 0x1aa0
leaq -0x138(%rbp), %rax
movq %rax, -0x200(%rbp)
addq $0x80, %rax
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x208(%rbp)
callq 0x10a0
movq -0x200(%rbp), %rcx
movq -0x208(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x1f8(%rbp)
jne 0x1713
jmp 0x1746
leaq -0x144(%rbp), %rdi
callq 0x1100
leaq -0x143(%rbp), %rdi
callq 0x1100
leaq -0x142(%rbp), %rdi
callq 0x1100
leaq -0x141(%rbp), %rdi
callq 0x1100
testb $0x1, -0x145(%rbp)
jne 0x1781
jmp 0x17ce
movq -0x140(%rbp), %rax
leaq -0x138(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x210(%rbp)
je 0x17cc
movq -0x210(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x218(%rbp)
callq 0x10a0
movq -0x218(%rbp), %rax
leaq -0x138(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x210(%rbp)
jne 0x179b
jmp 0x17ce
jmp 0x17e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x1bc0
leaq -0x28(%rbp), %rdi
callq 0x1be0
movq -0x60(%rbp), %rdi
callq 0x1140
nopw (%rax,%rax)