// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/exercises/ex16_24_main.cc
// Function: main
int main(int argc, char const *argv[])
{
	Blob<string> b1; // empty Blob
	cout << b1.size() << endl;
	{  // new scope
		Blob<string> b2 = {"a", "an", "the"};
		b1 = b2;  // b1 and b2 share the same elements
		b2.push_back("about");
		cout << b1.size() << " " << b2.size() << endl;
	} // b2 is destroyed, but the elements it points to must not be destroyed
	cout << b1.size() << endl;

	for(auto p = b1.begin(); p != b1.end(); ++p)
		cout << *p << endl;

	vector<string> vs = {"hello", "c++", "primer"};
	Blob<string> bs(begin(vs), end(vs));
	for (auto item : bs)
		cout << item << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
xorl %ebx, %ebx
movq %rbx, -0x38(%rbp)
movl $0x28, %edi
callq 0x2120
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x38fb(%rip), %rcx      # 0x5cf0
movq %rcx, (%rax)
leaq 0x10(%rax), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq %rbx, 0x20(%rax)
movq %rax, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movq 0x18(%rax), %rsi
sarq $0x5, %rsi
movq 0x3ba2(%rip), %rdi      # 0x5fc0
callq 0x20a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
leaq -0xb0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1ba5(%rip), %rsi      # 0x4004
leaq 0x1b9f(%rip), %rdx      # 0x4005
leaq -0xc0(%rbp), %r15
movq %r15, %rdi
callq 0x3078
leaq -0xa0(%rbp), %r14
leaq -0x90(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x1b78(%rip), %rsi      # 0x4006
leaq 0x1b73(%rip), %rdx      # 0x4008
movq %r14, %rdi
callq 0x3078
leaq -0x80(%rbp), %r14
leaq -0x70(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1b58(%rip), %rsi      # 0x4009
leaq 0x1b54(%rip), %rdx      # 0x400c
movq %r14, %rdi
callq 0x3078
leaq -0xc0(%rbp), %rax
leaq -0xd8(%rbp), %rcx
movq %rax, (%rcx)
movq $0x3, 0x8(%rcx)
leaq -0x48(%rbp), %rbx
movq $0x0, -0x8(%rbx)
leaq -0x50(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
movq %rbx, %rdi
callq 0x3112
leaq -0x30(%rbp), %r14
movq $-0x60, %r15
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x2519
movq (%r12), %rsi
incq %rsi
callq 0x2130
addq $-0x20, %r12
addq $0x20, %r15
jne 0x2503
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e88
leaq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
movq %rax, (%rdi)
leaq 0x1abf(%rip), %rsi      # 0x400d
leaq 0x1abd(%rip), %rdx      # 0x4012
callq 0x3078
movq -0x50(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x3196
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x258c
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x5, %rsi
movq 0x3a1e(%rip), %rdi      # 0x5fc0
callq 0x20a0
movq %rax, %rbx
leaq 0x1a62(%rip), %rsi      # 0x4013
movl $0x1, %edx
movq %rax, %rdi
callq 0x2140
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x5, %rsi
movq %rbx, %rdi
callq 0x20a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x260d
callq 0x2edc
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x5, %rsi
movq 0x399d(%rip), %rdi      # 0x5fc0
callq 0x20a0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0xc0(%rbp)
movq %rax, -0xb8(%rbp)
testq %rax, %rax
je 0x2682
movq 0x3944(%rip), %rcx      # 0x5fb8
cmpb $0x0, (%rcx)
je 0x267e
incl 0xc(%rax)
jmp 0x2682
lock
incl 0xc(%rax)
leaq -0xc0(%rbp), %rbx
movq $0x0, 0x10(%rbx)
leaq -0xd8(%rbp), %r14
movq 0x3921(%rip), %r15      # 0x5fc0
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
movq %rsi, -0xd8(%rbp)
movq %rdx, -0xd0(%rbp)
testq %rdx, %rdx
je 0x26d6
movq 0x38f0(%rip), %rsi      # 0x5fb8
cmpb $0x0, (%rsi)
je 0x26d2
incl 0xc(%rdx)
jmp 0x26d6
lock
incl 0xc(%rdx)
subq %rcx, %rax
sarq $0x5, %rax
movq %rax, -0xc8(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x33fe
movl %eax, %r12d
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x272a
movq 0x38b3(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
je 0x2715
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x271f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x272a
movq (%rdi), %rax
callq *0x18(%rax)
testb %r12b, %r12b
jne 0x277d
movq %rbx, %rdi
callq 0x2c84
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r15, %rdi
callq 0x2140
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x2d34
jmp 0x269f
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x27b5
movq 0x3828(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
je 0x27a0
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x27aa
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x27b5
movq (%rdi), %rax
callq *0x18(%rax)
leaq -0xc0(%rbp), %r15
leaq -0xb0(%rbp), %rax
movq %rax, (%r15)
leaq 0x1848(%rip), %rsi      # 0x4015
leaq 0x1846(%rip), %rdx      # 0x401a
movq %r15, %rdi
callq 0x3078
leaq -0xa0(%rbp), %r14
movq %r13, (%r14)
leaq 0x182e(%rip), %rsi      # 0x401b
leaq 0x182a(%rip), %rdx      # 0x401e
movq %r14, %rdi
callq 0x3078
leaq -0x80(%rbp), %r14
leaq -0x70(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x1810(%rip), %rsi      # 0x401f
leaq 0x180f(%rip), %rdx      # 0x4025
movq %r14, %rdi
callq 0x3078
leaq -0xd8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x50(%rbp), %rcx
movl $0x3, %edx
callq 0x2dd6
movq $-0x60, %r14
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0x2855
movq (%rbx), %rsi
incq %rsi
callq 0x2130
addq $-0x20, %rbx
addq $0x20, %r14
jne 0x2841
movq -0xd8(%rbp), %rax
movq -0xd0(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
movq %rax, (%rcx)
leaq -0x50(%rbp), %r8
movq %rdx, (%r8)
leaq -0x58(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x60(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x370e
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, -0x50(%rbp)
movq %rax, -0x48(%rbp)
testq %rax, %rax
je 0x28c4
movq 0x3702(%rip), %rcx      # 0x5fb8
cmpb $0x0, (%rcx)
je 0x28c0
incl 0xc(%rax)
jmp 0x28c4
lock
incl 0xc(%rax)
movq $0x0, -0x40(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
movq %rsi, -0xf0(%rbp)
movq %rdx, -0xe8(%rbp)
testq %rdx, %rdx
je 0x2903
movq 0x36c3(%rip), %rsi      # 0x5fb8
cmpb $0x0, (%rsi)
je 0x28ff
incl 0xc(%rdx)
jmp 0x2903
lock
incl 0xc(%rdx)
subq %rcx, %rax
sarq $0x5, %rax
leaq -0xf0(%rbp), %rbx
movq %rax, 0x10(%rbx)
leaq -0x50(%rbp), %r14
leaq -0xc0(%rbp), %r15
movq 0x3699(%rip), %r12      # 0x5fc0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x33fe
testb %al, %al
jne 0x29d1
movq %r14, %rdi
callq 0x2c84
leaq -0xb0(%rbp), %rcx
movq %rcx, -0xc0(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2f48
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq %r12, %rdi
callq 0x2140
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20b0
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x29c4
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2130
movq %r14, %rdi
callq 0x2d34
jmp 0x2927
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x2a09
movq 0x35d4(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
je 0x29f4
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x29fe
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x2a09
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2a3e
movq 0x359f(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
je 0x2a29
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x2a33
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x2a3e
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x2a4c
callq 0x2edc
leaq -0xd8(%rbp), %rdi
callq 0x2e1e
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x2a66
callq 0x2edc
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2c4c
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x2250
movb $0x1, %al
jmp 0x2aaa
jmp 0x2a9b
movq %rax, %rbx
xorl %eax, %eax
jmp 0x2aaa
movq %rax, %rbx
xorl %eax, %eax
movq %r15, %r14
cmpq %r14, %r15
sete %cl
orb %al, %cl
jne 0x2c6e
addq $-0x10, %r14
leaq -0xc0(%rbp), %r15
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x2ad7
movq (%r14), %rsi
incq %rsi
callq 0x2130
leaq -0x20(%r14), %rax
addq $-0x10, %r14
cmpq %r15, %r14
movq %rax, %r14
jne 0x2ac3
jmp 0x2c6e
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x2b86
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2130
jmp 0x2b86
jmp 0x2b83
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x21e6
movb $0x1, %al
jmp 0x2b41
jmp 0x2b32
movq %rax, %rbx
xorl %eax, %eax
jmp 0x2b41
movq %rax, %rbx
xorl %eax, %eax
movq %r15, %r14
cmpq %r14, %r15
sete %cl
orb %al, %cl
jne 0x2c6e
addq $-0x10, %r14
leaq -0xc0(%rbp), %r15
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x2b6e
movq (%r14), %rsi
incq %rsi
callq 0x2130
leaq -0x20(%r14), %rax
addq $-0x10, %r14
cmpq %r15, %r14
movq %rax, %r14
jne 0x2b5a
jmp 0x2c6e
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2c6e
callq 0x2edc
jmp 0x2c6e
movq %rax, %rbx
jmp 0x2c6e
jmp 0x2ba7
movq %rax, %rbx
jmp 0x2bd1
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x2bd1
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x2c09
movq 0x33d4(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
jne 0x2bf5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
jmp 0x2bfe
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x2c09
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2c3e
movq 0x339f(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
jne 0x2c2a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
jmp 0x2c33
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x2c3e
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x2c4c
callq 0x2edc
leaq -0xd8(%rbp), %rdi
callq 0x2e1e
jmp 0x2c6e
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x2c6e
callq 0x2220
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x2c7c
callq 0x2edc
movq %rbx, %rdi
callq 0x21b0