// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x28, %edi
callq 0x2120
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x3939(%rip), %rcx      # 0x5d28
movq %rcx, (%rax)
leaq 0x10(%rax), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movq 0x3bac(%rip), %rdi      # 0x5fc0
xorl %esi, %esi
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 -0xc8(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1bad(%rip), %rsi      # 0x4004
leaq 0x1ba7(%rip), %rdx      # 0x4005
leaq -0xd8(%rbp), %r14
movq %r14, %rdi
callq 0x300c
leaq -0xb8(%rbp), %r15
leaq -0xa8(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x1b80(%rip), %rsi      # 0x4006
leaq 0x1b7b(%rip), %rdx      # 0x4008
movq %r15, %rdi
callq 0x300c
leaq -0x98(%rbp), %r15
leaq -0x88(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1b5a(%rip), %rsi      # 0x4009
leaq 0x1b56(%rip), %rdx      # 0x400c
movq %r15, %rdi
callq 0x300c
leaq -0x78(%rbp), %rcx
movq %r14, (%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 0x30aa
leaq -0x30(%rbp), %r14
movq $-0x60, %r15
movq -0x10(%r12), %rdi
cmpq %rdi, %r12
je 0x250d
movq (%r12), %rsi
incq %rsi
callq 0x2130
addq $-0x20, %r12
addq $0x20, %r15
jne 0x24f7
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2e2c
leaq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
movq %rax, (%rdi)
leaq 0x1acb(%rip), %rsi      # 0x400d
leaq 0x1ac9(%rip), %rdx      # 0x4012
callq 0x300c
movq -0x50(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x312e
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x2580
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x5, %rsi
movq 0x3a2a(%rip), %rdi      # 0x5fc0
callq 0x20a0
movq %rax, %rbx
leaq 0x1a6e(%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 0x2601
callq 0x2e84
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x5, %rsi
movq 0x39a9(%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, -0xd8(%rbp)
movq %rax, -0xd0(%rbp)
testq %rax, %rax
je 0x2676
movq 0x3950(%rip), %rcx      # 0x5fb8
cmpb $0x0, (%rcx)
je 0x2672
incl 0xc(%rax)
jmp 0x2676
lock
incl 0xc(%rax)
leaq -0xd8(%rbp), %rbx
movq $0x0, 0x10(%rbx)
leaq -0x78(%rbp), %r14
movq 0x3930(%rip), %r15      # 0x5fc0
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
movq %rsi, -0x78(%rbp)
movq %rdx, -0x70(%rbp)
testq %rdx, %rdx
je 0x26c1
movq 0x3905(%rip), %rsi      # 0x5fb8
cmpb $0x0, (%rsi)
je 0x26bd
incl 0xc(%rdx)
jmp 0x26c1
lock
incl 0xc(%rdx)
subq %rcx, %rax
sarq $0x5, %rax
movq %rax, -0x68(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3396
movl %eax, %r12d
movq -0x70(%rbp), %rdi
testq %rdi, %rdi
je 0x270f
movq 0x38ce(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
je 0x26fa
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x2704
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x270f
movq (%rdi), %rax
callq *0x18(%rax)
testb %r12b, %r12b
jne 0x2762
movq %rbx, %rdi
callq 0x2c24
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 0x2cd4
jmp 0x2690
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x279a
movq 0x3843(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
je 0x2785
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x278f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x279a
movq (%rdi), %rax
callq *0x18(%rax)
leaq -0xd8(%rbp), %r14
leaq -0xc8(%rbp), %rax
movq %rax, (%r14)
leaq 0x1863(%rip), %rsi      # 0x4015
leaq 0x1861(%rip), %rdx      # 0x401a
movq %r14, %rdi
callq 0x300c
leaq -0xb8(%rbp), %r15
movq %r13, (%r15)
leaq 0x1849(%rip), %rsi      # 0x401b
leaq 0x1845(%rip), %rdx      # 0x401e
movq %r15, %rdi
callq 0x300c
leaq -0x98(%rbp), %r15
leaq -0x88(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x1825(%rip), %rsi      # 0x401f
leaq 0x1824(%rip), %rdx      # 0x4025
movq %r15, %rdi
callq 0x300c
leaq -0x78(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0x50(%rbp), %rcx
movl $0x3, %edx
callq 0x2d76
movq $-0x60, %r14
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0x283d
movq (%rbx), %rsi
incq %rsi
callq 0x2130
addq $-0x20, %rbx
addq $0x20, %r14
jne 0x2829
movq -0x78(%rbp), %rax
movq -0x70(%rbp), %rdx
leaq -0xd8(%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 0x3674
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rax, -0x50(%rbp)
movq %rcx, -0x48(%rbp)
testq %rcx, %rcx
je 0x28aa
movq 0x3720(%rip), %rdx      # 0x5fb8
cmpb $0x0, (%rdx)
je 0x28a2
incl 0xc(%rcx)
jmp 0x28aa
lock
incl 0xc(%rcx)
movq -0x60(%rbp), %rax
movq $0x0, -0x40(%rbp)
movq (%rax), %rdx
movq 0x8(%rax), %rcx
movq %rax, -0xf0(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xe8(%rbp)
testq %rax, %rax
je 0x28e5
movq 0x36e1(%rip), %rsi      # 0x5fb8
cmpb $0x0, (%rsi)
je 0x28e1
incl 0xc(%rax)
jmp 0x28e5
lock
incl 0xc(%rax)
subq %rdx, %rcx
sarq $0x5, %rcx
leaq -0xf0(%rbp), %rbx
movq %rcx, 0x10(%rbx)
leaq -0x50(%rbp), %r14
leaq -0xd8(%rbp), %r15
movq 0x36b7(%rip), %r12      # 0x5fc0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3396
testb %al, %al
jne 0x29b3
movq %r14, %rdi
callq 0x2c24
leaq -0xc8(%rbp), %rcx
movq %rcx, -0xd8(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2ef0
movq -0xd8(%rbp), %rsi
movq -0xd0(%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 -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x29a6
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2130
movq %r14, %rdi
callq 0x2cd4
jmp 0x2909
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x29eb
movq 0x35f2(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
je 0x29d6
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x29e0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x29eb
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2a20
movq 0x35bd(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
je 0x2a0b
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x2a15
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x2a20
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x2a2e
callq 0x2e84
leaq -0x78(%rbp), %rdi
callq 0x2dbe
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x2a45
callq 0x2e84
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2bee
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x224a
jmp 0x2c0d
jmp 0x2a7b
movq %rax, %rbx
addq $-0x10, %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x2a96
movq (%r15), %rsi
incq %rsi
callq 0x2130
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x2a82
jmp 0x2c0d
jmp 0x2b3f
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x2b28
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2130
jmp 0x2b28
jmp 0x2b25
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x21e0
jmp 0x2c0d
jmp 0x2af3
movq %rax, %rbx
addq $-0x10, %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x2b0e
movq (%r15), %rsi
incq %rsi
callq 0x2130
leaq -0x20(%r15), %rax
addq $-0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x2afa
jmp 0x2c0d
jmp 0x2b3f
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2c0d
callq 0x2e84
jmp 0x2c0d
movq %rax, %rbx
jmp 0x2c0d
jmp 0x2b49
movq %rax, %rbx
jmp 0x2b73
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x2b73
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x2bab
movq 0x3432(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
jne 0x2b97
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
jmp 0x2ba0
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x2bab
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2be0
movq 0x33fd(%rip), %rax      # 0x5fb8
cmpb $0x0, (%rax)
jne 0x2bcc
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
jmp 0x2bd5
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x2be0
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x2bee
callq 0x2e84
leaq -0x78(%rbp), %rdi
callq 0x2dbe
jmp 0x2c0d
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x2c0d
callq 0x221a
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x2c1b
callq 0x2e84
movq %rbx, %rdi
callq 0x21b0
nop