// File: /workspace/github_cpp_makefile_star2_O1/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 $0x218, %rsp            # imm = 0x218
movl $0x28, %edi
callq 0x2120
movq %rax, %rbx
movabsq $0x100000001, %r13      # imm = 0x100000001
movq %r13, 0x8(%rax)
leaq 0x588e(%rip), %rax      # 0x7c60
movq %rax, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movups 0x2c37(%rip), %xmm0     # 0x5020
leaq -0x230(%rbp), %rdx
movaps %xmm0, (%rdx)
movl $0x4, 0x10(%rdx)
leaq -0xa0(%rbp), %rcx
movq %rdx, (%rcx)
movq $0x5, 0x8(%rcx)
leaq -0xd8(%rbp), %rdi
movq %rax, -0x8(%rdi)
leaq -0xe0(%rbp), %rsi
leaq -0x78(%rbp), %rdx
movq %rbx, -0xc0(%rbp)
callq 0x32c0
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 -0x230(%rbp), %rcx
movq %rax, -0xb8(%rbp)
movq %rax, (%rcx)
leaq -0xa0(%rbp), %r8
movq %rdx, (%r8)
leaq -0xc8(%rbp), %rdi
movq %rsi, -0x8(%rdi)
leaq -0xd0(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x3434
movq %rbx, %rax
addq $0x10, %rax
movq %rax, -0x178(%rbp)
movq %rbx, -0x170(%rbp)
movq 0x5b1f(%rip), %r15      # 0x7fc0
cmpb $0x0, (%r15)
je 0x24ac
incl 0x8(%rbx)
jmp 0x24b0
lock
incl 0x8(%rbx)
movq 0x5b11(%rip), %rdi      # 0x7fc8
leaq -0x178(%rbp), %rsi
callq 0x2f83
movq %rax, %r14
leaq 0x2beb(%rip), %rsi      # 0x50b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x2140
movq -0xe0(%rbp), %rcx
movq -0xd8(%rbp), %rax
movq %rcx, -0x168(%rbp)
movq %rax, -0x160(%rbp)
testq %rax, %rax
je 0x250a
cmpb $0x0, (%r15)
je 0x2506
incl 0x8(%rax)
jmp 0x250a
lock
incl 0x8(%rax)
leaq -0x168(%rbp), %rsi
movq %r14, %rdi
callq 0x2f83
movq %rax, %r14
leaq 0x2b95(%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 0x2560
cmpb $0x0, (%r15)
je 0x255c
incl 0x8(%rax)
jmp 0x2560
lock
incl 0x8(%rax)
leaq -0x158(%rbp), %rsi
movq %r14, %rdi
callq 0x2f83
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 -0x150(%rbp), %rdi
testq %rdi, %rdi
je 0x25aa
callq 0x31ac
movq -0x160(%rbp), %rdi
testq %rdi, %rdi
je 0x25bb
callq 0x31ac
movq -0x170(%rbp), %rdi
testq %rdi, %rdi
je 0x25cc
callq 0x31ac
movl $0x28, %edi
callq 0x2120
movq %r13, 0x8(%rax)
leaq 0x572f(%rip), %rcx      # 0x7d10
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq %rax, -0xb0(%rbp)
movq $0x0, 0x20(%rax)
movl $0x28, %edi
callq 0x2120
movq %r13, 0x8(%rax)
leaq 0x5751(%rip), %rcx      # 0x7d60
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq %rax, -0xa8(%rbp)
movq $0x0, 0x20(%rax)
leaq -0x220(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2a80(%rip), %rsi      # 0x50ba
leaq 0x2a7a(%rip), %rdx      # 0x50bb
leaq -0x230(%rbp), %r14
movq %r14, %rdi
callq 0x368a
leaq -0x210(%rbp), %r13
leaq -0x200(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2a53(%rip), %rsi      # 0x50bc
leaq 0x2a4e(%rip), %rdx      # 0x50be
movq %r13, %rdi
callq 0x368a
movq %r15, %rbx
leaq -0x1f0(%rbp), %r13
leaq -0x1e0(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x2a2b(%rip), %rsi      # 0x50bf
leaq 0x2a27(%rip), %rdx      # 0x50c2
movq %r13, %rdi
callq 0x368a
leaq -0x230(%rbp), %r12
leaq -0xa0(%rbp), %rcx
movq %r12, (%rcx)
movq $0x3, 0x8(%rcx)
leaq -0x1c0(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x1c8(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x38e8
movq $-0x60, %r14
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x26f6
movq (%r15), %rsi
incq %rsi
callq 0x2130
addq $-0x20, %r15
addq $0x20, %r14
jne 0x26e2
movaps 0x2999(%rip), %xmm0     # 0x50a0
movaps %xmm0, -0x220(%rbp)
movaps 0x297b(%rip), %xmm0     # 0x5090
movaps %xmm0, -0x230(%rbp)
movabsq $0x900000008, %r15      # imm = 0x900000008
movq %r15, -0x210(%rbp)
leaq -0xa0(%rbp), %rcx
movq %r12, (%rcx)
movq $0xa, 0x8(%rcx)
leaq -0x48(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x50(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x32c0
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x148(%rbp)
movq %rax, -0x140(%rbp)
testq %rax, %rax
je 0x2781
cmpb $0x0, (%rbx)
je 0x277d
incl 0x8(%rax)
jmp 0x2781
lock
incl 0x8(%rax)
movq 0x5840(%rip), %rdi      # 0x7fc8
leaq -0x148(%rbp), %rsi
callq 0x2f83
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 0x27cf
callq 0x31ac
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x280e
xorl %r14d, %r14d
leaq -0x50(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x3016
movl %r14d, %ecx
imull %r14d, %ecx
movl %ecx, (%rax)
incq %r14
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
cmpq %rcx, %r14
jne 0x27e3
movq %rax, -0x138(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x130(%rbp)
testq %rax, %rax
je 0x2833
cmpb $0x0, (%rbx)
je 0x282f
incl 0x8(%rax)
jmp 0x2833
lock
incl 0x8(%rax)
movq 0x578e(%rip), %rdi      # 0x7fc8
leaq -0x138(%rbp), %rsi
callq 0x2f83
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 0x2881
callq 0x31ac
leaq 0x27b0(%rip), %rsi      # 0x5038
leaq -0x230(%rbp), %rax
movl $0xa, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x78(%rbp), %rdi
leaq -0xa0(%rbp), %rcx
movl $0xa, %edx
movq %rax, %rsi
callq 0x30ac
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rcx
leaq -0x230(%rbp), %r14
movq %rax, (%r14)
leaq -0xa0(%rbp), %r8
movq %rcx, (%r8)
leaq -0x58(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x60(%rbp), %rsi
leaq -0x1a8(%rbp), %rdx
movq %r14, %rcx
callq 0x3c0e
leaq -0x208(%rbp), %rax
movaps 0x27a5(%rip), %xmm0     # 0x50a0
movaps %xmm0, -0x18(%rax)
movaps 0x278a(%rip), %xmm0     # 0x5090
movaps %xmm0, -0x28(%rax)
movq %r15, -0x8(%rax)
leaq -0xa0(%rbp), %rcx
movq %r14, (%rcx)
leaq -0x1a8(%rbp), %r8
movq %rax, (%r8)
leaq -0x1b0(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x1b8(%rbp), %rsi
leaq -0x190(%rbp), %rdx
callq 0x3d5e
leaq -0xa0(%rbp), %rdx
movl $0x0, (%rdx)
leaq -0x1a8(%rbp), %r13
leaq -0x190(%rbp), %rcx
movl $0xa, %esi
movq %r13, %rdi
callq 0x30f2
movq -0x1a8(%rbp), %rax
leaq -0xa0(%rbp), %rcx
movq %rax, (%rcx)
leaq -0x190(%rbp), %r8
movq %r13, (%r8)
leaq -0x38(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x40(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
callq 0x3f00
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, -0x128(%rbp)
movq %rax, -0x120(%rbp)
testq %rax, %rax
je 0x29cc
cmpb $0x0, (%rbx)
je 0x29c8
incl 0x8(%rax)
jmp 0x29cc
lock
incl 0x8(%rax)
movq 0x55f5(%rip), %rdi      # 0x7fc8
leaq -0x128(%rbp), %rsi
callq 0x2f83
movq %rax, %r14
leaq 0x26cf(%rip), %rsi      # 0x50b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x2140
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x118(%rbp)
movq %rax, -0x110(%rbp)
testq %rax, %rax
je 0x2a1f
cmpb $0x0, (%rbx)
je 0x2a1b
incl 0x8(%rax)
jmp 0x2a1f
lock
incl 0x8(%rax)
leaq -0x118(%rbp), %rsi
movq %r14, %rdi
callq 0x2f83
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 -0x110(%rbp), %rdi
testq %rdi, %rdi
je 0x2a69
callq 0x31ac
movq -0x120(%rbp), %rdi
testq %rdi, %rdi
je 0x2a7a
callq 0x31ac
movups -0x60(%rbp), %xmm0
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x60(%rbp)
movups %xmm0, -0x40(%rbp)
movq %rax, -0x58(%rbp)
movq %rcx, -0x108(%rbp)
movq %rax, -0x100(%rbp)
testq %rax, %rax
je 0x2ab3
cmpb $0x0, (%rbx)
je 0x2aaf
incl 0x8(%rax)
jmp 0x2ab3
lock
incl 0x8(%rax)
movq 0x550e(%rip), %rdi      # 0x7fc8
leaq -0x108(%rbp), %rsi
callq 0x2f83
movq %rax, %r14
leaq 0x25e8(%rip), %rsi      # 0x50b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x2140
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0xf8(%rbp)
movq %rax, -0xf0(%rbp)
testq %rax, %rax
je 0x2b06
cmpb $0x0, (%rbx)
je 0x2b02
incl 0x8(%rax)
jmp 0x2b06
lock
incl 0x8(%rax)
leaq -0xf8(%rbp), %rsi
movq %r14, %rdi
callq 0x2f83
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 -0xf0(%rbp), %rdi
testq %rdi, %rdi
movq -0xc0(%rbp), %rbx
je 0x2b57
callq 0x31ac
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x2b68
callq 0x31ac
movups 0x50d1(%rip), %xmm0     # 0x7c40
leaq -0xa0(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0x50af(%rip), %xmm0     # 0x7c30
movaps %xmm0, (%rsi)
leaq -0x190(%rbp), %r14
leaq -0xe8(%rbp), %rcx
movl $0x4, %edx
movq %r14, %rdi
callq 0x3146
movq -0x190(%rbp), %rax
leaq -0xe8(%rbp), %rcx
movq %rax, (%rcx)
leaq -0x238(%rbp), %r8
movq %r14, (%r8)
leaq -0x98(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0xa0(%rbp), %rsi
leaq -0x29(%rbp), %rdx
callq 0x409e
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x2bea
callq 0x31ac
movq -0x190(%rbp), %rdi
cmpq %r14, %rdi
je 0x2c0b
movq (%rdi), %r15
movl $0x18, %esi
callq 0x2130
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2bf6
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x2c19
callq 0x31ac
movq -0x1a8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2c3a
movq (%rdi), %r14
movl $0x18, %esi
callq 0x2130
movq %r14, %rdi
cmpq %r13, %r14
jne 0x2c25
movq -0x1b0(%rbp), %rdi
testq %rdi, %rdi
je 0x2c4b
callq 0x31ac
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x2c59
callq 0x31ac
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x2c6e
movq -0x68(%rbp), %rsi
subq %rdi, %rsi
callq 0x2130
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2c7c
callq 0x31ac
movq -0x1c0(%rbp), %rdi
testq %rdi, %rdi
je 0x2c8d
callq 0x31ac
movq -0xa8(%rbp), %rdi
callq 0x31ac
movq -0xb0(%rbp), %rdi
callq 0x31ac
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x2cb6
callq 0x31ac
movl $0x28, %esi
movq -0xb8(%rbp), %rdi
callq 0x2130
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x2cd8
callq 0x31ac
movq %rbx, %rdi
callq 0x31ac
xorl %eax, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x190(%rbp), %rdi
cmpq %r14, %rdi
je 0x2e48
movq (%rdi), %r15
movl $0x18, %esi
callq 0x2130
movq %r15, %rdi
cmpq %r14, %r15
jne 0x2d07
jmp 0x2e48
movq %rax, %rbx
jmp 0x2e48
movq %rax, %rbx
jmp 0x2e56
movq %rax, %rbx
jmp 0x2e77
movq %rax, %rbx
jmp 0x2e88
movq %rax, %rbx
jmp 0x2e96
jmp 0x2f02
movq %rax, %rbx
jmp 0x2f13
movq %rax, %rbx
leaq -0x1d0(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x2206
movb $0x1, %al
jmp 0x2d81
jmp 0x2d72
movq %rax, %rbx
xorl %eax, %eax
jmp 0x2d81
movq %rax, %rbx
xorl %eax, %eax
movq %r14, %r13
cmpq %r13, %r14
sete %cl
orb %al, %cl
jne 0x2f24
addq $-0x10, %r13
leaq -0x230(%rbp), %r14
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x2daf
movq (%r13), %rsi
incq %rsi
callq 0x2130
leaq -0x20(%r13), %rax
addq $-0x10, %r13
cmpq %r14, %r13
movq %rax, %r13
jne 0x2d9a
jmp 0x2f24
movq %rax, %rbx
jmp 0x2f30
movq %rax, %rbx
jmp 0x2f3c
movq %rax, %rbx
jmp 0x2f4d
movq %rax, %rbx
jmp 0x2f5e
movq %rax, %rbx
jmp 0x2f6f
movq %rax, %rbx
jmp 0x2e1a
movq %rax, %rbx
jmp 0x2e37
movq %rax, %rbx
jmp 0x2ee3
movq %rax, %rbx
jmp 0x2ef4
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x2e1a
callq 0x31ac
movq -0x100(%rbp), %rdi
jmp 0x2e3e
movq %rax, %rbx
movq -0x110(%rbp), %rdi
testq %rdi, %rdi
je 0x2e37
callq 0x31ac
movq -0x120(%rbp), %rdi
testq %rdi, %rdi
je 0x2e48
callq 0x31ac
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x2e56
callq 0x31ac
movq -0x1a8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e77
movq (%rdi), %r14
movl $0x18, %esi
callq 0x2130
movq %r14, %rdi
cmpq %r13, %r14
jne 0x2e62
movq -0x1b0(%rbp), %rdi
testq %rdi, %rdi
je 0x2e88
callq 0x31ac
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x2e96
callq 0x31ac
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x2f05
movq -0x68(%rbp), %rsi
subq %rdi, %rsi
callq 0x2130
jmp 0x2f05
movq %rax, %rbx
movq -0x130(%rbp), %rdi
jmp 0x2ec3
movq %rax, %rbx
movq -0x140(%rbp), %rdi
testq %rdi, %rdi
je 0x2f05
callq 0x31ac
jmp 0x2f05
movq %rax, %rbx
movq -0x150(%rbp), %rdi
testq %rdi, %rdi
je 0x2ee3
callq 0x31ac
movq -0x160(%rbp), %rdi
testq %rdi, %rdi
je 0x2ef4
callq 0x31ac
movq -0x170(%rbp), %rdi
testq %rdi, %rdi
jne 0x2f37
jmp 0x2f3c
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2f13
callq 0x31ac
movq -0x1c0(%rbp), %rdi
testq %rdi, %rdi
je 0x2f24
callq 0x31ac
movq -0xa8(%rbp), %rdi
callq 0x31ac
movq -0xb0(%rbp), %rdi
callq 0x31ac
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x2f4d
callq 0x31ac
movl $0x28, %esi
movq -0xb8(%rbp), %rdi
callq 0x2130
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x2f6f
callq 0x31ac
movq -0xc0(%rbp), %rdi
callq 0x31ac
movq %rbx, %rdi
callq 0x21d0