// File: /workspace/github_cpp_makefile_star2_O1/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 0x20e9(%rip), %rsi      # 0x5094
leaq -0xb0(%rbp), %rdi
callq 0x3bde
leaq 0x20e0(%rip), %rsi      # 0x509e
leaq -0xa0(%rbp), %rdi
callq 0x3bde
leaq 0x20d7(%rip), %rsi      # 0x50a8
leaq -0x90(%rbp), %rdi
callq 0x3bde
leaq 0x20ce(%rip), %rsi      # 0x50b2
leaq -0x80(%rbp), %rdi
callq 0x3bde
leaq 0x20c8(%rip), %rsi      # 0x50bc
leaq -0x70(%rbp), %rdi
callq 0x3bde
leaq 0x20c2(%rip), %rsi      # 0x50c6
leaq -0x60(%rbp), %rdi
callq 0x3bde
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 0x4cc3(%rip), %rdi      # 0x7fd0
leaq 0x1dbc(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4c9f(%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 0x3c28
movq 0x4c59(%rip), %rdi      # 0x7fd0
leaq 0x1d52(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4c35(%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 0x3c28
movq 0x4bef(%rip), %rdi      # 0x7fd0
leaq 0x1ce8(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4bcb(%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 0x3c28
movq 0x4b85(%rip), %rdi      # 0x7fd0
leaq 0x1c7e(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4b61(%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 0x3c28
movq 0x4b1b(%rip), %rdi      # 0x7fd0
leaq 0x1c14(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4af7(%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 0x3c28
movq 0x4ab1(%rip), %rdi      # 0x7fd0
leaq 0x1baa(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x40(%rbp), %rsi
subq -0x50(%rbp), %rsi
sarq $0x6, %rsi
movq 0x4a8d(%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 0x3c28
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movq $0x0, -0x20(%rbp)
movq 0x4a38(%rip), %rdi      # 0x7fd0
leaq 0x1b31(%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 0x4a06(%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 0x3c64
movq 0x49c0(%rip), %rdi      # 0x7fd0
leaq 0x1ab9(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x4998(%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 0x3c64
movq 0x4952(%rip), %rdi      # 0x7fd0
leaq 0x1a4b(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x492a(%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 0x421c
leaq -0xe0(%rbp), %rdi
callq 0x19bc
movq 0x48c5(%rip), %rdi      # 0x7fd0
leaq 0x19be(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x489d(%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 0x421c
leaq -0xe0(%rbp), %rdi
callq 0x19bc
movq 0x4838(%rip), %rdi      # 0x7fd0
leaq 0x1931(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x4810(%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)
movaps %xmm0, 0x18(%r15)
movaps %xmm0, -0x8(%r15)
movq %r15, 0x10(%r15)
movq %r15, 0x18(%r15)
movq $0x0, 0x20(%r15)
leaq -0x30(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x421c
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 0x4766(%rip), %rdi      # 0x7fd0
leaq 0x185f(%rip), %rsi      # 0x50d0
movl $0xa, %edx
callq 0x1140
movq -0x20(%rbp), %rsi
subq -0x30(%rbp), %rsi
sarq $0x4, %rsi
imulq %r14, %rsi
movq 0x473e(%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 0x3c64
leaq -0xe0(%rbp), %rdi
callq 0x19bc
leaq -0x30(%rbp), %rdi
callq 0x3ca0
leaq -0x50(%rbp), %rdi
callq 0x3cf0
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 0x3991
movq -0x60(%rbp), %rsi
callq 0x1120
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x39a3
movq -0x70(%rbp), %rsi
callq 0x1120
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x39b5
movq -0x80(%rbp), %rsi
callq 0x1120
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x39cd
movq -0x90(%rbp), %rsi
callq 0x1120
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x39e5
movq -0xa0(%rbp), %rsi
callq 0x1120
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x39fd
movq -0xb0(%rbp), %rsi
callq 0x1120
xorl %eax, %eax
addq $0x3a8, %rsp            # imm = 0x3A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a92
jmp 0x3a92
jmp 0x3aad
jmp 0x3a92
jmp 0x3aad
movq %rax, %rbx
jmp 0x3ad3
movq %rax, %rbx
jmp 0x3adf
movq %rax, %rbx
jmp 0x3aeb
jmp 0x3aa3
movq %rax, %rbx
jmp 0x3b1b
movq %rax, %rbx
jmp 0x3b27
movq %rax, %rbx
jmp 0x3b33
movq %rax, %rbx
jmp 0x3b3f
movq %rax, %rbx
jmp 0x3b4b
movq %rax, %rbx
jmp 0x3b57
movq %rax, %rbx
jmp 0x3b69
movq %rax, %rbx
jmp 0x3b7b
movq %rax, %rbx
jmp 0x3b8d
movq %rax, %rbx
jmp 0x3ba5
movq %rax, %rbx
jmp 0x3bbd
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0x19bc
jmp 0x3ab0
movq %rax, %rbx
jmp 0x3af7
movq %rax, %rbx
jmp 0x3ac7
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x3ca0
jmp 0x3abe
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3cf0
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 0x3b69
movq -0x60(%rbp), %rsi
callq 0x1120
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x3b7b
movq -0x70(%rbp), %rsi
callq 0x1120
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x3b8d
movq -0x80(%rbp), %rsi
callq 0x1120
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x3ba5
movq -0x90(%rbp), %rsi
callq 0x1120
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x3bbd
movq -0xa0(%rbp), %rsi
callq 0x1120
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x3bd5
movq -0xb0(%rbp), %rsi
callq 0x1120
movq %rbx, %rdi
callq 0x11b0
nop