// File: Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<Jellium4<2u, Monodisperse2D>, Monodisperse2D>::probe_test_pattern(AbstractStorage*, unsigned int)
virtual
    void probe_test_pattern (AbstractStorage *stor_, unsigned direction)
    {
        stor_t *stor = downcast (stor_);
        RandomContext random;
        inter.notify_random_context (&random);
        inter.notify_error_bound (stor, stor->cell_diagonal ());

        vector <DIM> r = zero_vector <DIM> ();

        std::cout << std::scientific;

        // initialize
        const double box_size = 2*stor->periods ().max ();
        const double tpr = inter.total_probe_rate (direction);
        const double big_box_size = 1e20 * box_size;
        const double step = box_size / 100;

        // reference curve
        std::cerr << "probe rate\n";
        std::cout << "# probe rate\n";
        for (r[0] = -box_size; r[0] < box_size; r[0] += step)
        {
            for (r[1] = -box_size; r[1] < box_size; r[1] += step)
                pt_dump (r, inter.probe_rate (r, direction));
            std::cout << '\n';
        }
        std::cout << "\n";
        for (r[0] = r[1] = .0001; r[0] < big_box_size; r[0] *= -1.01)
            pt_dump (r, inter.probe_rate (r, direction));
        std::cout << "\n\n";

        // what should be
        std::cerr << "LR event rate\n";
        std::cout << "# LR event rate\n";
        for (r[0] = -box_size; r[0] < box_size; r[0] += step)
        {
            for (r[1] = -box_size; r[1] < box_size; r[1] += step)
                pt_dump (r, inter.lr_event_rate (r, direction));
            std::cout << '\n';
        }
        std::cout << "\n";
        for (r[0] = r[1] = .0001; r[0] < big_box_size; r[0] *= -1.01)
            pt_dump (r, inter.lr_event_rate (r, direction));
        std::cout << "\n\n";

        // make a histogram
        std::cerr << "probe samples\n";
        std::cout << "# histogram of sampled probes\n";
        Histogram rprobe_histo (step/100, 0., 1e3 * box_size);
        static int num_warnings_left = 10;
        for (unsigned i = 0; i != 1000000; ++i)
        {
            double reported = inter.random_probe (&r, direction, &random);
            double reference = inter.probe_rate (r, direction);

            (void)reported;
            assert (reported > 0.);
            assert (fabs (reported-reference) / reported < 1e-6);

            if (num_warnings_left && inter.lr_event_rate (r, direction) > reference)
            {
                --num_warnings_left;
                std::cerr << "warn: probe rate too small\n"
                    << reference << " vs "
                    << inter.lr_event_rate (r, direction)
                    << " for r = (" << r << "), rnorm = " << norm (r) << "\n";
            }
            rprobe_histo.add (norm (r));
        }

        // dump it
        r = zero_vector <DIM> ();
        for (unsigned i = 0; i != rprobe_histo.size (); ++i)
        {
            double rate = rprobe_histo.bin_density (i) * tpr;
            if (rate == 0.) continue;
            r[0] = rprobe_histo.bin_center (i);
            rate /= sphere_surface (DIM, r[0]);
            pt_dump (r, rate);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xdc0, %rsp            # imm = 0xDC0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xcc0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4323c0
movq %rax, -0x20(%rbp)
leaq -0xbf0(%rbp), %rdi
callq 0x46e110
movq -0xcc0(%rbp), %rdi
addq $0x30, %rdi
leaq -0xbf0(%rbp), %rsi
callq 0x4190d0
movq -0xcc0(%rbp), %rax
addq $0x30, %rax
movq %rax, -0xcd0(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xcc8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4192b0
movq -0xcd0(%rbp), %rdi
movq -0xcc8(%rbp), %rsi
callq 0x432650
callq 0x41a980
movsd %xmm0, -0xc00(%rbp)
movsd %xmm1, -0xbf8(%rbp)
movq $0x698be0, %rdi         # imm = 0x698BE0
leaq -0xda8d(%rip), %rsi     # 0x4237e0
callq 0x4e0680
movq -0x20(%rbp), %rsi
movq (%rsi), %rax
leaq -0xc20(%rbp), %rdi
callq *0x28(%rax)
leaq -0xc20(%rbp), %rdi
callq 0x41fe20
movq -0xcc0(%rbp), %rdi
movaps %xmm0, %xmm1
movsd 0x1cb00f(%rip), %xmm0   # 0x5fc2b0
mulsd %xmm1, %xmm0
movsd %xmm0, -0xc08(%rbp)
addq $0x30, %rdi
movl -0x14(%rbp), %esi
callq 0x435b80
movsd %xmm0, -0xc28(%rbp)
movsd 0x1cafdf(%rip), %xmm0   # 0x5fc2a8
mulsd -0xc08(%rbp), %xmm0
movsd %xmm0, -0xc30(%rbp)
movsd -0xc08(%rbp), %xmm0
movsd 0x1c9d1f(%rip), %xmm1   # 0x5fb008
divsd %xmm1, %xmm0
movsd %xmm0, -0xc38(%rbp)
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1cc3de(%rip), %rsi    # 0x5fd6e1
callq 0x4e1b60
movq $0x698be0, %rdi         # imm = 0x698BE0
leaq 0x1cc3c9(%rip), %rsi    # 0x5fd6df
callq 0x4e1b60
movsd -0xc08(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0xcb8(%rbp)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd -0xcb8(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd (%rax), %xmm1
movsd -0xc08(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x43149b
movsd -0xc08(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0xcd8(%rbp)
leaq -0xc00(%rbp), %rdi
movl $0x1, %esi
callq 0x418e10
movsd -0xcd8(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0xc00(%rbp), %rdi
movl $0x1, %esi
callq 0x418e10
movsd (%rax), %xmm1
movsd -0xc08(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x431455
movq -0xcc0(%rbp), %rdi
addq $0x30, %rdi
movl -0x14(%rbp), %edx
leaq -0xc00(%rbp), %rsi
callq 0x436860
movq -0xcc0(%rbp), %rdi
movl %eax, %eax
cvtsi2sd %rax, %xmm0
leaq -0xc00(%rbp), %rsi
callq 0x4367a0
movsd -0xc38(%rbp), %xmm0
movsd %xmm0, -0xce0(%rbp)
leaq -0xc00(%rbp), %rdi
movl $0x1, %esi
callq 0x418e10
movsd -0xce0(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x4313c8
movq $0x698be0, %rdi         # imm = 0x698BE0
movl $0xa, %esi
callq 0x4e1a90
movsd -0xc38(%rbp), %xmm0
movsd %xmm0, -0xce8(%rbp)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd -0xce8(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x43135e
movq $0x698be0, %rdi         # imm = 0x698BE0
leaq 0x1dcf61(%rip), %rsi    # 0x60e40a
callq 0x4e1b60
leaq -0xc00(%rbp), %rdi
movl $0x1, %esi
callq 0x418e10
movsd 0x1cadf1(%rip), %xmm0   # 0x5fc2b8
movsd %xmm0, (%rax)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd 0x1cadd5(%rip), %xmm0   # 0x5fc2b8
movsd %xmm0, (%rax)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd (%rax), %xmm1
movsd -0xc30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x43155f
movq -0xcc0(%rbp), %rdi
addq $0x30, %rdi
movl -0x14(%rbp), %edx
leaq -0xc00(%rbp), %rsi
callq 0x436860
movq -0xcc0(%rbp), %rdi
movl %eax, %eax
cvtsi2sd %rax, %xmm0
leaq -0xc00(%rbp), %rsi
callq 0x4367a0
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd 0x1cad73(%rip), %xmm0   # 0x5fc2c8
mulsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x4314e7
movq $0x698be0, %rdi         # imm = 0x698BE0
leaq 0x1f682b(%rip), %rsi    # 0x627d98
callq 0x4e1b60
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1cc16f(%rip), %rsi    # 0x5fd6ef
callq 0x4e1b60
movq $0x698be0, %rdi         # imm = 0x698BE0
leaq 0x1cc15a(%rip), %rsi    # 0x5fd6ed
callq 0x4e1b60
movsd -0xc08(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0xcf0(%rbp)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd -0xcf0(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd (%rax), %xmm1
movsd -0xc08(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x431716
movsd -0xc08(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0xcf8(%rbp)
leaq -0xc00(%rbp), %rdi
movl $0x1, %esi
callq 0x418e10
movsd -0xcf8(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0xc00(%rbp), %rdi
movl $0x1, %esi
callq 0x418e10
movsd (%rax), %xmm1
movsd -0xc08(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4316d0
movq -0xcc0(%rbp), %rdi
addq $0x30, %rdi
movl -0x14(%rbp), %edx
leaq -0xc00(%rbp), %rsi
movl $0x1, %ecx
callq 0x433aa0
movq -0xcc0(%rbp), %rdi
leaq -0xc00(%rbp), %rsi
callq 0x4367a0
movsd -0xc38(%rbp), %xmm0
movsd %xmm0, -0xd00(%rbp)
leaq -0xc00(%rbp), %rdi
movl $0x1, %esi
callq 0x418e10
movsd -0xd00(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x431645
movq $0x698be0, %rdi         # imm = 0x698BE0
movl $0xa, %esi
callq 0x4e1a90
movsd -0xc38(%rbp), %xmm0
movsd %xmm0, -0xd08(%rbp)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd -0xd08(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x4315db
movq $0x698be0, %rdi         # imm = 0x698BE0
leaq 0x1dcce6(%rip), %rsi    # 0x60e40a
callq 0x4e1b60
leaq -0xc00(%rbp), %rdi
movl $0x1, %esi
callq 0x418e10
movsd 0x1cab76(%rip), %xmm0   # 0x5fc2b8
movsd %xmm0, (%rax)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd 0x1cab5a(%rip), %xmm0   # 0x5fc2b8
movsd %xmm0, (%rax)
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd (%rax), %xmm1
movsd -0xc30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4317d8
movq -0xcc0(%rbp), %rdi
addq $0x30, %rdi
movl -0x14(%rbp), %edx
leaq -0xc00(%rbp), %rsi
movl $0x1, %ecx
callq 0x433aa0
movq -0xcc0(%rbp), %rdi
leaq -0xc00(%rbp), %rsi
callq 0x4367a0
leaq -0xc00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x418e10
movsd 0x1caafa(%rip), %xmm0   # 0x5fc2c8
mulsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x431762
movq $0x698be0, %rdi         # imm = 0x698BE0
leaq 0x1f65b2(%rip), %rsi    # 0x627d98
callq 0x4e1b60
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1cbf05(%rip), %rsi    # 0x5fd6fe
callq 0x4e1b60
movq $0x698be0, %rdi         # imm = 0x698BE0
leaq 0x1cbf01(%rip), %rsi    # 0x5fd70d
callq 0x4e1b60
movsd -0xc38(%rbp), %xmm0
movsd 0x1c97e7(%rip), %xmm1   # 0x5fb008
divsd %xmm1, %xmm0
movsd 0x1caa93(%rip), %xmm2   # 0x5fc2c0
mulsd -0xc08(%rbp), %xmm2
leaq -0xc68(%rbp), %rdi
xorps %xmm1, %xmm1
callq 0x46e810
movl $0x0, -0xc6c(%rbp)
cmpl $0xf4240, -0xc6c(%rbp)  # imm = 0xF4240
je 0x431b4c
movq -0xcc0(%rbp), %rdi
addq $0x30, %rdi
movl -0x14(%rbp), %edx
leaq -0xc00(%rbp), %rsi
leaq -0xbf0(%rbp), %rcx
callq 0x435bd0
movsd %xmm0, -0xd10(%rbp)
jmp 0x431889
movq -0xcc0(%rbp), %rdi
movsd -0xd10(%rbp), %xmm0
movsd %xmm0, -0xc78(%rbp)
addq $0x30, %rdi
movl -0x14(%rbp), %edx
leaq -0xc00(%rbp), %rsi
callq 0x436860
movl %eax, -0xd14(%rbp)
jmp 0x4318bb
movl -0xd14(%rbp), %eax
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0xc90(%rbp)
movsd -0xc78(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4318e3
jmp 0x431925
leaq 0x1cbe42(%rip), %rdi    # 0x5fd72c
leaq 0x1cb851(%rip), %rsi    # 0x5fd142
movl $0x2ba, %edx            # imm = 0x2BA
leaq 0x1cdc93(%rip), %rcx    # 0x5ff590
callq 0x53d020
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc80(%rbp)
movl %eax, -0xc84(%rbp)
leaq -0xc68(%rbp), %rdi
callq 0x46e8f0
jmp 0x431d07
movsd -0xc78(%rbp), %xmm1
subsd -0xc90(%rbp), %xmm1
movaps 0x1caa84(%rip), %xmm0   # 0x5fc3c0
pand %xmm0, %xmm1
divsd -0xc78(%rbp), %xmm1
movsd 0x1ca938(%rip), %xmm0   # 0x5fc288
ucomisd %xmm1, %xmm0
jbe 0x431958
jmp 0x431977
leaq 0x1cbe74(%rip), %rdi    # 0x5fd7d3
leaq 0x1cb7dc(%rip), %rsi    # 0x5fd142
movl $0x2bb, %edx            # imm = 0x2BB
leaq 0x1cdc1e(%rip), %rcx    # 0x5ff590
callq 0x53d020
cmpl $0x0, 0x263812(%rip)    # 0x695190
je 0x431b0a
movq -0xcc0(%rbp), %rdi
addq $0x30, %rdi
movl -0x14(%rbp), %edx
leaq -0xc00(%rbp), %rsi
movl $0x1, %ecx
callq 0x433aa0
movsd %xmm0, -0xd20(%rbp)
jmp 0x4319ad
movsd -0xd20(%rbp), %xmm0
ucomisd -0xc90(%rbp), %xmm0
jbe 0x431b0a
movl 0x2637c7(%rip), %eax    # 0x695190
decl %eax
movl %eax, 0x2637bf(%rip)    # 0x695190
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1cbe20(%rip), %rsi    # 0x5fd7ff
callq 0x4e1b60
movq %rax, -0xd28(%rbp)
jmp 0x4319ed
movq -0xd28(%rbp), %rdi
movsd -0xc90(%rbp), %xmm0
callq 0x4e2ad0
movq %rax, -0xd30(%rbp)
jmp 0x431a0a
movq -0xd30(%rbp), %rdi
leaq 0x1cbe03(%rip), %rsi    # 0x5fd81b
callq 0x4e1b60
movq %rax, -0xd38(%rbp)
jmp 0x431a26
movq -0xcc0(%rbp), %rdi
addq $0x30, %rdi
movl -0x14(%rbp), %edx
leaq -0xc00(%rbp), %rsi
movl $0x1, %ecx
callq 0x433aa0
movsd %xmm0, -0xd40(%rbp)
jmp 0x431a4f
movsd -0xd40(%rbp), %xmm0
movq -0xd38(%rbp), %rdi
callq 0x4e2ad0
movq %rax, -0xd48(%rbp)
jmp 0x431a6c
movq -0xd48(%rbp), %rdi
leaq 0x1cbda6(%rip), %rsi    # 0x5fd820
callq 0x4e1b60
movq %rax, -0xd50(%rbp)
jmp 0x431a88
movq -0xd50(%rbp), %rdi
leaq -0xc00(%rbp), %rsi
callq 0x4187f0
movq %rax, -0xd58(%rbp)
jmp 0x431aa4
movq -0xd58(%rbp), %rdi
leaq 0x1cbd79(%rip), %rsi    # 0x5fd82b
callq 0x4e1b60
movq %rax, -0xd60(%rbp)
jmp 0x431ac0
leaq -0xc00(%rbp), %rdi
callq 0x41aa30
movsd %xmm0, -0xd68(%rbp)
jmp 0x431ad6
movsd -0xd68(%rbp), %xmm0
movq -0xd60(%rbp), %rdi
callq 0x4e2ad0
movq %rax, -0xd70(%rbp)
jmp 0x431af3
movq -0xd70(%rbp), %rdi
leaq 0x1dc909(%rip), %rsi    # 0x60e40a
callq 0x4e1b60
jmp 0x431b08
jmp 0x431b0a
leaq -0xc00(%rbp), %rdi
callq 0x41aa30
movsd %xmm0, -0xd78(%rbp)
jmp 0x431b20
movsd -0xd78(%rbp), %xmm0
leaq -0xc68(%rbp), %rdi
callq 0x423910
jmp 0x431b36
jmp 0x431b38
movl -0xc6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc6c(%rbp)
jmp 0x43184e
callq 0x41a980
movsd %xmm1, -0xd88(%rbp)
movsd %xmm0, -0xd80(%rbp)
jmp 0x431b63
movsd -0xd88(%rbp), %xmm0
movsd -0xd80(%rbp), %xmm1
movsd %xmm1, -0xca0(%rbp)
movsd %xmm0, -0xc98(%rbp)
movq -0xca0(%rbp), %rax
movq %rax, -0xc00(%rbp)
movq -0xc98(%rbp), %rax
movq %rax, -0xbf8(%rbp)
movl $0x0, -0xca4(%rbp)
movl -0xca4(%rbp), %eax
movq %rax, -0xd98(%rbp)
leaq -0xc68(%rbp), %rdi
callq 0x4239b0
movq %rax, -0xd90(%rbp)
jmp 0x431bcb
movq -0xd98(%rbp), %rax
movq -0xd90(%rbp), %rcx
cmpq %rcx, %rax
je 0x431cf2
movl -0xca4(%rbp), %eax
movl %eax, %esi
leaq -0xc68(%rbp), %rdi
callq 0x4239d0
movsd %xmm0, -0xda0(%rbp)
jmp 0x431c00
movsd -0xda0(%rbp), %xmm0
mulsd -0xc28(%rbp), %xmm0
movsd %xmm0, -0xcb0(%rbp)
movsd -0xcb0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x431c30
jp 0x431c30
jmp 0x431cde
movl -0xca4(%rbp), %eax
movl %eax, %esi
leaq -0xc68(%rbp), %rdi
callq 0x423a70
movsd %xmm0, -0xda8(%rbp)
jmp 0x431c4e
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0xdb8(%rbp)
leaq -0xc00(%rbp), %rdi
movq %rdi, -0xdc0(%rbp)
callq 0x418e10
movsd -0xda8(%rbp), %xmm0
movq -0xdc0(%rbp), %rdi
movq -0xdb8(%rbp), %rsi
movsd %xmm0, (%rax)
callq 0x418e10
movsd (%rax), %xmm0
movl $0x2, %edi
callq 0x423ad0
movsd %xmm0, -0xdb0(%rbp)
jmp 0x431ca3
movq -0xcc0(%rbp), %rdi
movsd -0xdb0(%rbp), %xmm1
movsd -0xcb0(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0xcb0(%rbp)
movsd -0xcb0(%rbp), %xmm0
leaq -0xc00(%rbp), %rsi
callq 0x4367a0
jmp 0x431cdc
jmp 0x431cde
movl -0xca4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xca4(%rbp)
jmp 0x431ba9
leaq -0xc68(%rbp), %rdi
callq 0x46e8f0
addq $0xdc0, %rsp            # imm = 0xDC0
popq %rbp
retq
movq -0xc80(%rbp), %rdi
callq 0x5283c0
nopw %cs:(%rax,%rax)
nopl (%rax)