// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/examples/Array.cc
// Function: main
int main()
{
    Blob<int> ia;                // empty Blob<int>
	Blob<int> ia2 = {0,1,2,3,4}; // Blob<int> with five elements
	vector<int> v1(10, 0); // ten elements initialized to 0
    Blob<int> ia3(v1.begin(), v1.end());  // copy elements from v1
    cout << ia << "\n" << ia2 << "\n" << ia3 << endl;

    // these definitions instantiate two distinct Blob types
    Blob<string> names; // Blob that holds strings
    Blob<double> prices;// different element type

	// instantiates Blob<string> class and its
	//  initializer_list<const char*> constructor
	Blob<string> articles = {"a", "an", "the"}; // three elements

	// instantiates Blob<int> and the initializer_list<int> constructor
	Blob<int> squares = {0,1,2,3,4,5,6,7,8,9};

	// instantiates Blob<int>::size() const
    cout << squares << endl;
	for (size_t i = 0; i != squares.size(); ++i)
		squares[i] = i*i; // instantiates Blob<int>::operator[](size_t)
    cout << squares << endl;

	// instantiates the Blob<int> constructor that has
	// two vector<long>::iterator parameters
	vector<long> vl = {0,1,2,3,4,5,6,7,8,9};
	Blob<int> a1(vl.begin(), vl.end());   // copy from a vector

	// instantiates the Blob<int> class
	// and the Blob<int> constructor that has two int* parameters
	int arr[] = {0,1,2,3,4,5,6,7,8,9};
	Blob<int> a2(begin(arr), end(arr));   // copy from an array

	list<int> li(10, 0); // 10 elements all zeros
	Blob<int> zeros(li.begin(), li.end());  // copy from a list

    cout << a1 << "\n" << zeros << endl;

	a1.swap(zeros);
    cout << a1 << "\n" << zeros << endl;

	list<const char*> w = {"now", "is", "the", "time"};

	// instantiates the Blob<string> class and the Blob<string>
	// constructor that has two (list<const char*>::iterator parameters
	Blob<string> a3(w.begin(), w.end());  // copy from a list

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movl $0x28, %edi
callq 0x2120
movq %rax, %rbx
movabsq $0x100000001, %r13      # imm = 0x100000001
movq %r13, 0x8(%rax)
leaq 0x58c6(%rip), %rax      # 0x7c98
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movups 0x2c37(%rip), %xmm0     # 0x5020
leaq -0x220(%rbp), %rdx
movaps %xmm0, (%rdx)
movl $0x4, 0x10(%rdx)
leaq -0xa0(%rbp), %rcx
movq %rdx, (%rcx)
movq $0x5, 0x8(%rcx)
leaq -0xc8(%rbp), %rdi
movq %rax, -0x8(%rdi)
leaq -0xd0(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x329e
movl $0x28, %edi
callq 0x2120
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
xorl %esi, %esi
movq %rsi, 0x20(%rax)
movq %rax, %rdx
addq $0x28, %rdx
leaq -0x220(%rbp), %rcx
movq %rax, -0xb0(%rbp)
movq %rax, (%rcx)
leaq -0xa0(%rbp), %r8
movq %rdx, (%r8)
leaq -0xb8(%rbp), %rdi
movq %rsi, -0x8(%rdi)
leaq -0xc0(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x3404
movq %rbx, %rax
addq $0x10, %rax
movq %rax, -0x168(%rbp)
movq %rbx, -0x160(%rbp)
movq 0x5b26(%rip), %r15      # 0x7fc0
cmpb $0x0, (%r15)
je 0x24a5
incl 0x8(%rbx)
jmp 0x24a9
lock
incl 0x8(%rbx)
movq 0x5b18(%rip), %rdi      # 0x7fc8
leaq -0x168(%rbp), %rsi
callq 0x2f79
movq %rax, %r14
leaq 0x2bf2(%rip), %rsi      # 0x50b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x2140
movq -0xd0(%rbp), %rcx
movq -0xc8(%rbp), %rax
movq %rcx, -0x158(%rbp)
movq %rax, -0x150(%rbp)
testq %rax, %rax
je 0x2503
cmpb $0x0, (%r15)
je 0x24ff
incl 0x8(%rax)
jmp 0x2503
lock
incl 0x8(%rax)
leaq -0x158(%rbp), %rsi
movq %r14, %rdi
callq 0x2f79
movq %rax, %r14
leaq 0x2b9c(%rip), %rsi      # 0x50b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x2140
movq -0xc0(%rbp), %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0x148(%rbp)
movq %rax, -0x140(%rbp)
testq %rax, %rax
je 0x2559
cmpb $0x0, (%r15)
je 0x2555
incl 0x8(%rax)
jmp 0x2559
lock
incl 0x8(%rax)
leaq -0x148(%rbp), %rsi
movq %r14, %rdi
callq 0x2f79
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0x140(%rbp), %rdi
testq %rdi, %rdi
je 0x25a3
callq 0x31a2
movq -0x150(%rbp), %rdi
testq %rdi, %rdi
je 0x25b4
callq 0x31a2
movq -0x160(%rbp), %rdi
testq %rdi, %rdi
je 0x25c5
callq 0x31a2
movl $0x28, %edi
callq 0x2120
movq %r13, 0x8(%rax)
leaq 0x5736(%rip), %rcx      # 0x7d10
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq %rax, -0xa8(%rbp)
movq $0x0, 0x20(%rax)
movl $0x28, %edi
callq 0x2120
movq %rax, %r12
movq %r13, 0x8(%rax)
leaq 0x5755(%rip), %rax      # 0x7d60
movq %rax, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r12)
movq $0x0, 0x20(%r12)
leaq -0x210(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2a87(%rip), %rsi      # 0x50ba
leaq 0x2a81(%rip), %rdx      # 0x50bb
leaq -0x220(%rbp), %r13
movq %r13, %rdi
callq 0x364c
leaq -0x200(%rbp), %r14
leaq -0x1f0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2a5a(%rip), %rsi      # 0x50bc
leaq 0x2a55(%rip), %rdx      # 0x50be
movq %r14, %rdi
callq 0x364c
leaq -0x1e0(%rbp), %r14
leaq -0x1d0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x2a35(%rip), %rsi      # 0x50bf
leaq 0x2a31(%rip), %rdx      # 0x50c2
movq %r14, %rdi
callq 0x364c
leaq -0xa0(%rbp), %rcx
movq %r13, (%rcx)
movq $0x3, 0x8(%rcx)
leaq -0x1b0(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x1b8(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x38a4
movq $-0x60, %r14
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x26e5
movq (%r15), %rsi
incq %rsi
callq 0x2130
addq $-0x20, %r15
addq $0x20, %r14
jne 0x26d1
movaps 0x29aa(%rip), %xmm0     # 0x50a0
movaps %xmm0, -0x210(%rbp)
movaps 0x298c(%rip), %xmm0     # 0x5090
movaps %xmm0, -0x220(%rbp)
movabsq $0x900000008, %r15      # imm = 0x900000008
movq %r15, -0x200(%rbp)
leaq -0xa0(%rbp), %rcx
movq %r13, (%rcx)
movq $0xa, 0x8(%rcx)
leaq -0x50(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x58(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x329e
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, -0x138(%rbp)
movq %rax, -0x130(%rbp)
testq %rax, %rax
je 0x2777
movq 0x5857(%rip), %rcx      # 0x7fc0
cmpb $0x0, (%rcx)
je 0x2773
incl 0x8(%rax)
jmp 0x2777
lock
incl 0x8(%rax)
movq 0x584a(%rip), %rdi      # 0x7fc8
leaq -0x138(%rbp), %rsi
callq 0x2f79
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0x130(%rbp), %rdi
testq %rdi, %rdi
je 0x27c5
callq 0x31a2
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x2804
xorl %r14d, %r14d
leaq -0x58(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x300c
movl %r14d, %ecx
imull %r14d, %ecx
movl %ecx, (%rax)
incq %r14
movq -0x58(%rbp), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
cmpq %rcx, %r14
jne 0x27d9
movq %rax, -0x128(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x120(%rbp)
testq %rax, %rax
je 0x2830
movq 0x579e(%rip), %rcx      # 0x7fc0
cmpb $0x0, (%rcx)
je 0x282c
incl 0x8(%rax)
jmp 0x2830
lock
incl 0x8(%rax)
movq 0x5791(%rip), %rdi      # 0x7fc8
leaq -0x128(%rbp), %rsi
callq 0x2f79
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0x120(%rbp), %rdi
testq %rdi, %rdi
je 0x287e
callq 0x31a2
leaq 0x27b3(%rip), %rsi      # 0x5038
leaq -0x220(%rbp), %rax
movl $0xa, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rcx
movl $0xa, %edx
movq %rax, %rsi
callq 0x30a2
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
leaq -0x220(%rbp), %r14
movq %rax, (%r14)
leaq -0xa0(%rbp), %r8
movq %rcx, (%r8)
leaq -0x60(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x68(%rbp), %rsi
leaq -0x198(%rbp), %rdx
movq %r14, %rcx
callq 0x3bc0
leaq -0x1f8(%rbp), %rax
movaps 0x27a8(%rip), %xmm0     # 0x50a0
movaps %xmm0, -0x18(%rax)
movaps 0x278d(%rip), %xmm0     # 0x5090
movaps %xmm0, -0x28(%rax)
movq %r15, -0x8(%rax)
leaq -0xa0(%rbp), %rcx
movq %r14, (%rcx)
leaq -0x198(%rbp), %r8
movq %rax, (%r8)
leaq -0x1a0(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x1a8(%rbp), %rsi
leaq -0x180(%rbp), %rdx
callq 0x3d18
leaq -0xa0(%rbp), %rdx
movl $0x0, (%rdx)
leaq -0x198(%rbp), %r13
leaq -0x180(%rbp), %rcx
movl $0xa, %esi
movq %r13, %rdi
callq 0x30e8
movq 0x5650(%rip), %r15      # 0x7fc0
movq -0x198(%rbp), %rax
leaq -0xa0(%rbp), %rcx
movq %rax, (%rcx)
leaq -0x180(%rbp), %r8
movq %r13, (%r8)
leaq -0x40(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x48(%rbp), %rsi
leaq -0xd8(%rbp), %rdx
callq 0x3eac
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %rax
movq %rcx, -0x118(%rbp)
movq %rax, -0x110(%rbp)
testq %rax, %rax
je 0x29d1
cmpb $0x0, (%r15)
je 0x29cd
incl 0x8(%rax)
jmp 0x29d1
lock
incl 0x8(%rax)
movq 0x55f0(%rip), %rdi      # 0x7fc8
leaq -0x118(%rbp), %rsi
callq 0x2f79
movq %rax, %r14
leaq 0x26ca(%rip), %rsi      # 0x50b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x2140
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x108(%rbp)
movq %rax, -0x100(%rbp)
testq %rax, %rax
je 0x2a25
cmpb $0x0, (%r15)
je 0x2a21
incl 0x8(%rax)
jmp 0x2a25
lock
incl 0x8(%rax)
leaq -0x108(%rbp), %rsi
movq %r14, %rdi
callq 0x2f79
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x2a6f
callq 0x31a2
movq -0x110(%rbp), %rdi
testq %rdi, %rdi
je 0x2a80
callq 0x31a2
movups -0x68(%rbp), %xmm0
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x68(%rbp)
movups %xmm0, -0x48(%rbp)
movq %rax, -0x60(%rbp)
movq %rcx, -0xf8(%rbp)
movq %rax, -0xf0(%rbp)
testq %rax, %rax
je 0x2aba
cmpb $0x0, (%r15)
je 0x2ab6
incl 0x8(%rax)
jmp 0x2aba
lock
incl 0x8(%rax)
movq 0x5507(%rip), %rdi      # 0x7fc8
leaq -0xf8(%rbp), %rsi
callq 0x2f79
movq %rax, %r14
leaq 0x25e1(%rip), %rsi      # 0x50b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x2140
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0xe8(%rbp)
movq %rax, -0xe0(%rbp)
testq %rax, %rax
je 0x2b0e
cmpb $0x0, (%r15)
je 0x2b0a
incl 0x8(%rax)
jmp 0x2b0e
lock
incl 0x8(%rax)
leaq -0xe8(%rbp), %rsi
movq %r14, %rdi
callq 0x2f79
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0xe0(%rbp), %rdi
testq %rdi, %rdi
je 0x2b58
callq 0x31a2
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x2b69
callq 0x31a2
movups 0x5108(%rip), %xmm0     # 0x7c78
leaq -0xa0(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0x50e6(%rip), %xmm0     # 0x7c68
movaps %xmm0, (%rsi)
leaq -0x180(%rbp), %r14
leaq -0xd8(%rbp), %rcx
movl $0x4, %edx
movq %r14, %rdi
callq 0x313c
movq -0x180(%rbp), %rax
leaq -0xd8(%rbp), %rcx
movq %rax, (%rcx)
leaq -0x228(%rbp), %r8
movq %r14, (%r8)
leaq -0x98(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0xa0(%rbp), %rsi
leaq -0x31(%rbp), %rdx
callq 0x4054
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x2beb
callq 0x31a2
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0x2c0c
movq (%rdi), %r15
movl $0x18, %esi
callq 0x2130
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2bf7
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x2c1a
callq 0x31a2
movq -0x198(%rbp), %rdi
cmpq %r13, %rdi
je 0x2c3b
movq (%rdi), %r14
movl $0x18, %esi
callq 0x2130
movq %r14, %rdi
cmpq %r13, %r14
jne 0x2c26
movq -0x1a0(%rbp), %rdi
testq %rdi, %rdi
je 0x2c4c
callq 0x31a2
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x2c5a
callq 0x31a2
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x2c6f
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x2130
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2c7d
callq 0x31a2
movq -0x1b0(%rbp), %rdi
testq %rdi, %rdi
je 0x2c8e
callq 0x31a2
movq %r12, %rdi
callq 0x31a2
movq -0xa8(%rbp), %rdi
callq 0x31a2
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x2cb3
callq 0x31a2
movl $0x28, %esi
movq -0xb0(%rbp), %rdi
callq 0x2130
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x2cd5
callq 0x31a2
movq %rbx, %rdi
callq 0x31a2
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, -0x30(%rbp)
movq -0x180(%rbp), %rdi
cmpq %r14, %rdi
je 0x2e41
movq (%rdi), %r15
movl $0x18, %esi
callq 0x2130
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2d05
jmp 0x2e41
movq %rax, -0x30(%rbp)
jmp 0x2e41
movq %rax, -0x30(%rbp)
jmp 0x2e4f
movq %rax, -0x30(%rbp)
jmp 0x2e70
movq %rax, -0x30(%rbp)
jmp 0x2e81
movq %rax, -0x30(%rbp)
jmp 0x2e8f
jmp 0x2efe
movq %rax, -0x30(%rbp)
jmp 0x2f10
movq %rax, -0x30(%rbp)
leaq -0x1c0(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x2200
jmp 0x2f21
jmp 0x2d78
movq %rax, -0x30(%rbp)
addq $-0x10, %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x2d94
movq (%r14), %rsi
incq %rsi
callq 0x2130
leaq -0x20(%r14), %rax
addq $-0x10, %r14
cmpq %r13, %r14
movq %rax, %r14
jne 0x2d80
jmp 0x2f21
movq %rax, -0x30(%rbp)
jmp 0x2f21
movq %rax, -0x30(%rbp)
jmp 0x2f29
movq %rax, -0x30(%rbp)
jmp 0x2f35
movq %rax, -0x30(%rbp)
jmp 0x2f46
movq %rax, -0x30(%rbp)
jmp 0x2f57
movq %rax, -0x30(%rbp)
jmp 0x2f68
movq %rax, -0x30(%rbp)
jmp 0x2e12
movq %rax, -0x30(%rbp)
jmp 0x2e30
movq %rax, -0x30(%rbp)
jmp 0x2edf
movq %rax, -0x30(%rbp)
jmp 0x2ef0
movq %rax, -0x30(%rbp)
movq -0xe0(%rbp), %rdi
testq %rdi, %rdi
je 0x2e12
callq 0x31a2
movq -0xf0(%rbp), %rdi
jmp 0x2e37
movq %rax, -0x30(%rbp)
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x2e30
callq 0x31a2
movq -0x110(%rbp), %rdi
testq %rdi, %rdi
je 0x2e41
callq 0x31a2
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x2e4f
callq 0x31a2
movq -0x198(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e70
movq (%rdi), %r14
movl $0x18, %esi
callq 0x2130
movq %r14, %rdi
cmpq %r13, %r14
jne 0x2e5b
movq -0x1a0(%rbp), %rdi
testq %rdi, %rdi
je 0x2e81
callq 0x31a2
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x2e8f
callq 0x31a2
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x2f02
movq -0x70(%rbp), %rsi
subq %rdi, %rsi
callq 0x2130
jmp 0x2f02
movq %rax, -0x30(%rbp)
movq -0x120(%rbp), %rdi
jmp 0x2ebe
movq %rax, -0x30(%rbp)
movq -0x130(%rbp), %rdi
testq %rdi, %rdi
je 0x2f02
callq 0x31a2
jmp 0x2f02
movq %rax, -0x30(%rbp)
movq -0x140(%rbp), %rdi
testq %rdi, %rdi
je 0x2edf
callq 0x31a2
movq -0x150(%rbp), %rdi
testq %rdi, %rdi
je 0x2ef0
callq 0x31a2
movq -0x160(%rbp), %rdi
testq %rdi, %rdi
jne 0x2f30
jmp 0x2f35
movq %rax, -0x30(%rbp)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2f10
callq 0x31a2
movq -0x1b0(%rbp), %rdi
testq %rdi, %rdi
je 0x2f21
callq 0x31a2
movq %r12, %rdi
callq 0x31a2
movq -0xa8(%rbp), %rdi
callq 0x31a2
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x2f46
callq 0x31a2
movl $0x28, %esi
movq -0xb0(%rbp), %rdi
callq 0x2130
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x2f68
callq 0x31a2
movq %rbx, %rdi
callq 0x31a2
movq -0x30(%rbp), %rdi
callq 0x21d0