// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x260, %rsp            # imm = 0x260
movq 0x2ccb(%rip), %rax      # 0x3fe0
leaq -0x78(%rbp), %rbx
movq %rax, (%rbx)
movb $0x1, 0xc(%rbx)
movq %rbx, %rdi
callq 0x15b0
movq (%rbx), %rax
leaq -0x68(%rbp), %rsi
movq %rax, (%rsi)
movl 0x8(%rbx), %eax
movl %eax, 0x8(%rsi)
movb 0xc(%rbx), %al
movb %al, 0xc(%rsi)
leaq -0x58(%rbp), %rdx
movq $0x0, (%rdx)
movl $0x0, 0x8(%rdx)
movb $0x0, 0xc(%rdx)
leaq -0x38(%rbp), %r14
leaq -0x278(%rbp), %rcx
movq %r14, %rdi
callq 0x1534
movq (%r14), %rbx
movq 0x8(%r14), %r14
cmpq %r14, %rbx
je 0x13a0
movq %r14, %rax
subq %rbx, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x17d0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18b1
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq 0x2c21(%rip), %rax      # 0x3fd0
cmpq %rdx, %rsi
je 0x13d4
leaq -0x278(%rbp), %rcx
movq %rax, (%rcx)
leaq 0xc3f(%rip), %rax       # 0x2004
movq %rax, 0x8(%rcx)
leaq -0x48(%rbp), %rdi
callq 0x1b47
jmp 0x13e3
movq %rax, -0x48(%rbp)
leaq 0xc25(%rip), %rax       # 0x2004
movq %rax, -0x40(%rbp)
movq 0x2be6(%rip), %rdi      # 0x3fd0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x10f0
movsbl %al, %esi
movq 0x2bcb(%rip), %rdi      # 0x3fd0
callq 0x1030
movq %rax, %rdi
callq 0x10b0
leaq 0xbed(%rip), %rsi       # 0x2006
leaq -0x278(%rbp), %rbx
movq %rbx, %rdi
movl $0x10, %edx
callq 0x1120
movq -0x38(%rbp), %r14
movq -0x30(%rbp), %r12
movq %rbx, -0x48(%rbp)
leaq 0xbc4(%rip), %rax       # 0x2004
movq %rax, -0x40(%rbp)
subq %r14, %r12
sarq $0x2, %r12
testq %r12, %r12
jle 0x146f
incq %r12
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1bb2
addq $0x4, %r14
decq %r12
cmpq $0x1, %r12
jg 0x1457
movq -0x278(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10f0
movsbl %al, %esi
leaq -0x278(%rbp), %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10b0
movq 0x2b23(%rip), %rax      # 0x3fc8
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x270(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x278(%rbp,%rcx)
callq 0x10d0
leaq -0x180(%rbp), %rdi
callq 0x1050
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x14e9
movq -0x28(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
xorl %eax, %eax
addq $0x260, %rsp            # imm = 0x260
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1503
jmp 0x1503
jmp 0x1503
jmp 0x1508
movq %rax, %rbx
jmp 0x1517
movq %rax, %rbx
leaq -0x278(%rbp), %rdi
callq 0x1150
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x152c
movq -0x28(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
movq %rbx, %rdi
callq 0x11a0