// File: /workspace/github_cpp_makefile_star2_O1/Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<Jellium4<2u, Monodisperse2D>, 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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl 0xe10(%rdi), %eax
movsd 0x68(%rdi), %xmm1
imulq $0xe0, %rax, %rax
mulsd 0x90(%rdi,%rax), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x41c3b4
jp 0x41c3b4
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movq %rsi, %r14
movq %rsi, %rdi
movsd %xmm1, 0x8(%rsp)
callq 0x411d8e
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movl 0xe10(%rbx), %eax
ucomisd 0xe38(%rbx,%rax,8), %xmm1
movsd %xmm1, 0x8(%rsp)
jne 0x41c3eb
jnp 0x41c468
movq $0x656aa0, %r15         # imm = 0x656AA0
leaq 0x1af939(%rip), %rsi    # 0x5cbd32
movl $0x11, %edx
movq %r15, %rdi
callq 0x4b14d0
movl 0xe10(%rbx), %eax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0xe38(%rbx,%rax,8)
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x4b2730
movq %rax, %r15
leaq 0x1b4c66(%rip), %rsi    # 0x5d1099
movl $0x1, %edx
movq %rax, %rdi
callq 0x4b14d0
movl 0xe10(%rbx), %esi
movq %r15, %rdi
callq 0x4b1dd0
leaq 0x1bf795(%rip), %rsi    # 0x5dbbea
movl $0x1, %edx
movq %rax, %rdi
callq 0x4b14d0
movsd 0x8(%rsp), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jbe 0x41c5c8
leaq 0x30(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0x78(%rbx), %r15
leaq 0x238(%rbx), %r12
leaq 0x20(%rsp), %r13
leaq 0x38(%rsp), %rbp
movsd %xmm0, 0x10(%rsp)
cmpl $0x40, 0xe00(%rbx)
jne 0x41c4b1
movq %r12, %rdi
callq 0x4417f8
movsd 0x8(%rsp), %xmm1
movl 0xe00(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xe00(%rbx)
movsd 0xc00(%rbx,%rax,8), %xmm0
divsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
ucomisd 0xe28(%rbx), %xmm1
setb %al
jae 0x41c3a5
movl 0xe10(%rbx), %eax
imulq $0xe0, %rax, %rdi
addq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
movsd %xmm1, 0x10(%rsp)
callq 0x41d5d0
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movl 0xe10(%rbx), %eax
movsd 0x20(%rsp,%rax,8), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp,%rax,8)
movq 0xe08(%rbx), %rdx
movq %r14, %rdi
movq %rbp, %rsi
movq %r13, %rcx
movq %r12, %r8
callq 0x411e02
testb %al, %al
je 0x41c5b4
movq 0x38(%rsp), %rax
cmpq 0xe08(%rbx), %rax
je 0x41c5b4
incq 0xec0(%rbx)
movl 0xe10(%rbx), %edx
movsd 0x20(%rsp,%rdx,8), %xmm0
subsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp,%rdx,8)
movq 0x40(%rsp), %rdi
movq %r13, %rsi
movl $0x1, %ecx
callq 0x41cc94
movsd 0x30(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x41c61c
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
callq 0x44172c
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
ja 0x41c5e7
movsd 0x8(%rsp), %xmm1
ucomisd 0x1aea26(%rip), %xmm1   # 0x5cafe8
ja 0x41c49a
leaq 0x1af700(%rip), %rdi    # 0x5cbccf
leaq 0x1af704(%rip), %rsi    # 0x5cbcda
leaq 0x1af709(%rip), %rcx    # 0x5cbce6
movl $0x120, %edx            # imm = 0x120
callq 0x50c400
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0xe28(%rbx)
movl 0xe10(%rbx), %eax
movsd 0x20(%rsp,%rax,8), %xmm0
movsd %xmm0, 0xe30(%rbx)
movq 0x38(%rsp), %rax
movq %rax, 0xe20(%rbx)
movb $0x1, %al
jmp 0x41c3a5
movq $0x656aa0, %rdi         # imm = 0x656AA0
leaq 0x1af71a(%rip), %rsi    # 0x5cbd44
movsd %xmm0, 0x18(%rsp)
callq 0x4b1a00
leaq 0x1af735(%rip), %rsi    # 0x5cbd71
movq %rax, %rdi
callq 0x4b1a00
movq %rax, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x4b2970
leaq 0x1af720(%rip), %rsi    # 0x5cbd79
movq %rax, %rdi
callq 0x4b1a00
movq %rax, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x4b2970
leaq 0x1bf574(%rip), %r14    # 0x5dbbea
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b1a00
leaq 0x1af6fb(%rip), %rsi    # 0x5cbd83
movq %rax, %rdi
callq 0x4b1a00
movl 0xe10(%rbx), %esi
movq %rax, %rdi
callq 0x4b2030
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b1a00
leaq 0x1af6de(%rip), %rsi    # 0x5cbd8e
movq %rax, %rdi
callq 0x4b1a00
leaq 0x20(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x40e5ab
leaq 0x1aed7f(%rip), %rsi    # 0x5cb44e
movq %rax, %rdi
callq 0x4b1a00
movq %rax, %rbx
movsd (%r14), %xmm1
movsd 0x8(%r14), %xmm0
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x41c701
sqrtsd %xmm0, %xmm0
jmp 0x41c706
callq 0x4ee410
movq %rbx, %rdi
callq 0x4b2970
leaq 0x1bf4d5(%rip), %rsi    # 0x5dbbea
movq %rax, %rdi
callq 0x4b1a00
leaq 0x238f35(%rip), %rsi    # 0x655659
movq %rax, %rdi
callq 0x440cc2