// File: iZhangHui[P]CppPrimer/CH10_GenericAlgorithms/examples/iostream_iter.cc
// Function: main
int main()
{
    istream_iterator<int> int_it(cin); // reads ints from cin
    istream_iterator<int> int_eof;     // end iterator value
	vector<int> v(int_it, int_eof);    // initialize v by reading cin

    sort(v.begin(), v.end());
    ostream_iterator<int> out(cout, " "); // write ints to cout
    unique_copy(v.begin(), v.end(), out); // write unique elements to cout
    cout << endl;                         // write a newline after the output
	ofstream out_file("data/outFile2");   // writes int to named file
	ostream_iterator<int> out_iter(out_file, " ");
	copy(v.begin(), v.end(), out_iter); 
	out_file << endl;  // write a newline at end of the file
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movl $0x0, -0x4(%rbp)
movq 0x5d17(%rip), %rsi      # 0x6fe0
leaq -0x18(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x1540
leaq -0x28(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x1570
movq -0x330(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x1590
movq -0x328(%rbp), %rsi
leaq -0x60(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x1590
leaq -0x61(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x15d0
movq -0x320(%rbp), %rsi
movq -0x318(%rbp), %rdx
movq -0x310(%rbp), %rcx
leaq -0x40(%rbp), %rdi
callq 0x15f0
jmp 0x1347
leaq -0x61(%rbp), %rdi
callq 0x1690
leaq -0x40(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x16f0
movq -0x338(%rbp), %rdi
movq %rax, -0x80(%rbp)
callq 0x1720
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x16b0
jmp 0x1389
movq 0x5c40(%rip), %rsi      # 0x6fd0
leaq 0x2c6d(%rip), %rdx      # 0x4004
leaq -0x98(%rbp), %rdi
callq 0x1750
jmp 0x13a5
leaq -0x40(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x16f0
movq -0x340(%rbp), %rdi
movq %rax, -0xa0(%rbp)
callq 0x1720
movq %rax, -0xa8(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x1820
jmp 0x13e4
movq -0xa0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rcx
callq 0x1780
jmp 0x1407
movq 0x5bc2(%rip), %rdi      # 0x6fd0
movq 0x5bab(%rip), %rsi      # 0x6fc0
callq 0x10e0
jmp 0x141c
leaq 0x2be3(%rip), %rsi      # 0x4006
leaq -0x2c8(%rbp), %rdi
movl $0x10, %edx
callq 0x10f0
jmp 0x1436
leaq 0x2bc7(%rip), %rdx      # 0x4004
leaq -0x2d8(%rbp), %rdi
leaq -0x2c8(%rbp), %rsi
callq 0x1750
jmp 0x1452
leaq -0x40(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x16f0
movq -0x348(%rbp), %rdi
movq %rax, -0x2e0(%rbp)
callq 0x1720
movq %rax, -0x2e8(%rbp)
leaq -0x2f8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x1820
jmp 0x1491
movq -0x2e0(%rbp), %rsi
movq -0x2e8(%rbp), %rdx
leaq -0x308(%rbp), %rdi
leaq -0x2f8(%rbp), %rcx
callq 0x1850
jmp 0x14b4
movq 0x5b05(%rip), %rsi      # 0x6fc0
leaq -0x2c8(%rbp), %rdi
callq 0x10e0
jmp 0x14c9
movl $0x0, -0x4(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x1110
leaq -0x40(%rbp), %rdi
callq 0x18d0
movl -0x4(%rbp), %eax
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x1690
jmp 0x1537
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x152e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x2c8(%rbp), %rdi
callq 0x1110
leaq -0x40(%rbp), %rdi
callq 0x18d0
movq -0x70(%rbp), %rdi
callq 0x1160