// File: Cell-veto[P]postlhc/./adap_prober.hpp
// Function: double AdaptiveProber::random_probe<2ul>(std::array<double, 2ul>*, RandomContext*)
double random_probe (vector <DIM> *ret, RandomContext *random)
    {
        double x = random->real (total_probe_rate ());
        unsigned i = bin_from_quantile (x);

        if (i == 0)
        {
            *ret = random->fromball <DIM> (binrad_[0]);

            // return probe rate
            return binrate_[0];
        }
        else if (i < N_)
        {
            // sample radial distance
            double iexpon = DIM - (1.+binexp_[i]);
            double w_min = pow (binrad_[i]/binrad_[i-1], iexpon);
            double w = 1 - random->real () * (1-w_min);
            double r = binrad_[i-1] * pow (w, 1. / iexpon);

            // add direction
            *ret = random->fromsphere <DIM> (r);

            // return probe rate
            return binrate_[i] * pow (r, -(1.+binexp_[i]));
        }

        std::cerr << "random_probe: impossible" << ABORT;
        return 0.;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x78(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
callq 0x41f570
movq -0x80(%rbp), %rdi
callq 0x46e1b0
movq -0x78(%rbp), %rdi
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x41f8a0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x41f68f
movq -0x78(%rbp), %rdi
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
addq $0x200, %rdi            # imm = 0x200
xorl %eax, %eax
movl %eax, %esi
callq 0x41b830
movq -0x88(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x46e710
movq -0x78(%rbp), %rdi
movsd %xmm0, -0x40(%rbp)
movsd %xmm1, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x600, %rdi            # imm = 0x600
xorl %eax, %eax
movl %eax, %esi
callq 0x41b830
movsd (%rax), %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x41f88c
cmpl $0x40, -0x2c(%rbp)
jae 0x41f868
movq -0x78(%rbp), %rdi
addq $0x400, %rdi            # imm = 0x400
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x41b830
movq -0x78(%rbp), %rdi
movsd 0x1db95e(%rip), %xmm1   # 0x5fb018
addsd (%rax), %xmm1
movsd 0x1dcbea(%rip), %xmm0   # 0x5fc2b0
subsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
addq $0x200, %rdi            # imm = 0x200
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x41b830
movq -0x78(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0xa8(%rbp)
addq $0x200, %rdi            # imm = 0x200
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x41b830
movsd -0xa8(%rbp), %xmm0
divsd (%rax), %xmm0
movsd -0x48(%rbp), %xmm1
callq 0x51ef10
movsd %xmm0, -0x50(%rbp)
movq -0x20(%rbp), %rdi
callq 0x46e170
movq -0x78(%rbp), %rdi
movsd 0x1db8e2(%rip), %xmm1   # 0x5fb018
subsd -0x50(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm1, %xmm0
movsd 0x1db8ba(%rip), %xmm1   # 0x5fb018
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
addq $0x200, %rdi            # imm = 0x200
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x41b830
movsd (%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x58(%rbp), %xmm0
movsd 0x1db882(%rip), %xmm1   # 0x5fb018
divsd -0x48(%rbp), %xmm1
callq 0x51ef10
movaps %xmm0, %xmm1
movsd -0xa0(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x20(%rbp), %rdi
movsd -0x60(%rbp), %xmm0
callq 0x46e580
movq -0x78(%rbp), %rdi
movsd %xmm0, -0x70(%rbp)
movsd %xmm1, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, (%rax)
movq -0x68(%rbp), %rcx
movq %rcx, 0x8(%rax)
addq $0x600, %rdi            # imm = 0x600
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x41b830
movq -0x78(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
addq $0x400, %rdi            # imm = 0x400
movl -0x2c(%rbp), %eax
movl %eax, %esi
callq 0x41b830
movsd -0x98(%rbp), %xmm0
movsd 0x1db7e6(%rip), %xmm1   # 0x5fb018
addsd (%rax), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
callq 0x51ef10
movaps %xmm0, %xmm1
movsd -0x90(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x41f88c
jmp 0x41f86a
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1dda3a(%rip), %rsi    # 0x5fd2b2
callq 0x4e1b60
movq %rax, %rdi
leaq 0x277d9a(%rip), %rsi    # 0x697621
callq 0x46d700
movsd -0x8(%rbp), %xmm0
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)