// File: Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<Jellium3, Monodisperse2D>::find_lr_events(Storage<Monodisperse2D>*)
bool find_lr_events (stor_t *stor)
    {
        // find the probe rate
        auto probe_rate = inter.total_probe_rate (direction);
        if (probe_rate == 0)
            return false;

        probe_rate *= stor->cell_max_density ();
        if (probe_rate != reported_probe_rate[direction])
            std::cerr << "total_probe_rate "
                << (reported_probe_rate[direction] = probe_rate) << " "
                << direction << "\n";

        double lr_disp = 0.;

        for (;;)
        {
            lr_disp += random.exponential (probe_rate);
            if (lr_disp >= planned_disp)
                return false;

            vector_t r;
            double qselect = inter.random_probe (&r, direction, &random);
            r[direction] += lr_disp;
#ifdef DEBUG
            vector_t r_before = r;
#endif
            key_t k;
            if (stor->probe (&k, active, &r, &random) && k != active)
            {
                ++longrange_predicts;
#ifdef DEBUG
                double error = norm (r - r_before);
                assert (error < stor->cell_diagonal ());
#endif
                // somebody's home
                r[direction] -= lr_disp;
                double qevent = inter.lr_event_rate (r, direction);
                if (! (qevent <= qselect))
                {
                    std::cerr << "fatal: event rate is higher than probe rate\n"
                        << "qevent " << qevent << " qselect " << qselect << "\n"
                        << "direction " << direction << "\n"
                        << "distance " << r << " = " << norm (r) << "\n" << ABORT;
                }

                double paccept = qevent/qselect;
                if (random.real () < paccept)
                {
                    // LR event
                    planned_disp = lr_disp;
                    planned_xdisp = r[direction];
                    planned_next = k;
#ifdef XDISP_HISTO
                    planned_rsq_event = norm_sq (r);
#endif
                    return true;
                }
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rax, %rdi
addq $0x30, %rdi
movl 0x2448(%rax), %esi
callq 0x41f0c0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x419acb
jp 0x419acb
movb $0x0, -0x1(%rbp)
jmp 0x419e52
movq -0x18(%rbp), %rdi
callq 0x41f0f0
movq -0x60(%rbp), %rax
mulsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movq %rax, %rdi
addq $0x2470, %rdi           # imm = 0x2470
movl 0x2448(%rax), %eax
movl %eax, %esi
callq 0x418e10
movsd -0x68(%rbp), %xmm0
ucomisd (%rax), %xmm0
jne 0x419b15
jp 0x419b15
jmp 0x419b96
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1e3729(%rip), %rsi    # 0x5fd24c
callq 0x4e1b60
movq %rax, %rcx
movq -0x60(%rbp), %rax
movq %rcx, -0x78(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movq %rax, %rdi
addq $0x2470, %rdi           # imm = 0x2470
movl 0x2448(%rax), %eax
movl %eax, %esi
callq 0x418e10
movq -0x78(%rbp), %rdi
movsd -0x70(%rbp), %xmm0
movsd %xmm0, (%rax)
callq 0x4e2ad0
movq %rax, %rdi
leaq 0x1e9d3d(%rip), %rsi    # 0x6038ad
callq 0x4e1b60
movq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0x2448(%rax), %esi
callq 0x4e2190
movq %rax, %rdi
leaq 0x1f4879(%rip), %rsi    # 0x60e40a
callq 0x4e1b60
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x60(%rbp), %rdi
addq $0x1870, %rdi           # imm = 0x1870
movsd -0x20(%rbp), %xmm0
callq 0x41f030
movq -0x60(%rbp), %rax
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
ucomisd 0x2460(%rax), %xmm0
jb 0x419bd9
movb $0x0, -0x1(%rbp)
jmp 0x419e52
movq -0x60(%rbp), %rcx
movq %rcx, %rdi
addq $0x30, %rdi
movl 0x2448(%rcx), %edx
addq $0x1870, %rcx           # imm = 0x1870
leaq -0x38(%rbp), %rsi
callq 0x41f1a0
movq -0x60(%rbp), %rax
movsd %xmm0, -0x40(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movl 0x2448(%rax), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x418e10
movsd -0x80(%rbp), %xmm0
movq -0x60(%rbp), %r8
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq -0x18(%rbp), %rdi
movq 0x2440(%r8), %rdx
addq $0x1870, %r8            # imm = 0x1870
leaq -0x48(%rbp), %rsi
leaq -0x38(%rbp), %rcx
callq 0x41f1e0
testb $0x1, %al
jne 0x419c57
jmp 0x419e4d
movq -0x60(%rbp), %rcx
movq -0x48(%rbp), %rax
cmpq 0x2440(%rcx), %rax
je 0x419e4d
movq -0x60(%rbp), %rax
movq 0x24f8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x24f8(%rax)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x88(%rbp)
movl 0x2448(%rax), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x418e10
movsd -0x88(%rbp), %xmm1
movq %rax, %rcx
movq -0x60(%rbp), %rax
movsd (%rcx), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, (%rcx)
movq %rax, %rdi
addq $0x30, %rdi
movl 0x2448(%rax), %edx
leaq -0x38(%rbp), %rsi
callq 0x41aa50
movsd %xmm0, -0x50(%rbp)
movsd -0x50(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jae 0x419dd8
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1e3566(%rip), %rsi    # 0x5fd25e
callq 0x4e1b60
movq %rax, %rdi
leaq 0x1e3584(%rip), %rsi    # 0x5fd28b
callq 0x4e1b60
movq %rax, %rdi
movsd -0x50(%rbp), %xmm0
callq 0x4e2ad0
movq %rax, %rdi
leaq 0x1e3570(%rip), %rsi    # 0x5fd293
callq 0x4e1b60
movq %rax, %rdi
movsd -0x40(%rbp), %xmm0
callq 0x4e2ad0
movq %rax, %rdi
leaq 0x1f46cb(%rip), %rsi    # 0x60e40a
callq 0x4e1b60
movq %rax, %rdi
leaq 0x1e354f(%rip), %rsi    # 0x5fd29d
callq 0x4e1b60
movq %rax, %rdi
movq -0x60(%rbp), %rax
movl 0x2448(%rax), %esi
callq 0x4e2190
movq %rax, %rdi
leaq 0x1f469b(%rip), %rsi    # 0x60e40a
callq 0x4e1b60
movq %rax, %rdi
leaq 0x1e352a(%rip), %rsi    # 0x5fd2a8
callq 0x4e1b60
movq %rax, %rdi
leaq -0x38(%rbp), %rsi
callq 0x4187f0
movq %rax, %rdi
leaq 0x1e29db(%rip), %rsi    # 0x5fc774
callq 0x4e1b60
movq %rax, -0x90(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x41aa30
movq -0x90(%rbp), %rdi
callq 0x4e2ad0
movq %rax, %rdi
leaq 0x1f4646(%rip), %rsi    # 0x60e40a
callq 0x4e1b60
movq %rax, %rdi
leaq 0x27d84e(%rip), %rsi    # 0x697621
callq 0x46d700
movq -0x60(%rbp), %rdi
movsd -0x50(%rbp), %xmm0
divsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
addq $0x1870, %rdi           # imm = 0x1870
callq 0x46e170
movaps %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x419e4b
movq -0x60(%rbp), %rax
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0x2460(%rax)
movl 0x2448(%rax), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x418e10
movq %rax, %rcx
movq -0x60(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x2468(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x2458(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x419e52
jmp 0x419e4d
jmp 0x419b9e
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x90, %rsp
popq %rbp
retq