// File: iZhangHui[P]CppPrimer/CH03_StringsVectorsAndArrays/examples/vecStrings2.cc
// Function: main
int main()
{
	vector<string> text;     // holds the input

	string s;
	while (getline(cin, s))  // read the entire input file
		text.push_back(s);   // storing each line as an element in text
	cout << "text.size: " << text.size() << endl;

	// print each line in text up to the first blank line
	for (auto it = text.cbegin(); 
	     it != text.cend() && !(*it).empty(); ++it) 
		cout << *it << endl;

	// equivalent loop using arrow to dereference it and call empty
	for (auto it = text.cbegin(); 
	     it != text.cend() && !it->empty(); ++it) 
		cout << *it << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x2530
leaq -0x40(%rbp), %rdi
callq 0x2140
movq 0x3cd5(%rip), %rdi      # 0x5fe0
leaq -0x40(%rbp), %rsi
callq 0x2030
movq %rax, -0x78(%rbp)
jmp 0x231a
movq -0x78(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x2130
movb %al, -0x79(%rbp)
jmp 0x2332
movb -0x79(%rbp), %al
testb $0x1, %al
jne 0x233b
jmp 0x236f
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x2550
jmp 0x234a
jmp 0x2304
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x20b0
leaq -0x20(%rbp), %rdi
callq 0x26e0
jmp 0x2525
movq 0x3c5a(%rip), %rdi      # 0x5fd0
leaq 0x1c87(%rip), %rsi      # 0x4004
callq 0x20f0
movq %rax, -0x88(%rbp)
jmp 0x238b
leaq -0x20(%rbp), %rdi
callq 0x25c0
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x2040
movq %rax, -0x90(%rbp)
jmp 0x23ac
movq -0x90(%rbp), %rdi
movq 0x3c06(%rip), %rsi      # 0x5fc0
callq 0x2120
jmp 0x23c1
leaq -0x20(%rbp), %rdi
callq 0x25e0
movq %rax, -0x58(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x2650
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x2610
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x91(%rbp)
jne 0x23f9
jmp 0x2412
leaq -0x58(%rbp), %rdi
callq 0x2680
movq %rax, %rdi
callq 0x2180
xorb $-0x1, %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
testb $0x1, %al
jne 0x241e
jmp 0x2464
leaq -0x58(%rbp), %rdi
callq 0x2680
movq %rax, %rsi
movq 0x3b9f(%rip), %rdi      # 0x5fd0
callq 0x20e0
movq %rax, -0xa0(%rbp)
jmp 0x243f
movq -0xa0(%rbp), %rdi
movq 0x3b73(%rip), %rsi      # 0x5fc0
callq 0x2120
jmp 0x2454
jmp 0x2456
leaq -0x58(%rbp), %rdi
callq 0x26a0
jmp 0x23ce
leaq -0x20(%rbp), %rdi
callq 0x25e0
movq %rax, -0x68(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x2650
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2610
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xa1(%rbp)
jne 0x249c
jmp 0x24b5
leaq -0x68(%rbp), %rdi
callq 0x26c0
movq %rax, %rdi
callq 0x2180
xorb $-0x1, %al
movb %al, -0xa1(%rbp)
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x24c1
jmp 0x2507
leaq -0x68(%rbp), %rdi
callq 0x2680
movq %rax, %rsi
movq 0x3afc(%rip), %rdi      # 0x5fd0
callq 0x20e0
movq %rax, -0xb0(%rbp)
jmp 0x24e2
movq -0xb0(%rbp), %rdi
movq 0x3ad0(%rip), %rsi      # 0x5fc0
callq 0x2120
jmp 0x24f7
jmp 0x24f9
leaq -0x68(%rbp), %rdi
callq 0x26a0
jmp 0x2471
leaq -0x40(%rbp), %rdi
callq 0x20b0
leaq -0x20(%rbp), %rdi
callq 0x26e0
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x2190
nop