// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, %rbx
movq %rdi, 0x30(%rsp)
pushq $0x10
popq %rax
movapd 0x194015(%rip), %xmm0   # 0x5c5300
movupd %xmm0, 0x100(%rsp,%rax)
andq $0x0, 0x110(%rsp,%rax)
addq $0x18, %rax
cmpq $0x58, %rax
jne 0x4312eb
leaq 0x18d040(%rip), %rsi    # 0x5be34e
movq %rbx, %rdi
callq 0x432893
testb %al, %al
je 0x4316b5
leaq 0x160(%rsp), %rdi
pushq $0x8
popq %rdx
movq %rbx, 0x28(%rsp)
movq %rbx, %rsi
callq 0x480e40
leaq 0x100(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq $0x0, 0x8(%rsp)
leaq 0xf0(%rsp), %r14
leaq 0x10(%rsp), %rbp
leaq 0x38(%rsp), %rbx
leaq 0x160(%rsp), %rdi
movq %r14, %rsi
callq 0x4b7450
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4314d9
movq %rbp, %rdi
movq %r14, %rsi
callq 0x434f2b
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rax
movq %rax, %rcx
subq %rdx, %rcx
sarq $0x5, %rcx
cmpq $0x6, %rcx
ja 0x431695
pushq $0x4c
popq %rsi
btq %rcx, %rsi
jae 0x431695
xorpd %xmm0, %xmm0
movapd %xmm0, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %r12d, %r12d
subq %rdx, %rax
sarq $0x5, %rax
cmpq %rax, %r12
je 0x431432
addq %r13, %rdx
movq %rdx, %rdi
movq %rbx, %rsi
callq 0x431c3a
movsd %xmm0, 0x40(%rsp,%r12,8)
ucomisd 0x18dd1b(%rip), %xmm0   # 0x5bf120
jb 0x43161c
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rdx
cmpq 0x8(%rdx,%r13), %rax
jne 0x43165b
incq %r12
movq 0x18(%rsp), %rax
addq $-0x20, %r15
addq $0x20, %r13
jmp 0x4313dc
andq $0x0, 0xa8(%rsp)
movaps 0x40(%rsp), %xmm0
movaps %xmm0, 0x90(%rsp)
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movq 0x8(%rsp), %rax
movl %eax, 0xa8(%rsp)
movups 0x58(%rsp), %xmm0
movaps %xmm0, 0xb0(%rsp)
movsd 0x68(%rsp), %xmm0
movsd %xmm0, 0xc0(%rsp)
movq %rbp, %rdi
callq 0x431c54
xorl %r12d, %r12d
leaq 0x110(%rsp), %r15
cmpq $0x18, %r12
je 0x4314b5
leaq (%rsp,%r12), %rsi
addq $0x90, %rsi
movq %r15, %rdi
callq 0x431bf4
addq $0x18, %r15
addq $0x8, %r12
jmp 0x431492
movq 0x30(%rsp), %rdi
movq (%rdi), %rax
leaq 0x90(%rsp), %rsi
callq *0x10(%rax)
movq 0x8(%rsp), %rax
incl %eax
movq %rax, 0x8(%rsp)
jmp 0x431365
movq 0x160(%rsp), %rax
movq -0x18(%rax), %rax
movl 0x180(%rsp,%rax), %eax
testb $0x2, %al
jne 0x43151e
testb $0x5, %al
je 0x4315f0
leaq 0x193e8a(%rip), %rsi    # 0x5c5389
leaq 0x90(%rsp), %rdi
movq 0x28(%rsp), %rdx
callq 0x4061da
leaq 0x90(%rsp), %rdi
callq 0x434d5b
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x193e23(%rip), %rsi    # 0x5c534f
callq 0x4a4910
movl 0x8(%rsp), %esi
movq %rax, %rdi
callq 0x4a4ce0
leaq 0x193e12(%rip), %rsi    # 0x5c5356
movq %rax, %rdi
callq 0x4a4910
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x193e1a(%rip), %rsi    # 0x5c5374
callq 0x4a4910
xorl %r14d, %r14d
movq $0x64eaa0, %rbx         # imm = 0x64EAA0
pushq $0x20
popq %rbp
cmpq $0x48, %r14
je 0x431594
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4a4840
movsd 0x110(%rsp,%r14), %xmm0
movq %rax, %rdi
callq 0x4a5640
addq $0x18, %r14
jmp 0x43156c
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x193ddc(%rip), %rsi    # 0x5c537e
callq 0x4a4910
pushq $0x8
popq %r14
movq $0x64eaa0, %rbx         # imm = 0x64EAA0
pushq $0x20
popq %rbp
cmpq $0x50, %r14
je 0x4315dd
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4a4840
movsd 0x110(%rsp,%r14), %xmm0
movq %rax, %rdi
callq 0x4a5640
addq $0x18, %r14
jmp 0x4315b5
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x19ee1f(%rip), %rsi    # 0x5d040a
callq 0x4a4910
leaq 0xf0(%rsp), %rdi
callq 0x4b4bf0
leaq 0x160(%rsp), %rdi
callq 0x481b70
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rdx
subq %r15, %rdx
leaq 0x193db4(%rip), %rsi    # 0x5c53df
leaq 0xd0(%rsp), %rdi
callq 0x4061da
leaq 0x193db5(%rip), %rdx    # 0x5c53f4
leaq 0x70(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x4067fc
leaq 0x70(%rsp), %rdi
callq 0x434d5b
subq %r15, %rdx
leaq 0x193d91(%rip), %rsi    # 0x5c53f6
leaq 0xd0(%rsp), %rdi
callq 0x4061da
leaq 0x193d7b(%rip), %rdx    # 0x5c53f4
leaq 0x70(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x4067fc
leaq 0x70(%rsp), %rdi
callq 0x434d5b
leaq 0x193d1f(%rip), %rsi    # 0x5c53bb
leaq 0x40(%rsp), %rdi
leaq 0x70(%rsp), %rdx
callq 0x406046
leaq 0x40(%rsp), %rdi
callq 0x434d5b
leaq 0x193ce7(%rip), %rsi    # 0x5c53a3
leaq 0x160(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x406046
leaq 0x160(%rsp), %rdi
callq 0x434d5b
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x4b4bf0
jmp 0x431758
jmp 0x43171d
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x4b4bf0
jmp 0x431772
movq %rax, %rbx
jmp 0x431772
jmp 0x43171d
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x431740
jmp 0x43174b
jmp 0x43171d
jmp 0x43171d
jmp 0x43171d
movq %rax, %rbx
jmp 0x431758
jmp 0x431726
jmp 0x431735
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x4b4bf0
jmp 0x431738
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x4b4bf0
jmp 0x43174e
jmp 0x43174b
jmp 0x43174b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x431c54
leaq 0xf0(%rsp), %rdi
callq 0x4b4bf0
leaq 0x160(%rsp), %rdi
callq 0x481b70
movq %rbx, %rdi
callq 0x4eb220