// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH13_CopyControl/examples/StrFolderMain.cc
// Function: main
int main()
{
	String s1("contents1");
	String s2("contents2");
	String s3("contents3");
	String s4("contents4");
	String s5("contents5");
	String s6("contents6");
	
	// all new messages, no copies yet
	Message m1(s1);
	Message m2(s2);
	Message m3(s3);
	Message m4(s4);
	Message m5(s5);
	Message m6(s6);

	Folder f1;
	Folder f2;

	m1.save(f1); m3.save(f1); m5.save(f1);
	m1.save(f2);
	m2.save(f2); m4.save(f2); m6.save(f2);
	
	m1.debug_print();
	f2.debug_print();

	// create some copies
	Message c1(m1);
	Message c2(m2), c4(m4), c6(m6);
	
	m1.debug_print();
	f2.debug_print();

	// now some assignments
	m2 = m3;
	m4 = m5;
	m6 = m3;
	m1 = m5;

	m1.debug_print();
	f2.debug_print();

	// finally, self-assignment
	m2 = m2;
	m1 = m1;

	m1.debug_print();
	f2.debug_print();

	vector<Message> vm;
	cout << "capacity: " << vm.capacity() << endl;
	vm.push_back(m1);

	cout << "capacity: " << vm.capacity() << endl;
	vm.push_back(m2);

	cout << "capacity: " << vm.capacity() << endl;
	vm.push_back(m3);

	cout << "capacity: " << vm.capacity() << endl;
	vm.push_back(m4);

	cout << "capacity: " << vm.capacity() << endl;
	vm.push_back(m5);

	cout << "capacity: " << vm.capacity() << endl;
	vm.push_back(m6);

	vector<Folder> vf;
	cout << "capacity: " << vf.capacity() << endl;
	vf.push_back(f1);

	cout << "capacity: " << vf.capacity() << endl;
	vf.push_back(f2);

	cout << "capacity: " << vf.capacity() << endl;
	vf.push_back(Folder(f1));

	cout << "capacity: " << vf.capacity() << endl;
	vf.push_back(Folder(f2));

	cout << "capacity: " << vf.capacity() << endl;
	vf.push_back(Folder());

	Folder f3;
	f3.save(m6);
	cout << "capacity: " << vf.capacity() << endl;
	vf.push_back(f3);


	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x3a8, %rsp            # imm = 0x3A8
leaq 0x20f5(%rip), %rsi      # 0x5094
leaq -0xb0(%rbp), %rdi
callq 0x3bca
leaq 0x20ec(%rip), %rsi      # 0x509e
leaq -0xa0(%rbp), %rdi
callq 0x3bca
leaq 0x20e3(%rip), %rsi      # 0x50a8
leaq -0x90(%rbp), %rdi
callq 0x3bca
leaq 0x20da(%rip), %rsi      # 0x50b2
leaq -0x80(%rbp), %rdi
callq 0x3bca
leaq 0x20d4(%rip), %rsi      # 0x50bc
leaq -0x70(%rbp), %rdi
callq 0x3bca
leaq 0x20ce(%rip), %rsi      # 0x50c6
leaq -0x60(%rbp), %rdi
callq 0x3bca
leaq -0x150(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x1dfc
leaq -0x138(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq -0x200(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x1dfc
leaq -0x1e8(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq -0x2c0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x1dfc
leaq -0x2a8(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq -0x280(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x1dfc
leaq -0x268(%rbp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq -0x240(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x1dfc
leaq -0x228(%rbp), %rax
movl $0x0, (%rax)
xorl %ebx, %ebx
movq %rbx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rbx, 0x20(%rax)
leaq -0x1c0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1dfc
leaq -0x1a8(%rbp), %rax
movl %ebx, (%rax)
movq %rbx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rbx, 0x20(%rax)
leaq -0x178(%rbp), %rax
movl %ebx, (%rax)
movq %rbx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rbx, 0x20(%rax)
leaq -0x108(%rbp), %rax
movl %ebx, (%rax)
movq %rbx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rbx, 0x20(%rax)
leaq -0x150(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x1a5a
leaq -0x2c0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x1a5a
leaq -0x240(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x1a5a
leaq -0x150(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1a5a
leaq -0x200(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1a5a
leaq -0x280(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1a5a
leaq -0x1c0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x1a5a
leaq -0x150(%rbp), %rdi
callq 0x1c60
leaq -0x110(%rbp), %rdi
callq 0x1b2a
leaq -0x3c0(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x170c
leaq -0x380(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x170c
leaq -0x340(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x170c
leaq -0x300(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x170c
leaq -0x150(%rbp), %rdi
callq 0x1c60
leaq -0x110(%rbp), %rdi
callq 0x1b2a
leaq -0x200(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x1868
leaq -0x280(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x1868
leaq -0x1c0(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x1868
leaq -0x150(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x1868
leaq -0x150(%rbp), %rdi
callq 0x1c60
leaq -0x110(%rbp), %rdi
callq 0x1b2a
leaq -0x200(%rbp), %rdi
movq %rdi, %rsi
callq 0x1868
leaq -0x150(%rbp), %rdi
movq %rdi, %rsi
callq 0x1868
leaq -0x150(%rbp), %rdi
callq 0x1c60
leaq -0x110(%rbp), %rdi
callq 0x1b2a
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq 0x4ccf(%rip), %rdi      # 0x7fd0
leaq 0x1dc8(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4cab(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0x50(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x3c14
movq 0x4c65(%rip), %rdi      # 0x7fd0
leaq 0x1d5e(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4c41(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0x50(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x3c14
movq 0x4bfb(%rip), %rdi      # 0x7fd0
leaq 0x1cf4(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4bd7(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0x50(%rbp), %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x3c14
movq 0x4b91(%rip), %rdi      # 0x7fd0
leaq 0x1c8a(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4b6d(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0x50(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x3c14
movq 0x4b27(%rip), %rdi      # 0x7fd0
leaq 0x1c20(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4b03(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0x50(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x3c14
movq 0x4abd(%rip), %rdi      # 0x7fd0
leaq 0x1bb6(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4a99(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0x50(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x3c14
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movq 0x4a44(%rip), %rdi      # 0x7fd0
leaq 0x1b3d(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r14, %rsi
movq 0x4a12(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0x30(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x3c50
movq 0x49cc(%rip), %rdi      # 0x7fd0
leaq 0x1ac5(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x49a4(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0x30(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x3c50
movq 0x495e(%rip), %rdi      # 0x7fd0
leaq 0x1a57(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x4936(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0xe0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x193c
leaq -0x30(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4238
leaq -0xe0(%rbp), %rdi
callq 0x19bc
movq 0x48d1(%rip), %rdi      # 0x7fd0
leaq 0x19ca(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x48a9(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0xe0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x193c
leaq -0x30(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4238
leaq -0xe0(%rbp), %rdi
callq 0x19bc
movq 0x4844(%rip), %rdi      # 0x7fd0
leaq 0x193d(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x481c(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0xd8(%rbp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r15)
xorl %eax, %eax
movq %rax, 0x8(%r15)
movq %r15, 0x10(%r15)
movq %r15, 0x18(%r15)
movq %rax, 0x20(%r15)
leaq -0x30(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4238
leaq -0xe0(%rbp), %rbx
movq %rbx, %rdi
callq 0x19bc
movl $0x0, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq %r15, 0x18(%rbx)
movq %r15, 0x20(%rbx)
movq %rax, 0x28(%rbx)
leaq -0xe0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x1a98
movq 0x477a(%rip), %rdi      # 0x7fd0
leaq 0x1873(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x4752(%rip), %rdi      # 0x7fd0
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10c0
leaq -0x30(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x3c50
leaq -0xe0(%rbp), %rdi
callq 0x19bc
leaq -0x30(%rbp), %rdi
callq 0x3c8c
leaq -0x50(%rbp), %rdi
callq 0x3ce2
leaq -0x300(%rbp), %rdi
callq 0x18a6
leaq -0x340(%rbp), %rdi
callq 0x18a6
leaq -0x380(%rbp), %rdi
callq 0x18a6
leaq -0x3c0(%rbp), %rdi
callq 0x18a6
leaq -0x110(%rbp), %rdi
callq 0x19bc
leaq -0x180(%rbp), %rdi
callq 0x19bc
leaq -0x1c0(%rbp), %rdi
callq 0x18a6
leaq -0x240(%rbp), %rdi
callq 0x18a6
leaq -0x280(%rbp), %rdi
callq 0x18a6
leaq -0x2c0(%rbp), %rdi
callq 0x18a6
leaq -0x200(%rbp), %rdi
callq 0x18a6
leaq -0x150(%rbp), %rdi
callq 0x18a6
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x397d
movq -0x60(%rbp), %rsi
callq 0x1120
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x398f
movq -0x70(%rbp), %rsi
callq 0x1120
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x39a1
movq -0x80(%rbp), %rsi
callq 0x1120
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x39b9
movq -0x90(%rbp), %rsi
callq 0x1120
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x39d1
movq -0xa0(%rbp), %rsi
callq 0x1120
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x39e9
movq -0xb0(%rbp), %rsi
callq 0x1120
xorl %eax, %eax
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a7e
jmp 0x3a7e
jmp 0x3a99
jmp 0x3a7e
jmp 0x3a99
movq %rax, %rbx
jmp 0x3abf
movq %rax, %rbx
jmp 0x3acb
movq %rax, %rbx
jmp 0x3ad7
jmp 0x3a8f
movq %rax, %rbx
jmp 0x3b07
movq %rax, %rbx
jmp 0x3b13
movq %rax, %rbx
jmp 0x3b1f
movq %rax, %rbx
jmp 0x3b2b
movq %rax, %rbx
jmp 0x3b37
movq %rax, %rbx
jmp 0x3b43
movq %rax, %rbx
jmp 0x3b55
movq %rax, %rbx
jmp 0x3b67
movq %rax, %rbx
jmp 0x3b79
movq %rax, %rbx
jmp 0x3b91
movq %rax, %rbx
jmp 0x3ba9
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x19bc
jmp 0x3a9c
movq %rax, %rbx
jmp 0x3ae3
movq %rax, %rbx
jmp 0x3ab3
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3c8c
jmp 0x3aaa
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3ce2
leaq -0x300(%rbp), %rdi
callq 0x18a6
leaq -0x340(%rbp), %rdi
callq 0x18a6
leaq -0x380(%rbp), %rdi
callq 0x18a6
leaq -0x3c0(%rbp), %rdi
callq 0x18a6
leaq -0x110(%rbp), %rdi
callq 0x19bc
leaq -0x180(%rbp), %rdi
callq 0x19bc
leaq -0x1c0(%rbp), %rdi
callq 0x18a6
leaq -0x240(%rbp), %rdi
callq 0x18a6
leaq -0x280(%rbp), %rdi
callq 0x18a6
leaq -0x2c0(%rbp), %rdi
callq 0x18a6
leaq -0x200(%rbp), %rdi
callq 0x18a6
leaq -0x150(%rbp), %rdi
callq 0x18a6
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x3b55
movq -0x60(%rbp), %rsi
callq 0x1120
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x3b67
movq -0x70(%rbp), %rsi
callq 0x1120
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x3b79
movq -0x80(%rbp), %rsi
callq 0x1120
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x3b91
movq -0x90(%rbp), %rsi
callq 0x1120
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x3ba9
movq -0xa0(%rbp), %rsi
callq 0x1120
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x3bc1
movq -0xb0(%rbp), %rsi
callq 0x1120
movq %rbx, %rdi
callq 0x11b0
nop