// File: /workspace/github_cpp_makefile_star2_O3/Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<LennardJones, Monodisperse2D>::find_sr_events(Storage<Monodisperse2D>*)
void find_sr_events (stor_t *stor)
    {
        // FIXME these should, in principle, depend on the active particle.
        const double attract_range = inter.sr_attraction_range ();
        const double repuls_range = inter.sr_repulsion_range ();
        const double strip_width = fmax (repuls_range, attract_range);

        // due to the design of the Storage, we cannot allow the enumerate to wrap
        double max_disp = stor->strip_max_extent (direction) - strip_width - attract_range;
        if (max_disp < planned_disp)
            planned_disp = max_disp;

        // loop over all particles in strip
        auto g = stor->enumerate_strip (active, direction, strip_width,
            -attract_range, planned_disp + strip_width);
        for (; g.not_done (); g.next ())
        {
            ++shortrange_predicts;

            vector_t r_now = stor->distance_vector (g.key (), active);
            double x_now = r_now[direction];
            double xsq = sq (x_now);
            double ortho_rsq = norm_ortho_sq (r_now, direction);
            double x_min = x_now - planned_disp;

            double disp;

            // repulsive interactions
            double rsq_min = ortho_rsq + (x_min > 0. ? sq (x_min) : 0.);
            if (x_now > 0. && rsq_min < sq (repuls_range))
            {
                double rsq = ortho_rsq + xsq;
                double delta = inter.random_sr_repulsion (rsq, &random);

                if (! (delta <= 0.))
                {
                    std::cerr << "computed short-range repulsive event is not in the future" << ABORT;
                }

                // delta <= -rsq signals 'no event' (will not enter the next if clause)
                if (xsq + delta > 0.)
                {
                    disp = -delta / (sqrt (xsq + delta) + x_now);
                    goto have_event;
                }
            }

            // attractive short-range interactions
            // these always occur at displacements later than repulsive ones.
            // FIXME more aggressive pruning
            if (x_min < 0. && ortho_rsq < sq (attract_range))
            {
                // note that even if the other particle is ahead _now_, we might
                // schedule an event after passing it.
                double x_virt = (x_now > 0.) ? 0. : x_now;
                double xsq_virt = sq (x_virt);
                double rsq_virt = ortho_rsq + xsq_virt;
                double delta = inter.random_sr_attraction (rsq_virt, &random);
                if (! (delta >= 0.))
                {
                    std::cerr << "computed short-range attractive event is not in the future" << ABORT;
                }

                disp = (x_now-x_virt) + delta / (sqrt (xsq_virt + delta) - x_virt);
                goto have_event;
            }

            // no event, try next particle
            continue;

        have_event:
            // when jumping here, disp will have been initialized.
            // see if this event preempts the previous one
            if (disp < planned_disp)
            {
                planned_disp = disp;
                planned_xdisp = x_now - disp;
                planned_next = g.key ();
#ifdef XDISP_HISTO
                planned_rsq_event = sq (planned_xdisp) + ortho_rsq;
#endif
                g.clip (active, disp + strip_width);
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd 0x40(%rdi), %xmm2
movsd 0x58(%rdi), %xmm1
movapd %xmm1, %xmm0
mulsd %xmm2, %xmm0
cmpltsd 0x1a2c0c(%rip), %xmm1   # 0x5cdf98
andnpd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
mulsd 0x50(%rdi), %xmm2
movapd %xmm2, %xmm3
cmpunordsd %xmm2, %xmm3
movapd %xmm3, %xmm0
andpd %xmm1, %xmm0
movsd %xmm2, 0x20(%rsp)
maxsd %xmm2, %xmm1
andnpd %xmm1, %xmm3
orpd %xmm0, %xmm3
movapd %xmm3, 0x40(%rsp)
movl 0xc88(%rdi), %esi
movq %rbx, %rdi
callq 0x411530
subsd 0x40(%rsp), %xmm0
subsd 0x30(%rsp), %xmm0
movsd 0xca0(%r14), %xmm2
ucomisd %xmm0, %xmm2
jbe 0x42b3fa
movsd %xmm0, 0xca0(%r14)
movapd %xmm0, %xmm2
movq 0xc80(%r14), %rdx
movl 0xc88(%r14), %ecx
movapd 0x19ec30(%rip), %xmm1   # 0x5ca040
xorpd 0x30(%rsp), %xmm1
movapd 0x40(%rsp), %xmm0
addsd %xmm0, %xmm2
leaq 0x70(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4115b0
movl 0x50(%r15), %eax
movq 0x88(%rsp,%rax,8), %rcx
cmpq 0xb0(%rsp,%rax,8), %rcx
je 0x42b6ed
leaq 0x30(%r14), %r15
leaq 0x88(%rbx), %r13
movsd 0x20(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0xb0(%r14), %r12
movapd 0x30(%rsp), %xmm0
mulsd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
leaq 0x70(%rsp), %rbp
incq 0xd40(%r14)
movq 0x78(%rsp), %rax
movq 0xc80(%r14), %rcx
shlq $0x4, %rax
shlq $0x4, %rcx
movupd 0x78(%rbx), %xmm0
movdqu (%r13,%rax), %xmm1
movdqu (%r13,%rcx), %xmm2
psubq %xmm2, %xmm1
movq %xmm1, %rax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
pshufd $0xee, %xmm1, %xmm1     # xmm1 = xmm1[2,3,2,3]
movq %xmm1, %rax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
unpcklpd %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
mulpd %xmm0, %xmm2
movapd %xmm2, 0x60(%rsp)
movl 0xc88(%r14), %esi
movsd 0x60(%rsp,%rsi,8), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x42bb0c
movsd 0x8(%rsp), %xmm3
movapd %xmm0, %xmm5
movapd %xmm3, %xmm6
subsd 0xca0(%r14), %xmm6
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm3
jbe 0x42b5b7
movapd %xmm6, %xmm0
mulsd %xmm6, %xmm0
xorpd %xmm1, %xmm1
cmpltsd %xmm6, %xmm1
andpd %xmm0, %xmm1
addsd %xmm5, %xmm1
movsd 0x20(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x42b5b7
movsd %xmm6, 0x10(%rsp)
mulsd %xmm3, %xmm3
movsd %xmm5, 0x28(%rsp)
movsd %xmm3, 0x58(%rsp)
addsd %xmm3, %xmm5
movq %r15, %rdi
movapd %xmm5, %xmm0
movq %r12, %rsi
callq 0x42bb54
xorpd %xmm2, %xmm2
ucomisd %xmm0, %xmm2
jb 0x42b714
movapd %xmm0, %xmm4
movsd 0x58(%rsp), %xmm0
addsd %xmm4, %xmm0
ucomisd %xmm2, %xmm0
movsd 0x8(%rsp), %xmm3
movsd 0x28(%rsp), %xmm5
movsd 0x10(%rsp), %xmm6
jbe 0x42b5b7
ucomisd %xmm2, %xmm0
jb 0x42b657
sqrtsd %xmm0, %xmm0
jmp 0x42b66e
ucomisd %xmm6, %xmm2
jbe 0x42b6c8
movapd 0x30(%rsp), %xmm0
ucomisd %xmm5, %xmm0
jbe 0x42b6c8
xorpd %xmm0, %xmm0
minsd %xmm3, %xmm0
movsd %xmm0, 0x28(%rsp)
mulsd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
addsd %xmm0, %xmm5
movq %r15, %rdi
movapd %xmm5, %xmm0
movq %r12, %rsi
callq 0x42bcba
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x42b6ff
movapd %xmm0, %xmm4
movsd 0x10(%rsp), %xmm0
addsd %xmm4, %xmm0
ucomisd %xmm1, %xmm0
jb 0x42b624
sqrtsd %xmm0, %xmm0
jmp 0x42b635
movapd %xmm4, 0x10(%rsp)
callq 0x4ed060
movapd 0x10(%rsp), %xmm4
movsd 0x8(%rsp), %xmm3
movapd %xmm3, %xmm1
movsd 0x28(%rsp), %xmm2
subsd %xmm2, %xmm1
subsd %xmm2, %xmm0
divsd %xmm0, %xmm4
addsd %xmm1, %xmm4
jmp 0x42b67e
movapd %xmm4, 0x10(%rsp)
callq 0x4ed060
movapd 0x10(%rsp), %xmm4
movsd 0x8(%rsp), %xmm3
xorpd 0x19e9ca(%rip), %xmm4   # 0x5ca040
addsd %xmm3, %xmm0
divsd %xmm0, %xmm4
movsd 0xca0(%r14), %xmm0
ucomisd %xmm4, %xmm0
jbe 0x42b6c8
movsd %xmm4, 0xca0(%r14)
subsd %xmm4, %xmm3
movsd %xmm3, 0xca8(%r14)
movq 0x78(%rsp), %rax
movq %rax, 0xc98(%r14)
movq 0xc80(%r14), %rsi
addsd 0x40(%rsp), %xmm4
movq %rbp, %rdi
movapd %xmm4, %xmm0
callq 0x41184c
movq %rbp, %rdi
callq 0x4118c4
movl 0xc0(%rsp), %eax
movq 0x88(%rsp,%rax,8), %rcx
cmpq 0xb0(%rsp,%rax,8), %rcx
jne 0x42b481
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x655aa0, %rbx         # imm = 0x655AA0
leaq 0x1a290e(%rip), %rsi    # 0x5ce01b
movl $0x3a, %edx
jmp 0x42b727
movq $0x655aa0, %rbx         # imm = 0x655AA0
leaq 0x19f223(%rip), %rsi    # 0x5ca945
movl $0x39, %edx
movq %rbx, %rdi
callq 0x4b0120
leaq 0x228f63(%rip), %rsi    # 0x654699
movq %rbx, %rdi
callq 0x43f8ce