// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH03_StringsVectorsAndArrays/examples/vec_decls.cc
// Function: main
int main()
{
	// list initialization, articles has 3 elements
	vector<string> articles = {"a", "an", "the"};

	vector<string> svec; // default initialization; svec has no elements
	vector<int> ivec;             // ivec holds objects of type int
	vector<Sales_item> Sales_vec; // holds Sales_items
	
	vector<vector<string>> file;  // vector whose elements are vectors
	vector<vector<int>> vecOfvec; // each element is itself a vector
	
	// all five vectors have size 0
	cout << svec.size() << " " << ivec.size() << " "
	     << Sales_vec.size() << " "
	     << file.size() << " " << vecOfvec.size() << endl;
	
	vector<int> ivec2(10);     // ten elements, each initialized to 0
	vector<int> ivec3(10, -1); // ten int elements, each initialized to -1
	vector<string> svec2(10);  // ten elements, each an empty string
	vector<string> svec3(10, "hi!"); // ten strings; each element is "hi!"
	cout << ivec2.size() << " " << ivec3.size() << " "
	     << svec2.size() << " " << svec3.size() << endl;
	
	// 10 is not a string, so cannot be list initialization
	vector<string> v1(10); // construct v1 with ten value-initialized elements
	vector<string> v2{10}; // ten elements value-initialized elements
	vector<string> v3(10, "hi");  // ten elements with value "hi"
	// again list initialization is not viable, so ordinary construction
	vector<string> v4{10, "hi"};  // ten elements with values "hi"
	
	// all four vectors have size ten
	cout << v1.size() << " " << v2.size() 
	     << " " << v3.size() << " " << v4.size() << endl;
	
	vector<string> vs1{"hi"}; // list initialization: vs1 has 1 element 
	vector<string> vs2{10};   // ten default-initialized elements
	vector<string> vs3{10, "hi"}; // has ten elements with value "hi"
	cout << vs1.size() << " " << vs2.size() << " " << vs3.size() << endl;
	
	vector<int> v5(10, 1);  // ten elements with value 1
	vector<int> v6{10, 1};  // two elements with values 10 and 1
	cout << v5.size() << " " << v6.size() << endl;
	
	// intention is clearer
	vector<int> alt_v3 = {10};    // one element with value 10
	vector<int> alt_v4 = {10, 1}; // two elements with values 10 and 1
	cout << alt_v3.size() << " " << alt_v4.size() << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
leaq -0x80(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1a07(%rip), %rsi      # 0x4006
leaq 0x1a01(%rip), %rdx      # 0x4007
leaq -0x90(%rbp), %r14
movq %r14, %rdi
callq 0x35cc
leaq -0x70(%rbp), %rbx
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x19e0(%rip), %rsi      # 0x4008
leaq 0x19db(%rip), %rdx      # 0x400a
movq %rbx, %rdi
callq 0x35cc
leaq -0x50(%rbp), %rbx
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x19c1(%rip), %rsi      # 0x400b
leaq 0x19bd(%rip), %rdx      # 0x400e
movq %rbx, %rdi
callq 0x35cc
leaq -0x238(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0xe0(%rbp), %rcx
movl $0x3, %edx
callq 0x31ee
movq $-0x60, %rbx
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x2693
movq (%r15), %rsi
incq %rsi
callq 0x2110
addq $-0x20, %r15
addq $0x20, %rbx
jne 0x267f
xorl %eax, %eax
movq %rax, -0xd0(%rbp)
pxor %xmm0, %xmm0
movdqa %xmm0, -0xe0(%rbp)
movq %rax, -0x130(%rbp)
movdqa %xmm0, -0x140(%rbp)
movq %rax, -0x110(%rbp)
movdqa %xmm0, -0x120(%rbp)
movq %rax, -0xf0(%rbp)
movdqa %xmm0, -0x100(%rbp)
movq -0xd8(%rbp), %rsi
subq -0xe0(%rbp), %rsi
sarq $0x5, %rsi
movq 0x38e0(%rip), %rdi      # 0x5fd8
callq 0x2090
movq %rax, %rbx
leaq 0x18fd(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2090
movq %rax, %rbx
leaq 0x18dc(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x138(%rbp), %rsi
subq -0x140(%rbp), %rsi
sarq $0x4, %rsi
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r14, %rsi
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbx
leaq 0x189d(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x118(%rbp), %rsi
subq -0x120(%rbp), %rsi
sarq $0x3, %rsi
imulq %r14, %rsi
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbx
leaq 0x1868(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0xf8(%rbp), %rsi
subq -0x100(%rbp), %rsi
sarq $0x3, %rsi
imulq %r14, %rsi
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movl $0x28, %edi
callq 0x2100
movq %rax, %rbx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rax)
movdqu %xmm0, (%rax)
movq $0x0, 0x20(%rax)
movl $0x28, %edi
callq 0x2100
movq %rax, %r14
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x10(%rax)
movdqu %xmm0, (%rax)
movq $-0x1, 0x20(%rax)
leaq -0x220(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movl $0xa, %esi
callq 0x3236
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x17b1(%rip), %rsi      # 0x400f
leaq 0x17ad(%rip), %rdx      # 0x4012
callq 0x35cc
leaq -0x208(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0x1a0(%rbp), %rcx
movl $0xa, %esi
callq 0x32c0
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x28a1
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
movq 0x3730(%rip), %rdi      # 0x5fd8
movl $0xa, %esi
callq 0x2090
movq %rax, %r15
leaq 0x1748(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movl $0xa, %esi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x1724(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x218(%rbp), %rsi
subq -0x220(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x16f3(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x200(%rbp), %rsi
subq -0x208(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq -0x1a0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movl $0xa, %esi
callq 0x3236
leaq -0x1f0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movl $0xa, %esi
callq 0x3236
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x1670(%rip), %rsi      # 0x4013
leaq 0x166b(%rip), %rdx      # 0x4015
callq 0x35cc
leaq -0x1d8(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0x188(%rbp), %rcx
movl $0xa, %esi
callq 0x32c0
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x29e6
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x161c(%rip), %rsi      # 0x4013
leaq 0x1617(%rip), %rdx      # 0x4015
callq 0x35cc
leaq -0x188(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0x170(%rbp), %rcx
movl $0xa, %esi
callq 0x32c0
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x2a3a
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
movq -0x198(%rbp), %rsi
subq -0x1a0(%rbp), %rsi
sarq $0x5, %rsi
movq 0x3585(%rip), %rdi      # 0x5fd8
callq 0x2090
movq %rax, %r15
leaq 0x15a2(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x1e8(%rbp), %rsi
subq -0x1f0(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x1571(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x1d0(%rbp), %rsi
subq -0x1d8(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x1540(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x180(%rbp), %rsi
subq -0x188(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x14ed(%rip), %rsi      # 0x4013
leaq 0x14e8(%rip), %rdx      # 0x4015
callq 0x35cc
leaq -0x170(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x158(%rbp), %rcx
movl $0x1, %edx
callq 0x31ee
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x2b69
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
leaq -0x158(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movl $0xa, %esi
callq 0x3236
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x1481(%rip), %rsi      # 0x4013
leaq 0x147c(%rip), %rdx      # 0x4015
callq 0x35cc
leaq -0x1c0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
movl $0xa, %esi
callq 0x32c0
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x2bd5
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
movq -0x168(%rbp), %rsi
subq -0x170(%rbp), %rsi
sarq $0x5, %rsi
movq 0x33ea(%rip), %rdi      # 0x5fd8
callq 0x2090
movq %rax, %r15
leaq 0x1407(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x150(%rbp), %rsi
subq -0x158(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x13d6(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x1b8(%rbp), %rsi
subq -0x1c0(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movl $0x28, %edi
callq 0x2100
movq %rax, %r12
xorl %eax, %eax
movl $0x1, (%r12,%rax)
addq $0x4, %rax
cmpq $0x28, %rax
jne 0x2c8e
movabsq $0x10000000a, %r13      # imm = 0x10000000A
leaq -0xc0(%rbp), %rsi
movq %r13, (%rsi)
leaq -0x90(%rbp), %rdi
leaq -0xa8(%rbp), %rcx
movl $0x2, %edx
callq 0x335e
movq 0x3305(%rip), %rdi      # 0x5fd8
movl $0xa, %esi
callq 0x2090
movq %rax, %r15
leaq 0x131d(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x88(%rbp), %rsi
subq -0x90(%rbp), %rsi
sarq $0x2, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
leaq -0xa8(%rbp), %rsi
movl $0xa, (%rsi)
leaq -0xc0(%rbp), %rdi
leaq -0x1a8(%rbp), %rcx
movl $0x1, %edx
callq 0x335e
leaq -0x1a8(%rbp), %rsi
movq %r13, (%rsi)
leaq -0xa8(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movl $0x2, %edx
callq 0x335e
movq -0xb8(%rbp), %rsi
subq -0xc0(%rbp), %rsi
sarq $0x2, %rsi
movq 0x3243(%rip), %rdi      # 0x5fd8
callq 0x2090
movq %rax, %r15
leaq 0x1260(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0xa0(%rbp), %rsi
subq -0xa8(%rbp), %rsi
sarq $0x2, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x20f0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x2e10
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x2e2b
movq -0xb0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x2e43
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movl $0x28, %esi
movq %r12, %rdi
callq 0x2110
leaq -0x1c0(%rbp), %rdi
callq 0x33a4
leaq -0x158(%rbp), %rdi
callq 0x33a4
leaq -0x170(%rbp), %rdi
callq 0x33a4
leaq -0x188(%rbp), %rdi
callq 0x33a4
leaq -0x1d8(%rbp), %rdi
callq 0x33a4
leaq -0x1f0(%rbp), %rdi
callq 0x33a4
leaq -0x1a0(%rbp), %rdi
callq 0x33a4
leaq -0x208(%rbp), %rdi
callq 0x33a4
leaq -0x220(%rbp), %rdi
callq 0x33a4
movl $0x28, %esi
movq %r14, %rdi
callq 0x2110
movl $0x28, %esi
movq %rbx, %rdi
callq 0x2110
leaq -0x100(%rbp), %rdi
callq 0x340e
leaq -0x120(%rbp), %rdi
callq 0x346a
leaq -0x140(%rbp), %rdi
callq 0x34ba
leaq -0xe0(%rbp), %rdi
callq 0x33a4
leaq -0x238(%rbp), %rdi
callq 0x33a4
xorl %eax, %eax
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x30cb
jmp 0x30e8
movq %rax, %r15
jmp 0x3103
jmp 0x3112
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x3121
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x3121
movq %rax, %r15
jmp 0x3121
movq %rax, %r15
jmp 0x312d
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x313e
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x313e
jmp 0x313b
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x314a
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x314a
movq %rax, %r15
jmp 0x314a
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x3156
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x3156
movq %rax, %r15
jmp 0x3156
movq %rax, %r15
jmp 0x3162
jmp 0x3170
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x317f
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x317f
movq %rax, %r15
jmp 0x317f
movq %rax, %r15
jmp 0x318b
movq %rax, %r15
jmp 0x3198
jmp 0x31e9
movq %rax, %r15
leaq -0x30(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x21e0
movb $0x1, %al
jmp 0x306b
jmp 0x305c
movq %rax, %r15
xorl %eax, %eax
jmp 0x306b
movq %rax, %r15
xorl %eax, %eax
movq %r14, %rbx
cmpq %rbx, %r14
sete %cl
orb %al, %cl
jne 0x31e1
addq $-0x10, %rbx
leaq -0x90(%rbp), %r14
movq -0x10(%rbx), %rdi
cmpq %rdi, %rbx
je 0x3098
movq (%rbx), %rsi
incq %rsi
callq 0x2110
leaq -0x20(%rbx), %rax
addq $-0x10, %rbx
cmpq %r14, %rbx
movq %rax, %rbx
jne 0x3084
jmp 0x31e1
movq %rax, %r15
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x30cb
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x30eb
movq -0xb0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
jmp 0x30eb
movq %rax, %r15
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x3103
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movl $0x28, %esi
movq %r12, %rdi
callq 0x2110
jmp 0x3115
movq %rax, %r15
leaq -0x1c0(%rbp), %rdi
callq 0x33a4
leaq -0x158(%rbp), %rdi
callq 0x33a4
leaq -0x170(%rbp), %rdi
callq 0x33a4
jmp 0x313e
movq %rax, %r15
leaq -0x188(%rbp), %rdi
callq 0x33a4
leaq -0x1d8(%rbp), %rdi
callq 0x33a4
leaq -0x1f0(%rbp), %rdi
callq 0x33a4
leaq -0x1a0(%rbp), %rdi
callq 0x33a4
jmp 0x3173
movq %rax, %r15
leaq -0x208(%rbp), %rdi
callq 0x33a4
leaq -0x220(%rbp), %rdi
callq 0x33a4
movl $0x28, %esi
movq %r14, %rdi
callq 0x2110
movl $0x28, %esi
movq %rbx, %rdi
callq 0x2110
leaq -0x100(%rbp), %rdi
callq 0x340e
leaq -0x120(%rbp), %rdi
callq 0x346a
leaq -0x140(%rbp), %rdi
callq 0x34ba
leaq -0xe0(%rbp), %rdi
callq 0x33a4
leaq -0x238(%rbp), %rdi
callq 0x33a4
movq %r15, %rdi
callq 0x21b0
movq %rax, %r15
jmp 0x31a5