// File: /workspace/github_cpp_makefile_star2_O2/Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<Jellium3, 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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc58, %rsp            # imm = 0xC58
movl %edx, %ebp
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x40bb20
movq %rax, %r15
leaq 0x88(%rsp), %rdi
callq 0x4355b4
leaq 0x30(%rbx), %r14
movq %r15, %rdi
callq 0x40be06
movq %r14, %rdi
movq %r15, %rsi
callq 0x40bcac
movq %rsp, %r12
andq $0x0, 0x8(%r12)
movq $0x64ebc0, %rdx         # imm = 0x64EBC0
movq (%rdx), %rax
movq -0x18(%rax), %rax
movl $0xfffffefb, %ecx       # imm = 0xFFFFFEFB
andl 0x18(%rdx,%rax), %ecx
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x18(%rdx,%rax)
movq (%r15), %rax
leaq 0x58(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq *0x28(%rax)
movq %r13, %rdi
callq 0x40f2ea
movapd %xmm0, %xmm1
addsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
movl %ebp, %eax
shlq $0xb, %rax
leaq (%rbx,%rax), %r15
addq $0x70, %r15
movsd 0x1f8(%r15), %xmm0
movsd %xmm0, 0x50(%rsp)
divsd 0x1b3247(%rip), %xmm1   # 0x5be008
movapd %xmm1, 0x20(%rsp)
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b55c1(%rip), %rsi    # 0x5c0396
callq 0x4a4910
leaq 0x1b55b3(%rip), %rsi    # 0x5c0394
movq $0x64ebc0, %rdi         # imm = 0x64EBC0
callq 0x4a4910
movapd 0x1b426b(%rip), %xmm0   # 0x5bf060
xorpd 0x10(%rsp), %xmm0
pushq $0xa
popq %r13
movapd %xmm0, 0x40(%rsp)
movsd %xmm0, (%rsp)
movapd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x40ae6e
movapd 0x40(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movapd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x40ae52
movq %r15, %rdi
movq %r12, %rsi
callq 0x4104c2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x410358
movsd 0x8(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
jmp 0x40ae1c
movq $0x64ebc0, %rdi         # imm = 0x64EBC0
movl %r13d, %esi
callq 0x4a4840
movsd (%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
jmp 0x40ae05
movsd 0x1b428a(%rip), %xmm0   # 0x5bf100
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movq $0x64ebc0, %rdi         # imm = 0x64EBC0
leaq 0x1c557a(%rip), %rsi    # 0x5d040a
callq 0x4a4910
movabsq $0x3f1a36e2eb1c432d, %rax # imm = 0x3F1A36E2EB1C432D
movq %rsp, %r12
movq %rax, 0x8(%r12)
movsd 0x1b4259(%rip), %xmm0   # 0x5bf108
movsd %xmm0, (%rsp)
movsd 0x38(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x40aee5
movq %r15, %rdi
movq %r12, %rsi
callq 0x4104c2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x410358
movsd (%rsp), %xmm0
mulsd 0x1b4235(%rip), %xmm0   # 0x5bf118
jmp 0x40aeaf
movq $0x64ebc0, %r12         # imm = 0x64EBC0
leaq 0x1deea5(%rip), %rsi    # 0x5e9d98
movq %r12, %rdi
callq 0x4a4910
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b549b(%rip), %rsi    # 0x5c03a4
callq 0x4a4910
leaq 0x1b548d(%rip), %rsi    # 0x5c03a2
movq %r12, %rdi
callq 0x4a4910
movq %rsp, %r13
pushq $0xa
popq %r12
movapd 0x40(%rsp), %xmm0
movsd %xmm0, (%rsp)
movapd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x40af95
movapd 0x40(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movapd 0x10(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x40af79
movq %r14, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x40cd1c
movq %rbx, %rdi
movq %r13, %rsi
callq 0x410358
movsd 0x8(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
jmp 0x40af41
movq $0x64ebc0, %rdi         # imm = 0x64EBC0
movl %r12d, %esi
callq 0x4a4840
movsd (%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
jmp 0x40af2a
movq $0x64ebc0, %rdi         # imm = 0x64EBC0
leaq 0x1c5467(%rip), %rsi    # 0x5d040a
callq 0x4a4910
movq %rsp, %r12
movabsq $0x3f1a36e2eb1c432d, %rax # imm = 0x3F1A36E2EB1C432D
movq %rax, 0x8(%r12)
movsd 0x1b4146(%rip), %xmm0   # 0x5bf108
movsd %xmm0, (%rsp)
movsd 0x38(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x40affa
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x40cd1c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x410358
movsd (%rsp), %xmm0
mulsd 0x1b4120(%rip), %xmm0   # 0x5bf118
jmp 0x40afc2
movq $0x64ebc0, %r12         # imm = 0x64EBC0
leaq 0x1ded90(%rip), %rsi    # 0x5e9d98
movq %r12, %rdi
callq 0x4a4910
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b5395(%rip), %rsi    # 0x5c03b3
callq 0x4a4910
leaq 0x1b5398(%rip), %rsi    # 0x5c03c2
movq %r12, %rdi
callq 0x4a4910
movapd 0x20(%rsp), %xmm0
divsd 0x1b2fc8(%rip), %xmm0   # 0x5be008
movapd 0x10(%rsp), %xmm2
mulsd 0x1b40c2(%rip), %xmm2   # 0x5bf110
leaq 0x58(%rsp), %rdi
xorpd %xmm1, %xmm1
callq 0x4359f8
movl $0xf4240, %r12d         # imm = 0xF4240
movq %rsp, %r13
subl $0x1, %r12d
jb 0x40b1ce
movq %r15, %rdi
movq %r13, %rsi
leaq 0x88(%rsp), %rdx
callq 0x40ee42
movsd %xmm0, 0x20(%rsp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x4104c2
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm1
ucomisd 0x1b4079(%rip), %xmm1   # 0x5bf120
jbe 0x40b29c
movapd %xmm1, %xmm0
subsd 0x10(%rsp), %xmm0
andpd 0x1b3fb1(%rip), %xmm0   # 0x5bf070
divsd %xmm1, %xmm0
movsd 0x1b400d(%rip), %xmm1   # 0x5bf0d8
ucomisd %xmm0, %xmm1
jbe 0x40b27d
cmpl $0x0, 0x24009c(%rip)    # 0x64b178
je 0x40b1a4
movq %r14, %rdi
movq %rsp, %rsi
movl %ebp, %edx
callq 0x40cd1c
ucomisd 0x10(%rsp), %xmm0
jbe 0x40b1a4
decl 0x240077(%rip)          # 0x64b178
movq $0x64eaa0, %rdi         # imm = 0x64EAA0
leaq 0x1b53a5(%rip), %rsi    # 0x5c04b4
callq 0x4a4910
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x4a5640
movq %rax, %rdi
leaq 0x1b53a4(%rip), %rsi    # 0x5c04d0
callq 0x4a4910
movq %rax, %r13
movq %r14, %rdi
movq %rsp, %rsi
movl %ebp, %edx
callq 0x40cd1c
movq %r13, %rdi
callq 0x4a5640
movq %rax, %rdi
leaq 0x1b5382(%rip), %rsi    # 0x5c04d5
callq 0x4a4910
movq %rax, %rdi
movq %rsp, %rsi
callq 0x40b917
movq %rax, %rdi
leaq 0x1b5373(%rip), %rsi    # 0x5c04e0
callq 0x4a4910
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
sqrtsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x4a5640
movq %rax, %rdi
leaq 0x1c526b(%rip), %rsi    # 0x5d040a
callq 0x4a4910
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
sqrtsd %xmm1, %xmm0
leaq 0x58(%rsp), %rdi
callq 0x4103e2
jmp 0x40b062
xorpd %xmm0, %xmm0
movq %rsp, %r14
movapd %xmm0, (%r14)
xorl %r15d, %r15d
leaq 0x58(%rsp), %r12
pushq $0x2
popq %rbp
movl %r15d, %r15d
movq 0x60(%rsp), %rax
subq 0x58(%rsp), %rax
sarq $0x3, %rax
cmpq %r15, %rax
je 0x40b261
movq %r12, %rdi
movq %r15, %rsi
callq 0x410428
mulsd 0x50(%rsp), %xmm0
ucomisd 0x1b3f0c(%rip), %xmm0   # 0x5bf120
jne 0x40b218
jnp 0x40b25c
movsd %xmm0, 0x10(%rsp)
cvtsi2sd %r15, %xmm0
addsd 0x1b3ecd(%rip), %xmm0   # 0x5bf0f8
mulsd 0x70(%rsp), %xmm0
addsd 0x78(%rsp), %xmm0
movsd %xmm0, (%rsp)
movl %ebp, %edi
callq 0x41048e
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movq %rbx, %rdi
movq %r14, %rsi
movapd %xmm1, %xmm0
callq 0x410358
incl %r15d
jmp 0x40b1e5
leaq 0x58(%rsp), %rdi
callq 0x435a68
addq $0xc58, %rsp            # imm = 0xC58
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1b5204(%rip), %rdi    # 0x5c0488
leaq 0x1b4b6c(%rip), %rsi    # 0x5bfdf7
leaq 0x1b515d(%rip), %rcx    # 0x5c03ef
movl $0x2bb, %edx            # imm = 0x2BB
callq 0x4ffe80
leaq 0x1b513e(%rip), %rdi    # 0x5c03e1
leaq 0x1b4b4d(%rip), %rsi    # 0x5bfdf7
leaq 0x1b513e(%rip), %rcx    # 0x5c03ef
movl $0x2ba, %edx            # imm = 0x2BA
callq 0x4ffe80
jmp 0x40b2bf
jmp 0x40b2bf
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x435a68
movq %rbx, %rdi
callq 0x4eb220