// File: /workspace/github_cpp_makefile_star2_O3/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 0x41bf72
jp 0x41bf72
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 0x411ca0
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
movl 0xe10(%rbx), %eax
ucomisd 0xe38(%rbx,%rax,8), %xmm0
jne 0x41bfaf
jnp 0x41c02c
movq $0x655aa0, %r15         # imm = 0x655AA0
leaq 0x1aee65(%rip), %rsi    # 0x5cae22
movl $0x11, %edx
movq %r15, %rdi
callq 0x4b0120
movl 0xe10(%rbx), %eax
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0xe38(%rbx,%rax,8)
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x4b1380
movq %rax, %r15
leaq 0x1b4222(%rip), %rsi    # 0x5d0219
movl $0x1, %edx
movq %rax, %rdi
callq 0x4b0120
movl 0xe10(%rbx), %esi
movq %r15, %rdi
callq 0x4b0a20
leaq 0x1bed51(%rip), %rsi    # 0x5dad6a
movl $0x1, %edx
movq %rax, %rdi
callq 0x4b0120
movsd 0x8(%rsp), %xmm0
xorpd %xmm2, %xmm2
xorpd %xmm1, %xmm1
movsd %xmm1, 0x10(%rsp)
ucomisd %xmm2, %xmm0
jbe 0x41c2af
leaq 0x30(%rbx), %rax
movq %rax, 0x40(%rsp)
leaq 0x78(%rbx), %r15
leaq 0x238(%rbx), %r12
leaq 0x20(%rsp), %r13
leaq 0x38(%rsp), %rbp
movl 0xe00(%rbx), %eax
cmpl $0x40, %eax
jne 0x41c07b
movq %r12, %rdi
callq 0x440400
movl 0xe00(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xe00(%rbx)
movl %eax, %eax
movsd 0xc00(%rbx,%rax,8), %xmm0
divsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
addsd %xmm0, %xmm1
ucomisd 0xe28(%rbx), %xmm1
jae 0x41bf61
movl 0xe10(%rbx), %eax
imulq $0xe0, %rax, %rdi
addq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
movsd %xmm1, 0x10(%rsp)
callq 0x41d0b0
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 0x411d14
testb %al, %al
je 0x41c062
movq 0x38(%rsp), %rax
cmpq 0xe08(%rbx), %rax
je 0x41c062
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 0x41c75c
movsd 0x30(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jb 0x41c1b6
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r12, %rdi
callq 0x440334
movsd 0x18(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x41c062
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 0x41bf63
movq $0x655aa0, %rdi         # imm = 0x655AA0
leaq 0x1aec70(%rip), %rsi    # 0x5cae34
movsd %xmm0, 0x18(%rsp)
callq 0x4b0650
leaq 0x1aec8b(%rip), %rsi    # 0x5cae61
movq %rax, %rdi
callq 0x4b0650
movq %rax, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x4b15c0
leaq 0x1aec76(%rip), %rsi    # 0x5cae69
movq %rax, %rdi
callq 0x4b0650
movq %rax, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x4b15c0
leaq 0x1beb5a(%rip), %r14    # 0x5dad6a
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b0650
leaq 0x1aec51(%rip), %rsi    # 0x5cae73
movq %rax, %rdi
callq 0x4b0650
movl 0xe10(%rbx), %esi
movq %rax, %rdi
callq 0x4b0c80
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b0650
leaq 0x1aec34(%rip), %rsi    # 0x5cae7e
movq %rax, %rdi
callq 0x4b0650
leaq 0x20(%rsp), %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x40e5df
leaq 0x1ae2d5(%rip), %rsi    # 0x5ca53e
movq %rax, %rdi
callq 0x4b0650
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm1
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
sqrtsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x4b15c0
movq %rax, %rdi
movq %r14, %rsi
callq 0x4b0650
leaq 0x2383b2(%rip), %rsi    # 0x654659
movq %rax, %rdi
callq 0x43f8ce
leaq 0x1aeb09(%rip), %rdi    # 0x5cadbf
leaq 0x1aeb0d(%rip), %rsi    # 0x5cadca
leaq 0x1aeb12(%rip), %rcx    # 0x5cadd6
movl $0x120, %edx            # imm = 0x120
callq 0x50b050