// File: 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
subq $0x190, %rsp            # imm = 0x190
movl $0x0, -0x4(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x1100
movq -0x140(%rbp), %rdx
leaq 0xd64(%rip), %rsi       # 0x2004
leaq -0x28(%rbp), %rdi
callq 0x10d0
jmp 0x12ab
leaq -0x29(%rbp), %rdi
callq 0x10b0
leaq -0x61(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x1100
movq -0x148(%rbp), %rdx
leaq 0xd3a(%rip), %rsi       # 0x200c
leaq -0x60(%rbp), %rdi
callq 0x10d0
jmp 0x12dd
leaq -0x61(%rbp), %rdi
callq 0x10b0
leaq -0x88(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x1660
jmp 0x12fc
movq 0x2cd5(%rip), %rdi      # 0x3fd8
leaq -0x28(%rbp), %rsi
callq 0x1070
movq %rax, -0x150(%rbp)
jmp 0x1315
movq -0x150(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x1070
movq %rax, -0x158(%rbp)
jmp 0x132e
movq -0x158(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x1070
movq %rax, -0x160(%rbp)
jmp 0x134a
movq -0x160(%rbp), %rdi
movq 0x2c70(%rip), %rsi      # 0x3fc8
callq 0x1090
jmp 0x135f
leaq -0x28(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x10c0
jmp 0x136e
movq 0x2c63(%rip), %rdi      # 0x3fd8
leaq -0x28(%rbp), %rsi
callq 0x1070
jmp 0x1380
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x1100
movq -0x168(%rbp), %rdx
leaq 0xc72(%rip), %rsi       # 0x2013
leaq -0xa8(%rbp), %rdi
callq 0x10d0
jmp 0x13af
leaq -0xa9(%rbp), %rdi
callq 0x10b0
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x1100
movq -0x170(%rbp), %rdx
leaq 0xc3d(%rip), %rsi       # 0x2019
leaq -0xd0(%rbp), %rdi
callq 0x10d0
jmp 0x13ea
leaq -0xd1(%rbp), %rdi
callq 0x10b0
leaq 0xc0c(%rip), %rdx       # 0x2009
leaq -0x138(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x1780
jmp 0x1412
leaq -0x118(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0x1730
jmp 0x142e
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
movl $0xa, %edx
callq 0x16e0
jmp 0x1448
leaq -0x118(%rbp), %rdi
callq 0x1050
leaq -0x138(%rbp), %rdi
callq 0x1050
movq 0x2b71(%rip), %rdi      # 0x3fd8
leaq -0xa8(%rbp), %rsi
callq 0x1070
movq %rax, -0x178(%rbp)
jmp 0x147c
movq -0x178(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x1070
movq %rax, -0x180(%rbp)
jmp 0x1498
movq -0x180(%rbp), %rdi
leaq 0xb6b(%rip), %rsi       # 0x2011
callq 0x1080
movq %rax, -0x188(%rbp)
jmp 0x14b4
movq -0x188(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x1070
movq %rax, -0x190(%rbp)
jmp 0x14d0
movq -0x190(%rbp), %rdi
movq 0x2aea(%rip), %rsi      # 0x3fc8
callq 0x1090
jmp 0x14e5
movl $0x0, -0x4(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x1050
leaq -0xd0(%rbp), %rdi
callq 0x1050
leaq -0xa8(%rbp), %rdi
callq 0x1050
leaq -0x88(%rbp), %rdi
callq 0x1050
leaq -0x60(%rbp), %rdi
callq 0x1050
leaq -0x28(%rbp), %rdi
callq 0x1050
movl -0x4(%rbp), %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x10b0
jmp 0x1657
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x10b0
jmp 0x164e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1645
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1639
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa9(%rbp), %rdi
callq 0x10b0
jmp 0x1639
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xd1(%rbp), %rdi
callq 0x10b0
jmp 0x162d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1621
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x15fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x1050
leaq -0x138(%rbp), %rdi
callq 0x1050
jmp 0x1621
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x1050
leaq -0xd0(%rbp), %rdi
callq 0x1050
leaq -0xa8(%rbp), %rdi
callq 0x1050
leaq -0x88(%rbp), %rdi
callq 0x1050
leaq -0x60(%rbp), %rdi
callq 0x1050
leaq -0x28(%rbp), %rdi
callq 0x1050
movq -0x38(%rbp), %rdi
callq 0x10f0