// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/examples/useBlob.cc
// Function: main
int main()
{
	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;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
xorl %ebx, %ebx
movq %rbx, -0x40(%rbp)
movl $0x28, %edi
callq 0x2120
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x392b(%rip), %rcx      # 0x5cf0
movq %rcx, (%rax)
leaq 0x10(%rax), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movq %rbx, 0x20(%rax)
movq %rax, -0x38(%rbp)
movq %rcx, -0x40(%rbp)
movq 0x18(%rax), %rsi
sarq $0x5, %rsi
movq 0x3bd2(%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 -0xb8(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1bd4(%rip), %rsi      # 0x4004
leaq 0x1bce(%rip), %rdx      # 0x4005
leaq -0xc8(%rbp), %r15
movq %r15, %rdi
callq 0x2b98
leaq -0xa8(%rbp), %r14
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x1ba7(%rip), %rsi      # 0x4006
leaq 0x1ba2(%rip), %rdx      # 0x4008
movq %r14, %rdi
callq 0x2b98
leaq -0x88(%rbp), %r14
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x1b85(%rip), %rsi      # 0x4009
leaq 0x1b81(%rip), %rdx      # 0x400c
movq %r14, %rdi
callq 0x2b98
leaq -0xc8(%rbp), %rax
leaq -0x68(%rbp), %rcx
movq %rax, (%rcx)
movq $0x3, 0x8(%rcx)
leaq -0x48(%rbp), %rbx
movq $0x0, -0x8(%rbx)
leaq -0x50(%rbp), %rsi
leaq -0x29(%rbp), %rdx
movq %rbx, %rdi
callq 0x2c32
leaq -0x38(%rbp), %r14
movq $-0x60, %r15
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x24e5
movq (%r13), %rsi
incq %rsi
callq 0x2130
addq $-0x20, %r13
addq $0x20, %r15
jne 0x24d0
movq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2998
leaq -0xc8(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x1afa(%rip), %rsi      # 0x400d
leaq 0x1af8(%rip), %rdx      # 0x4012
callq 0x2b98
movq -0x50(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x2eae
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x254a
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x5, %rsi
movq 0x3a60(%rip), %rdi      # 0x5fc0
callq 0x20a0
movq %rax, %rbx
leaq 0x1aa4(%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 0x25cb
callq 0x29ec
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x5, %rsi
movq 0x39df(%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 -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0xc8(%rbp)
movq %rax, -0xc0(%rbp)
testq %rax, %rax
je 0x2640
movq 0x3986(%rip), %rcx      # 0x5fb8
cmpb $0x0, (%rcx)
je 0x263c
incl 0xc(%rax)
jmp 0x2640
lock
incl 0xc(%rax)
leaq -0xc8(%rbp), %rbx
movq $0x0, 0x10(%rbx)
leaq -0x68(%rbp), %r14
movq 0x3966(%rip), %r15      # 0x5fc0
movq 0x3957(%rip), %r13      # 0x5fb8
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
movq %rsi, -0x68(%rbp)
movq %rdx, -0x60(%rbp)
testq %rdx, %rdx
je 0x268d
cmpb $0x0, (%r13)
je 0x2689
incl 0xc(%rdx)
jmp 0x268d
lock
incl 0xc(%rdx)
subq %rcx, %rax
sarq $0x5, %rax
movq %rax, -0x58(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30f8
movl %eax, %r12d
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x26d6
cmpb $0x0, (%r13)
je 0x26c1
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x26cb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x26d6
movq (%rdi), %rax
callq *0x18(%rax)
testb %r12b, %r12b
jne 0x2729
movq %rbx, %rdi
callq 0x2846
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 0x28f6
jmp 0x2661
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x275c
cmpb $0x0, (%r13)
je 0x2747
movl 0xc(%rdi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rdi)
jmp 0x2751
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0xc(%rdi)
cmpl $0x1, %eax
jne 0x275c
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x276a
callq 0x29ec
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r12, %rdi
je 0x2806
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x2130
jmp 0x2806
jmp 0x2803
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x21e6
movb $0x1, %al
jmp 0x27c8
jmp 0x27b9
movq %rax, %rbx
xorl %eax, %eax
jmp 0x27c8
movq %rax, %rbx
xorl %eax, %eax
movq %r15, %r14
cmpq %r14, %r15
sete %cl
orb %al, %cl
jne 0x282f
addq $-0x10, %r14
leaq -0xc8(%rbp), %r15
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x27f1
movq (%r14), %rsi
incq %rsi
callq 0x2130
leaq -0x20(%r14), %rax
addq $-0x10, %r14
cmpq %r15, %r14
movq %rax, %r14
jne 0x27dd
jmp 0x282f
movq %rax, %rbx
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x282f
callq 0x29ec
jmp 0x282f
movq %rax, %rbx
jmp 0x282f
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x282f
callq 0x2220
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x283d
callq 0x29ec
movq %rbx, %rdi
callq 0x21b0
nop