// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH03_StringsVectorsAndArrays/examples/string_add.cc
// Function: main
int main() 
{

	string s1  = "hello, ", s2 = "world\n";
	string s3 = s1 + s2;   // s3 is hello, world\n
	cout << s1 << s2 << s3 << endl;

	s1 += s2;   // equivalent to s1 = s1 + s2
	cout << s1;
	
	string s4 = "hello", s5 = "world";  // no punctuation in s4 or s2
	string s6 = s4 + ", " + s5 + '\n';
	cout << s4 << s5 << "\n" << s6 << endl;
	
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xd95(%rip), %rsi       # 0x2004
leaq 0xd95(%rip), %rdx       # 0x200b
leaq -0x50(%rbp), %rdi
callq 0x180e
leaq -0x80(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0xd7e(%rip), %rsi       # 0x200c
leaq 0xd7d(%rip), %rdx       # 0x2012
leaq -0x90(%rbp), %rdi
callq 0x180e
leaq -0x130(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x170f
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x2d11(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq %rax, %rdi
callq 0x10b0
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
movq %rax, %rdi
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
leaq -0x50(%rbp), %rdi
callq 0x1040
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x2c90(%rip), %rdi      # 0x3fd8
callq 0x10b0
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0xcb7(%rip), %rsi       # 0x2013
leaq 0xcb5(%rip), %rdx       # 0x2018
leaq -0x70(%rbp), %rdi
callq 0x180e
leaq -0xe0(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xc9a(%rip), %rsi       # 0x2019
leaq 0xc98(%rip), %rdx       # 0x201e
leaq -0xf0(%rbp), %rdi
callq 0x180e
leaq -0xa0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x1774
leaq 0xc4e(%rip), %rsi       # 0x2009
leaq -0xb0(%rbp), %rdi
callq 0x1100
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
leaq -0xb0(%rbp), %rdi
callq 0x1040
leaq -0x100(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x140e
movq %rdx, -0x110(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x100(%rbp)
jmp 0x1415
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x110(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rdi), %rsi
movl $0x1, %ecx
xorl %edx, %edx
movl $0xa, %r8d
callq 0x10f0
leaq -0xc0(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1476
movq %rdx, -0xd0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc0(%rbp)
jmp 0x147d
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, -0xc8(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x110(%rbp), %rdi
cmpq %r15, %rdi
je 0x14b2
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x14cd
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq 0x2afc(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq %rax, %rdi
callq 0x10b0
movq %rax, %rbx
leaq 0xb10(%rip), %rsi       # 0x2011
movl $0x1, %edx
movq %rax, %rdi
callq 0x10b0
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
movq %rbx, %rdi
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1050
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x1569
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
leaq -0x40(%rbp), %r12
leaq -0x60(%rbp), %rbx
je 0x158c
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x70(%rbp), %rdi
cmpq %rbx, %rdi
je 0x15a1
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x10a0
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x15c0
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x15d8
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x15ed
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x10a0
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, -0x30(%rbp)
movq -0x110(%rbp), %rdi
cmpq %r15, %rdi
je 0x1628
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x10a0
jmp 0x1628
jmp 0x1624
movq %rax, -0x30(%rbp)
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x167c
movq -0xa0(%rbp), %rsi
jmp 0x1674
movq %rax, -0x30(%rbp)
jmp 0x167c
movq %rax, -0x30(%rbp)
jmp 0x1697
jmp 0x16b2
movq %rax, -0x30(%rbp)
jmp 0x16d5
movq %rax, -0x30(%rbp)
jmp 0x16ed
movq %rax, -0x30(%rbp)
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x167c
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x1697
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x16b6
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x10a0
jmp 0x16b6
movq %rax, -0x30(%rbp)
leaq -0x120(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x16d5
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x16ed
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1706
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x10a0
movq -0x30(%rbp), %rdi
callq 0x10d0