// File: Cell-veto[P]postlhc/./ecmc.hpp
// Function: ChainRunner<Jellium3, Monodisperse2D>::time_for_collisions(Storage<Monodisperse2D>*, double, int)
uint64_t time_for_collisions (stor_t *stor, double sr_lr_split, int num_samples)
    {
        set_parameter ("sr_lr_split", sr_lr_split);
        inter.notify_random_context (&random);
        inter.notify_error_bound (stor, stor->cell_diagonal ());

        uint64_t start_time = gclock ();

        direction = 0;
        disp_left = stor->periods ()[0];

        for (int n = 0; n != num_samples; ++n)
        {
            planned_next = active = stor->random_particle (&random);
            planned_disp = disp_left;
            planned_xdisp = 0.;

            find_sr_events (stor);
            find_lr_events (stor);
        }

        uint64_t end_time = gclock ();
        std::cerr << "info optimizing sr_lr_split " << sr_lr_split << " " << (end_time-start_time) << " usec\n";
        return end_time - start_time;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x4771f0
movq -0x90(%rbp), %rdx
leaq 0x1e251c(%rip), %rsi    # 0x5fb3e0
leaq -0x40(%rbp), %rdi
callq 0x407bd0
jmp 0x418ecf
movq -0x98(%rbp), %rdi
movsd -0x18(%rbp), %xmm0
movq (%rdi), %rax
movq 0x18(%rax), %rax
leaq -0x40(%rbp), %rsi
callq *%rax
jmp 0x418eea
leaq -0x40(%rbp), %rdi
callq 0x4f1e40
leaq -0x41(%rbp), %rdi
callq 0x477210
movq -0x98(%rbp), %rsi
movq %rsi, %rdi
addq $0x30, %rdi
addq $0x1870, %rsi           # imm = 0x1870
callq 0x4190d0
movq -0x98(%rbp), %rax
addq $0x30, %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4192b0
movq -0xa8(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0x4190e0
callq 0x46d200
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x60(%rbp)
movl $0x0, 0x2448(%rax)
movq -0x10(%rbp), %rsi
movq (%rsi), %rax
leaq -0x78(%rbp), %rdi
callq *0x28(%rax)
leaq -0x78(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x419310
movq %rax, %rcx
movq -0x98(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x2450(%rax)
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x419049
movq -0x98(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x1870, %rsi           # imm = 0x1870
callq 0x419340
movq -0x98(%rbp), %rdi
movq %rax, 0x2440(%rdi)
movq %rax, 0x2458(%rdi)
movsd 0x2450(%rdi), %xmm0
movsd %xmm0, 0x2460(%rdi)
xorps %xmm0, %xmm0
movsd %xmm0, 0x2468(%rdi)
movq -0x10(%rbp), %rsi
callq 0x4193d0
movq -0x98(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x419a80
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x418fa4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x41903e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x4f1e40
leaq -0x41(%rbp), %rdi
callq 0x477210
jmp 0x4190ba
callq 0x46d200
movq %rax, -0x88(%rbp)
movq $0x698ac0, %rdi         # imm = 0x698AC0
leaq 0x1e36b2(%rip), %rsi    # 0x5fc715
callq 0x4e1b60
movq %rax, %rdi
movsd -0x18(%rbp), %xmm0
callq 0x4e2ad0
movq %rax, %rdi
leaq 0x1ea82e(%rip), %rsi    # 0x6038ad
callq 0x4e1b60
movq %rax, %rdi
movq -0x88(%rbp), %rsi
subq -0x60(%rbp), %rsi
callq 0x4e2170
movq %rax, %rdi
leaq 0x1e3691(%rip), %rsi    # 0x5fc732
callq 0x4e1b60
movq -0x88(%rbp), %rax
subq -0x60(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x5283c0
nopw %cs:(%rax,%rax)
nopl (%rax)