// File: Cell-veto[P]postlhc/jellium4.cpp
// Function: Jellium4<2u, Monodisperse2D>::setup_probe_distr(AbstractStorage const*)
void setup_probe_distr (const AbstractStorage *stor_)
    {
        // FIXME introduce CellStorage
        auto stor = dynamic_cast <const Storage <ENCODING> *> (stor_);
        if (!stor)
            std::cerr << "jellium4: incompatible Storage passed in" << ABORT;

        vector_t cwid = stor->cell_widths ();
        cell_volume = fproduct (cwid.begin (), cwid.end ());

        GridIndices <DIM> cell_grid = this->get_cell_grid (*stor);

        std::cerr << "jellium4_init cell_volume " << cwid << " = " << cell_volume << "\n";
        std::cerr << "jellium4_init cell_count(DIM) " << stor->cell_count (DIM) << "\n";

        for (unsigned direction = 0; direction != DIM; ++direction)
        {
            prober_t *pr = &prober[direction];
            pr->clear ();

            auto it = cell_grid.begin (), it_end = cell_grid.end ();
            for (; it != it_end; ++it)
            {
                vector_t cell_vector = elementwise_product (cwid, *it);
                int discret = (norm (cell_vector) < 2 * sr_lr_split) ? 50 : 6;
                GridIndices <DIM> discret_grid = GridIndices <DIM> (-discret, discret+1);

                double max_event_rate_found = 0.;

                auto iit = discret_grid.begin (), iit_end = discret_grid.end ();
                for (; iit != iit_end; ++iit)
                {
                    vector_t dr = elementwise_product (cwid, *iit) / discret;
                    double er = lr_event_rate (cell_vector + dr, direction);
                    update_max (&max_event_rate_found, er);
                }

                // report maximum to prober
                pr->add (max_event_rate_found * SAFETY_CUSHION, cell_vector);
            }

            pr->finish ();
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x120(%rbp)
cmpq $0x0, %rax
je 0x4332e6
movq -0x120(%rbp), %rdi
leaq 0x259203(%rip), %rsi    # 0x68c4d0
leaq 0x25924c(%rip), %rdx    # 0x68c520
xorl %eax, %eax
movl %eax, %ecx
callq 0x474c60
movq %rax, -0x130(%rbp)
jmp 0x4332f1
xorl %eax, %eax
movq %rax, -0x130(%rbp)
jmp 0x4332f1
movq -0x130(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x433325
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1cbedb(%rip), %rsi    # 0x5ff1ec
callq 0x4e1b60
movq %rax, %rdi
leaq 0x264359(%rip), %rsi    # 0x697679
callq 0x46d700
movq -0x18(%rbp), %rdi
callq 0x422c40
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x20(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x418320
movq %rax, -0x140(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4336c0
movq -0x140(%rbp), %rdi
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x433670
movq -0x128(%rbp), %rax
movsd %xmm0, 0x38(%rax)
movq -0x18(%rbp), %rdi
callq 0x4336e0
movq %rax, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1cbe85(%rip), %rsi    # 0x5ff215
callq 0x4e1b60
movq %rax, %rdi
leaq -0x28(%rbp), %rsi
callq 0x4187f0
movq %rax, %rdi
leaq 0x1c93c9(%rip), %rsi    # 0x5fc774
callq 0x4e1b60
movq %rax, %rdi
movq -0x128(%rbp), %rax
movsd 0x38(%rax), %xmm0
callq 0x4e2ad0
movq %rax, %rdi
leaq 0x1db03c(%rip), %rsi    # 0x60e40a
callq 0x4e1b60
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1cbe4f(%rip), %rsi    # 0x5ff230
callq 0x4e1b60
movq %rax, -0x138(%rbp)
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movl $0x2, %esi
callq *0x48(%rax)
movq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0x4e2170
movq %rax, %rdi
leaq 0x1daff5(%rip), %rsi    # 0x60e40a
callq 0x4e1b60
movl $0x0, -0x44(%rbp)
cmpl $0x2, -0x44(%rbp)
je 0x433644
movq -0x128(%rbp), %rax
addq $0x48, %rax
movl -0x44(%rbp), %ecx
imulq $0xe0, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x433790
leaq -0x68(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4337c0
leaq -0x80(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x433830
leaq -0x68(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4338d0
testb $0x1, %al
jne 0x433480
jmp 0x43362d
leaq -0x68(%rbp), %rdi
callq 0x433990
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x433900
movsd %xmm0, -0x90(%rbp)
movsd %xmm1, -0x88(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x41aa30
movq -0x128(%rbp), %rax
movaps %xmm0, %xmm1
movsd 0x1c8ded(%rip), %xmm0   # 0x5fc2b0
mulsd 0x18(%rax), %xmm0
movl $0x6, %eax
movl $0x32, %ecx
ucomisd %xmm1, %xmm0
cmoval %ecx, %eax
movl %eax, -0x94(%rbp)
xorl %esi, %esi
subl -0x94(%rbp), %esi
movl -0x94(%rbp), %edx
addl $0x1, %edx
leaq -0xa4(%rbp), %rdi
callq 0x4339a0
xorps %xmm0, %xmm0
movsd %xmm0, -0xb0(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0xa4(%rbp), %rsi
callq 0x4337c0
leaq -0xe0(%rbp), %rdi
leaq -0xa4(%rbp), %rsi
callq 0x433830
leaq -0xc8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x4338d0
testb $0x1, %al
jne 0x433549
jmp 0x4335ff
leaq -0xc8(%rbp), %rdi
callq 0x433990
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x433900
movsd %xmm0, -0x100(%rbp)
movsd %xmm1, -0xf8(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x94(%rbp), %rsi
callq 0x4339e0
movsd %xmm0, -0xf0(%rbp)
movsd %xmm1, -0xe8(%rbp)
leaq -0x90(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x418b70
movq -0x128(%rbp), %rdi
movsd %xmm0, -0x118(%rbp)
movsd %xmm1, -0x110(%rbp)
movl -0x44(%rbp), %edx
leaq -0x118(%rbp), %rsi
movl $0x1, %ecx
callq 0x433aa0
movsd %xmm0, -0x108(%rbp)
movsd -0x108(%rbp), %xmm0
leaq -0xb0(%rbp), %rdi
callq 0x433e40
leaq -0xc8(%rbp), %rdi
callq 0x433e90
jmp 0x43352d
movq -0x50(%rbp), %rdi
movsd 0x1cbadd(%rip), %xmm0   # 0x5ff0e8
mulsd -0xb0(%rbp), %xmm0
leaq -0x90(%rbp), %rsi
callq 0x433f60
leaq -0x68(%rbp), %rdi
callq 0x433e90
jmp 0x43346a
movq -0x50(%rbp), %rdi
callq 0x433fc0
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x433421
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopl (%rax)