// File: /workspace/github_cpp_makefile_star2_O3/Cell-veto[P]postlhc/io.cpp
// Function: add_data(AbstractParticleSink*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void add_data (AbstractParticleSink *sink, string_ref filename)
{
    Extrema <double> particle_coords[MAX_DIM];

    if (ends_with (filename, ".dat"))
    {
        std::ifstream ifs (filename);
        unsigned N = 0;
        string line;
        while (std::getline (ifs, line))
        {
            MostGeneralParticle part = parse_line_from_file (N, line);
            for (unsigned n = 0; n != MAX_DIM; ++n)
                particle_coords[n].add (part.coords[n]);
            sink->put (part);
            ++N;
        }

        if (ifs.eof ())
        {
            std::cerr << "npart " << N << " particles read successfully\n";
            std::cerr << "coord_min";
            for (unsigned n = 0; n != MAX_DIM; ++n)
                std::cerr << ' ' << particle_coords[n].min ();
            std::cerr << "\ncoord_max";
            for (unsigned n = 0; n != MAX_DIM; ++n)
                std::cerr << ' ' << particle_coords[n].max ();
            std::cerr << "\n";
            return;
        }

        if (!ifs)
        {
            rt_error ("error reading input file " + filename);
        }
    }
    else
    {
        rt_error ("Not implemented");
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movq %rdi, 0xe0(%rsp)
movl $0x10, %eax
movapd 0x194b6e(%rip), %xmm0   # 0x5cfc70
movupd %xmm0, 0x100(%rsp,%rax)
movq $0x0, 0x110(%rsp,%rax)
addq $0x18, %rax
cmpq $0x58, %rax
jne 0x43b102
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
addq %rax, %rcx
decq %rcx
negq %rax
xorl %edx, %edx
leaq 0x18e214(%rip), %r9     # 0x5c934e
cmpq %rdx, %rax
je 0x43b18b
cmpq $-0x4, %rdx
je 0x43b18b
movb (%rcx,%rdx), %dil
leaq -0x1(%rdx), %r8
cmpb 0x3(%rdx,%r9), %dil
movq %r8, %rdx
je 0x43b13a
leaq 0x170(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x194ba9(%rip), %rsi    # 0x5cfd13
leaq 0x194bb1(%rip), %rdx    # 0x5cfd22
leaq 0x160(%rsp), %rdi
callq 0x4083fe
leaq 0x160(%rsp), %rdi
callq 0x43f581
cmpq $-0x4, %rdx
jne 0x43b157
leaq 0x160(%rsp), %r14
movq %r14, %rdi
movq %rsi, 0xd8(%rsp)
movl $0x8, %edx
callq 0x48cb10
leaq 0x90(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %ebx, %ebx
leaq 0x80(%rsp), %r12
leaq 0x28(%rsp), %r13
movq 0x160(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x491270
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x446190
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x43b40e
movq %r13, %rdi
movq %r12, %rsi
callq 0x43f832
movq 0x28(%rsp), %r15
movq 0x30(%rsp), %rax
movq %rax, %rcx
subq %r15, %rcx
sarq $0x5, %rcx
leaq -0x2(%rcx), %rdx
cmpq $0x2, %rdx
jb 0x43b240
cmpq $0x6, %rcx
jne 0x43b6b1
xorpd %xmm0, %xmm0
movapd %xmm0, 0xc0(%rsp)
movapd %xmm0, 0xb0(%rsp)
movapd %xmm0, 0xa0(%rsp)
cmpq %r15, %rax
je 0x43b34e
movq %rbx, 0xe8(%rsp)
callq 0x4fb530
movq %rax, %rbp
movl (%rax), %r13d
movl $0x8, %r14d
xorl %r12d, %r12d
xorl %ebx, %ebx
movq -0x8(%r15,%r14), %r15
movl $0x0, (%rbp)
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x512e60
movq 0x8(%rsp), %rcx
subq %r15, %rcx
je 0x43b599
movl (%rbp), %eax
cmpl $0x22, %eax
je 0x43b5a5
testl %eax, %eax
jne 0x43b2c4
movl %r13d, (%rbp)
movl %r13d, %eax
movsd %xmm0, 0xa0(%rsp,%rbx,8)
ucomisd 0x18ee53(%rip), %xmm0   # 0x5ca128
jb 0x43b5b1
movq 0x28(%rsp), %r15
cmpq (%r15,%r14), %rcx
jne 0x43b604
incq %rbx
movq 0x30(%rsp), %rcx
subq %r15, %rcx
sarq $0x5, %rcx
addq $-0x20, %r12
addq $0x20, %r14
movl %eax, %r13d
cmpq %rcx, %rbx
jne 0x43b286
movaps 0xa0(%rsp), %xmm1
movsd 0xb0(%rsp), %xmm2
movups 0xb8(%rsp), %xmm3
movsd 0xc8(%rsp), %xmm0
movq 0xe8(%rsp), %rbx
leaq 0x160(%rsp), %r14
leaq 0x80(%rsp), %r12
leaq 0x28(%rsp), %r13
jmp 0x43b35b
xorps %xmm1, %xmm1
xorpd %xmm0, %xmm0
xorps %xmm2, %xmm2
xorps %xmm3, %xmm3
movq $0x0, 0x58(%rsp)
movaps %xmm1, 0x40(%rsp)
movsd %xmm2, 0x50(%rsp)
movl %ebx, 0x58(%rsp)
movaps %xmm3, 0x60(%rsp)
movsd %xmm0, 0x70(%rsp)
movq %r13, %rdi
callq 0x43c1f2
leaq 0x120(%rsp), %rax
xorl %ecx, %ecx
movsd 0x40(%rsp,%rcx,8), %xmm0
movsd -0x10(%rax), %xmm1
movsd -0x8(%rax), %xmm2
movapd %xmm0, %xmm3
minsd %xmm1, %xmm3
cmpunordsd %xmm1, %xmm1
movapd %xmm1, %xmm4
andpd %xmm0, %xmm4
andnpd %xmm3, %xmm1
orpd %xmm4, %xmm1
movlpd %xmm1, -0x10(%rax)
movapd %xmm2, %xmm1
cmpunordsd %xmm2, %xmm1
movapd %xmm1, %xmm3
andpd %xmm0, %xmm3
maxsd %xmm2, %xmm0
andnpd %xmm0, %xmm1
orpd %xmm3, %xmm1
movlpd %xmm1, -0x8(%rax)
incq (%rax)
incq %rcx
addq $0x18, %rax
cmpq $0x3, %rcx
jne 0x43b390
movq 0xe0(%rsp), %rdi
movq (%rdi), %rax
leaq 0x40(%rsp), %rsi
callq *0x10(%rax)
incl %ebx
jmp 0x43b1d4
movq 0x160(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x180(%rsp,%rax), %eax
testb $0x2, %al
jne 0x43b450
testb $0x5, %al
je 0x43b555
leaq 0x1948c5(%rip), %rsi    # 0x5cfcf9
leaq 0x40(%rsp), %rdi
movq 0xd8(%rsp), %rdx
callq 0x407c44
leaq 0x40(%rsp), %rdi
callq 0x43f581
movq $0x655aa0, %rdi         # imm = 0x655AA0
leaq 0x194861(%rip), %rsi    # 0x5cfcbf
movl $0x6, %edx
callq 0x4b0120
movl %ebx, %esi
movq $0x655aa0, %rdi         # imm = 0x655AA0
callq 0x4b0a20
leaq 0x194849(%rip), %rsi    # 0x5cfcc6
movl $0x1d, %edx
movq %rax, %rdi
callq 0x4b0120
movq $0x655aa0, %rdi         # imm = 0x655AA0
leaq 0x19484c(%rip), %rsi    # 0x5cfce4
movl $0x9, %edx
callq 0x4b0120
xorl %r15d, %r15d
movq $0x655aa0, %rbx         # imm = 0x655AA0
leaq 0x40(%rsp), %r14
movb $0x20, 0x40(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4b0120
movsd 0x110(%rsp,%r15), %xmm0
movq %rax, %rdi
callq 0x4b1380
addq $0x18, %r15
cmpq $0x48, %r15
jne 0x43b4b1
movq $0x655aa0, %rdi         # imm = 0x655AA0
leaq 0x1947fe(%rip), %rsi    # 0x5cfcee
movl $0xa, %edx
callq 0x4b0120
movl $0x8, %r15d
movq $0x655aa0, %rbx         # imm = 0x655AA0
leaq 0x40(%rsp), %r14
movb $0x20, 0x40(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4b0120
movsd 0x110(%rsp,%r15), %xmm0
movq %rax, %rdi
callq 0x4b1380
addq $0x18, %r15
cmpq $0x50, %r15
jne 0x43b50c
movq $0x655aa0, %rdi         # imm = 0x655AA0
leaq 0x19f81f(%rip), %rsi    # 0x5dad6a
movl $0x1, %edx
callq 0x4b0120
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x43b57a
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x442d20
leaq 0x160(%rsp), %rdi
callq 0x48d840
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1947e8(%rip), %rdi    # 0x5cfd88
callq 0x403317
leaq 0x1947dc(%rip), %rdi    # 0x5cfd88
callq 0x4033c7
movq 0x28(%rsp), %rdx
subq %r12, %rdx
leaq 0x19478f(%rip), %rsi    # 0x5cfd4f
leaq 0xf0(%rsp), %rdi
callq 0x407c44
leaq 0x194790(%rip), %rsi    # 0x5cfd64
leaq 0xf0(%rsp), %rdi
callq 0x4c20e0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x43b655
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
jmp 0x43b662
subq %r12, %r15
leaq 0x194758(%rip), %rsi    # 0x5cfd66
leaq 0xf0(%rsp), %rdi
movq %r15, %rdx
callq 0x407c44
leaq 0x19473f(%rip), %rsi    # 0x5cfd64
leaq 0xf0(%rsp), %rdi
callq 0x4c20e0
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x43b683
movupd (%rcx), %xmm0
movupd %xmm0, (%r14)
jmp 0x43b690
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x43f581
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x43f581
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x194667(%rip), %rsi    # 0x5cfd2b
leaq 0x194683(%rip), %rdx    # 0x5cfd4e
leaq 0xa0(%rsp), %rdi
callq 0x4083fe
leaq 0xa0(%rsp), %rdi
callq 0x43f581
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x43b7d3
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x442d20
jmp 0x43b7d3
jmp 0x43b76a
jmp 0x43b76a
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x43b7c9
movq 0xb0(%rsp), %rsi
jmp 0x43b7ab
jmp 0x43b7b7
movq %rax, %rbx
movq 0x160(%rsp), %rdi
cmpq %r14, %rdi
je 0x43b805
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x442d20
jmp 0x43b805
movq %rax, %rbx
jmp 0x43b805
jmp 0x43b76a
jmp 0x43b76a
jmp 0x43b76a
movq %rax, %rbx
jmp 0x43b7d3
jmp 0x43b773
jmp 0x43b78f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x43b792
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x442d20
jmp 0x43b792
movq %rax, %rbx
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x43b7c9
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x442d20
jmp 0x43b7c9
jmp 0x43b7b7
movq %rax, %rbx
jmp 0x43b7c9
movq %rax, %rbx
cmpl $0x0, (%rbp)
jne 0x43b7c9
movl %r13d, (%rbp)
leaq 0x28(%rsp), %rdi
callq 0x43c1f2
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x43b7f8
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x442d20
leaq 0x160(%rsp), %rdi
callq 0x48d840
movq %rbx, %rdi
callq 0x4f63f0