// File: /workspace/github_cpp_makefile_star2_O3/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 $0x208, %rsp            # imm = 0x208
leaq -0x80(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x1a13(%rip), %rsi      # 0x4006
leaq 0x1a0d(%rip), %rdx      # 0x4007
leaq -0x90(%rbp), %rbx
movq %rbx, %rdi
callq 0x35b2
leaq -0x70(%rbp), %r14
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x19ec(%rip), %rsi      # 0x4008
leaq 0x19e7(%rip), %rdx      # 0x400a
movq %r14, %rdi
callq 0x35b2
leaq -0x50(%rbp), %r14
leaq -0x40(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x19cd(%rip), %rsi      # 0x400b
leaq 0x19c9(%rip), %rdx      # 0x400e
movq %r14, %rdi
callq 0x35b2
leaq -0x230(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x1a0(%rbp), %rcx
movl $0x3, %edx
callq 0x31ba
movq $-0x60, %rbx
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x2687
movq (%r15), %rsi
incq %rsi
callq 0x2110
addq $-0x20, %r15
addq $0x20, %rbx
jne 0x2673
xorl %eax, %eax
movq %rax, -0x190(%rbp)
pxor %xmm0, %xmm0
movdqa %xmm0, -0x1a0(%rbp)
movq %rax, -0x110(%rbp)
movdqa %xmm0, -0x120(%rbp)
movq %rax, -0xf0(%rbp)
movdqa %xmm0, -0x100(%rbp)
movq %rax, -0xd0(%rbp)
movdqa %xmm0, -0xe0(%rbp)
movq 0x38fe(%rip), %rdi      # 0x5fd8
xorl %esi, %esi
callq 0x2090
movq %rax, %rbx
leaq 0x1919(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2090
movq %rax, %rbx
leaq 0x18f8(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x118(%rbp), %rsi
subq -0x120(%rbp), %rsi
sarq $0x4, %rsi
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r14, %rsi
movq %rbx, %rdi
callq 0x2090
movq %rax, %rbx
leaq 0x18b9(%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
leaq 0x1884(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0xd8(%rbp), %rsi
subq -0xe0(%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 -0x218(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movl $0xa, %esi
callq 0x3202
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x17cd(%rip), %rsi      # 0x400f
leaq 0x17c9(%rip), %rdx      # 0x4012
callq 0x35b2
leaq -0x200(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0x180(%rbp), %rcx
movl $0xa, %esi
callq 0x328e
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x2885
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
movq 0x374c(%rip), %rdi      # 0x5fd8
movl $0xa, %esi
callq 0x2090
movq %rax, %r15
leaq 0x1764(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movl $0xa, %esi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x1740(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x210(%rbp), %rsi
subq -0x218(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x170f(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x1f8(%rbp), %rsi
subq -0x200(%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 -0x180(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movl $0xa, %esi
callq 0x3202
leaq -0x1e8(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movl $0xa, %esi
callq 0x3202
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x168c(%rip), %rsi      # 0x4013
leaq 0x1687(%rip), %rdx      # 0x4015
callq 0x35b2
leaq -0x1d0(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0x168(%rbp), %rcx
movl $0xa, %esi
callq 0x328e
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x29ca
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x1638(%rip), %rsi      # 0x4013
leaq 0x1633(%rip), %rdx      # 0x4015
callq 0x35b2
leaq -0x168(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0x150(%rbp), %rcx
movl $0xa, %esi
callq 0x328e
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x2a1e
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
movq -0x178(%rbp), %rsi
subq -0x180(%rbp), %rsi
sarq $0x5, %rsi
movq 0x35a1(%rip), %rdi      # 0x5fd8
callq 0x2090
movq %rax, %r15
leaq 0x15be(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x1e0(%rbp), %rsi
subq -0x1e8(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x158d(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x1c8(%rbp), %rsi
subq -0x1d0(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x155c(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x160(%rbp), %rsi
subq -0x168(%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 0x1509(%rip), %rsi      # 0x4013
leaq 0x1504(%rip), %rdx      # 0x4015
callq 0x35b2
leaq -0x150(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0x138(%rbp), %rcx
movl $0x1, %edx
callq 0x31ba
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x2b4d
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
leaq -0x138(%rbp), %rdi
leaq -0x90(%rbp), %rdx
movl $0xa, %esi
callq 0x3202
leaq -0x90(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x149d(%rip), %rsi      # 0x4013
leaq 0x1498(%rip), %rdx      # 0x4015
callq 0x35b2
leaq -0x1b8(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
movl $0xa, %esi
callq 0x328e
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x2bb9
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
movq -0x148(%rbp), %rsi
subq -0x150(%rbp), %rsi
sarq $0x5, %rsi
movq 0x3406(%rip), %rdi      # 0x5fd8
callq 0x2090
movq %rax, %r15
leaq 0x1423(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x130(%rbp), %rsi
subq -0x138(%rbp), %rsi
sarq $0x5, %rsi
movq %r15, %rdi
callq 0x2090
movq %rax, %r15
leaq 0x13f2(%rip), %rsi      # 0x4004
movl $0x1, %edx
movq %rax, %rdi
callq 0x2120
movq -0x1b0(%rbp), %rsi
subq -0x1b8(%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 0x2c72
movabsq $0x10000000a, %r13      # imm = 0x10000000A
leaq -0xc0(%rbp), %rsi
movq %r13, (%rsi)
leaq -0x90(%rbp), %rdi
leaq -0xa8(%rbp), %rcx
movl $0x2, %edx
callq 0x332c
movq 0x3321(%rip), %rdi      # 0x5fd8
movl $0xa, %esi
callq 0x2090
movq %rax, %r15
leaq 0x1339(%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 -0x188(%rbp), %rcx
movl $0x1, %edx
callq 0x332c
leaq -0x188(%rbp), %rsi
movq %r13, (%rsi)
leaq -0xa8(%rbp), %rdi
leaq -0x29(%rbp), %rcx
movl $0x2, %edx
callq 0x332c
movq -0xb8(%rbp), %rsi
subq -0xc0(%rbp), %rsi
sarq $0x2, %rsi
movq 0x325f(%rip), %rdi      # 0x5fd8
callq 0x2090
movq %rax, %r15
leaq 0x127c(%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 0x2df4
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x2e0f
movq -0xb0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x2e27
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movl $0x28, %esi
movq %r12, %rdi
callq 0x2110
leaq -0x1b8(%rbp), %rdi
callq 0x3372
leaq -0x138(%rbp), %rdi
callq 0x3372
leaq -0x150(%rbp), %rdi
callq 0x3372
leaq -0x168(%rbp), %rdi
callq 0x3372
leaq -0x1d0(%rbp), %rdi
callq 0x3372
leaq -0x1e8(%rbp), %rdi
callq 0x3372
leaq -0x180(%rbp), %rdi
callq 0x3372
leaq -0x200(%rbp), %rdi
callq 0x3372
leaq -0x218(%rbp), %rdi
callq 0x3372
movl $0x28, %esi
movq %r14, %rdi
callq 0x2110
movl $0x28, %esi
movq %rbx, %rdi
callq 0x2110
leaq -0xe0(%rbp), %rdi
callq 0x33e0
leaq -0x100(%rbp), %rdi
callq 0x3442
leaq -0x120(%rbp), %rdi
callq 0x3498
leaq -0x1a0(%rbp), %rdi
callq 0x3372
leaq -0x230(%rbp), %rdi
callq 0x3372
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x3097
jmp 0x30b4
movq %rax, %r15
jmp 0x30cf
jmp 0x30de
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x30ed
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x30ed
movq %rax, %r15
jmp 0x30ed
movq %rax, %r15
jmp 0x30f9
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x310a
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x310a
jmp 0x3107
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x3116
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x3116
movq %rax, %r15
jmp 0x3116
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x3122
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x3122
movq %rax, %r15
jmp 0x3122
movq %rax, %r15
jmp 0x312e
jmp 0x313c
movq %rax, %r15
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x314b
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2110
jmp 0x314b
movq %rax, %r15
jmp 0x314b
movq %rax, %r15
jmp 0x3157
movq %rax, %r15
jmp 0x3164
jmp 0x31b5
movq %rax, %r15
leaq -0x30(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x21e0
jmp 0x31ad
jmp 0x3041
movq %rax, %r15
addq $-0x10, %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x305c
movq (%r14), %rsi
incq %rsi
callq 0x2110
leaq -0x20(%r14), %rax
addq $-0x10, %r14
cmpq %rbx, %r14
movq %rax, %r14
jne 0x3048
jmp 0x31ad
movq %rax, %r15
jmp 0x31ad
movq %rax, %r15
movq -0xa8(%rbp), %rdi
testq %rdi, %rdi
je 0x3097
movq -0x98(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movq -0xc0(%rbp), %rdi
testq %rdi, %rdi
je 0x30b7
movq -0xb0(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
jmp 0x30b7
movq %rax, %r15
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x30cf
movq -0x80(%rbp), %rsi
subq %rdi, %rsi
callq 0x2110
movl $0x28, %esi
movq %r12, %rdi
callq 0x2110
jmp 0x30e1
movq %rax, %r15
leaq -0x1b8(%rbp), %rdi
callq 0x3372
leaq -0x138(%rbp), %rdi
callq 0x3372
leaq -0x150(%rbp), %rdi
callq 0x3372
jmp 0x310a
movq %rax, %r15
leaq -0x168(%rbp), %rdi
callq 0x3372
leaq -0x1d0(%rbp), %rdi
callq 0x3372
leaq -0x1e8(%rbp), %rdi
callq 0x3372
leaq -0x180(%rbp), %rdi
callq 0x3372
jmp 0x313f
movq %rax, %r15
leaq -0x200(%rbp), %rdi
callq 0x3372
leaq -0x218(%rbp), %rdi
callq 0x3372
movl $0x28, %esi
movq %r14, %rdi
callq 0x2110
movl $0x28, %esi
movq %rbx, %rdi
callq 0x2110
leaq -0xe0(%rbp), %rdi
callq 0x33e0
leaq -0x100(%rbp), %rdi
callq 0x3442
leaq -0x120(%rbp), %rdi
callq 0x3498
leaq -0x1a0(%rbp), %rdi
callq 0x3372
leaq -0x230(%rbp), %rdi
callq 0x3372
movq %r15, %rdi
callq 0x21b0
movq %rax, %r15
jmp 0x3171