// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH08_TheIOLibrary/examples/fileIO.cc
// Function: main
int main(int argc, char* argv[])
{
	// for each file passed to the program
	for (auto p = argv + 1; p != argv + argc; ++p) {
	    ifstream input(*p);   // create input and open the file
	    if (input) {          // if the file is ok, ``process'' this file
	        process(input);
		} else
	        cerr << "couldn't open: " + string(*p);
	} // input goes out of scope and is destroyed on each iteration
	
	auto p = argv + 1, end = argv + argc;
	
	ifstream input;           
	while (p != end) {        // for each file passed to the program
		input.open(*p);       // open the file, automatically clears the stream 
	    if (input) {          // if the file is ok, read and ``process'' the input
	        	process(input);
		} else
			cerr << "couldn't open: " + string(*p);
	    input.close();        // close file when we're done with it
	    ++p;                  // increment pointer to get next file
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
cmpl $0x1, %edi
jne 0x1365
leaq -0x280(%rbp), %rdi
callq 0x10d0
jmp 0x1594
movq %rsi, %rbx
movl %edi, -0x54(%rbp)
movslq %edi, %r13
shlq $0x3, %r13
movl $0x8, %r14d
leaq -0x280(%rbp), %r15
leaq -0x78(%rbp), %r12
movq (%rbx,%r14), %rsi
movq %r15, %rdi
movl $0x8, %edx
callq 0x1120
movq -0x280(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x260(%rbp,%rax)
je 0x13f6
movq (%rbx,%r14), %rsi
movq %r12, %rdi
leaq -0x29(%rbp), %rdx
callq 0x1060
movl $0xf, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0xc37(%rip), %rcx       # 0x2004
callq 0x10c0
leaq -0x40(%rbp), %rsi
movq %rsi, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1400
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x1406
movq %r15, %rdi
callq 0x126c
jmp 0x1463
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x2bc4(%rip), %rdi      # 0x3ff0
callq 0x10e0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x144a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x1463
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x10b0
movq %r15, %rdi
callq 0x1050
addq $0x8, %r14
cmpq %r14, %r13
jne 0x1383
leaq -0x280(%rbp), %rdi
callq 0x10d0
cmpl $0x1, -0x54(%rbp)
je 0x1594
movl $0x8, %r12d
leaq -0x280(%rbp), %r14
leaq -0x78(%rbp), %r15
movq (%rbx,%r12), %rsi
movq %r14, %rdi
movl $0x8, %edx
callq 0x1070
movq -0x280(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x260(%rbp,%rax)
je 0x1512
movq (%rbx,%r12), %rsi
movq %r15, %rdi
leaq -0x29(%rbp), %rdx
callq 0x1060
movl $0xf, %r8d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0xb1b(%rip), %rcx       # 0x2004
callq 0x10c0
leaq -0x40(%rbp), %rsi
movq %rsi, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x151c
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x1522
movq %r14, %rdi
callq 0x126c
jmp 0x157f
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x2aa8(%rip), %rdi      # 0x3ff0
callq 0x10e0
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1566
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x157f
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x10b0
movq %r14, %rdi
callq 0x1040
addq $0x8, %r12
cmpq %r12, %r13
jne 0x149f
leaq -0x280(%rbp), %rdi
callq 0x1050
xorl %eax, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x15c3
jmp 0x15fa
jmp 0x15be
jmp 0x15fa
jmp 0x15fa
movq %rax, %rbx
jmp 0x15df
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x15df
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x15fd
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x10b0
jmp 0x15fd
movq %rax, %rbx
leaq -0x280(%rbp), %rdi
callq 0x1050
movq %rbx, %rdi
callq 0x1110