// File: /workspace/github_cpp_makefile_star2_O3/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 0x15a6
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), %rbx
leaq -0x278(%rbp), %rcx
movq %rbx, %rdi
callq 0x152a
movq (%rbx), %r14
movq 0x8(%rbx), %rbx
cmpq %rbx, %r14
je 0x13a8
movq %rbx, %rax
subq %r14, %rax
sarq $0x2, %rax
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x17c6
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18a7
movq -0x38(%rbp), %r14
movq -0x30(%rbp), %rbx
cmpq %rbx, %r14
je 0x13d8
movq 0x2c1c(%rip), %rax      # 0x3fd0
leaq -0x278(%rbp), %rcx
movq %rax, (%rcx)
leaq 0xc3f(%rip), %rax       # 0x2004
movq %rax, 0x8(%rcx)
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1b19
movq 0x2bf1(%rip), %rdi      # 0x3fd0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x10f0
movsbl %al, %esi
movq 0x2bd6(%rip), %rdi      # 0x3fd0
callq 0x1030
movq %rax, %rdi
callq 0x10b0
leaq 0xbf8(%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 0xbcf(%rip), %rax       # 0x2004
movq %rax, -0x40(%rbp)
subq %r14, %r12
sarq $0x2, %r12
testq %r12, %r12
jle 0x1464
incq %r12
leaq -0x48(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1b84
addq $0x4, %r14
decq %r12
cmpq $0x1, %r12
ja 0x144c
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 0x2b2e(%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 0x14de
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 0x14f8
jmp 0x14f8
jmp 0x14f8
jmp 0x14fd
movq %rax, %rbx
jmp 0x150c
movq %rax, %rbx
leaq -0x278(%rbp), %rdi
callq 0x1150
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x1521
movq -0x28(%rbp), %rsi
subq %rdi, %rsi
callq 0x1110
movq %rbx, %rdi
callq 0x11a0
nop