// File: /workspace/github_cpp_makefile_star2_O3/Cell-veto[P]postlhc/paircorrel.cpp
// Function: Correlator<Monodisperse2D>::savetxt(std::ostream&)
virtual void savetxt (std::ostream &os)
    {
        const double exp_sample_dens = ndata_ * rho_;
        hist_[0] = 0;

        double rv1 = 0., rv2;
        for (unsigned i = 0; i != hist_.size (); ++i)
        {
            double r = (i+.5) * binwid_;
            rv2 = ball_volume (DIM, (i+1) * binwid_);
            double expected = exp_sample_dens * (rv2-rv1);
            double gofr = hist_[i] / expected;
            os << std::setprecision (3) << std::fixed
                << r << ' '
                << std::setprecision (12) << std::scientific
                << gofr << '\n';
            rv1 = rv2;
        }

        os << "# gofr_stat " << ndata_ << " fin\n";
        std::cerr << "gofr_stat " << ndata_ << " wrote histo\n";
        std::cerr << "gofr_walltime " << walltime_*1e-6 << " seconds\n";
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movsd 0xc48(%rdi), %xmm0
unpcklps 0x18c93c(%rip), %xmm0   # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movq %rsi, %r14
subpd 0x18c941(%rip), %xmm0   # 0x5c9ff0
movapd %xmm0, %xmm5
unpckhpd %xmm0, %xmm5            # xmm5 = xmm5[1],xmm0[1]
addsd %xmm0, %xmm5
mulsd 0xc00(%rdi), %xmm5
movq 0xc30(%rdi), %rax
movq $0x0, (%rax)
cmpq %rax, 0xc38(%rdi)
je 0x43d822
xorl %ecx, %ecx
xorpd %xmm1, %xmm1
movl $0xfffffefb, %ebp       # imm = 0xFFFFFEFB
leaq 0x6(%rsp), %r15
leaq 0x7(%rsp), %r12
xorl %r13d, %r13d
movapd %xmm5, 0x10(%rsp)
movl %r13d, %edx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
incl %r13d
xorps %xmm3, %xmm3
cvtsi2sd %r13, %xmm3
movsd 0xbf8(%rbx), %xmm2
mulsd %xmm2, %xmm3
mulsd %xmm3, %xmm3
mulsd 0x1926a6(%rip), %xmm3   # 0x5cfdd0
movsd %xmm3, 0x8(%rsp)
movsd (%rax,%rcx,8), %xmm4
unpcklps 0x18c8a4(%rip), %xmm4   # xmm4 = xmm4[0],mem[0],xmm4[1],mem[1]
subsd %xmm1, %xmm3
subpd 0x18c8a8(%rip), %xmm4   # 0x5c9ff0
movapd %xmm4, %xmm1
unpckhpd %xmm4, %xmm1            # xmm1 = xmm1[1],xmm4[1]
addsd %xmm4, %xmm1
mulsd %xmm5, %xmm3
divsd %xmm3, %xmm1
movapd %xmm1, 0x20(%rsp)
movq (%r14), %rax
addsd 0x18c983(%rip), %xmm0   # 0x5ca0f0
movq -0x18(%rax), %rcx
movq $0x3, 0x8(%r14,%rcx)
movq -0x18(%rax), %rax
mulsd %xmm2, %xmm0
movl 0x18(%r14,%rax), %ecx
andl %ebp, %ecx
orl $0x4, %ecx
movl %ecx, 0x18(%r14,%rax)
movq %r14, %rdi
callq 0x4b1380
movb $0x20, 0x6(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x4b0120
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movq $0xc, 0x8(%rax,%rdx)
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %ebp, %edx
orl $0x100, %edx            # imm = 0x100
movl %edx, 0x18(%rax,%rcx)
movq %rax, %rdi
movapd 0x20(%rsp), %xmm0
callq 0x4b1380
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x4b0120
movapd 0x10(%rsp), %xmm5
movq 0xc30(%rbx), %rax
movq 0xc38(%rbx), %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movq %r13, %rcx
movsd 0x8(%rsp), %xmm1
cmpq %r13, %rdx
jne 0x43d6fc
leaq 0x1926fa(%rip), %rsi    # 0x5cff23
movl $0xc, %edx
movq %r14, %rdi
callq 0x4b0120
movq 0xc48(%rbx), %rsi
movq %r14, %rdi
callq 0x4b0a20
leaq 0x1926e4(%rip), %rsi    # 0x5cff30
movl $0x5, %edx
movq %rax, %rdi
callq 0x4b0120
movq $0x655aa0, %r14         # imm = 0x655AA0
leaq 0x1926be(%rip), %rsi    # 0x5cff25
movl $0xa, %edx
movq %r14, %rdi
callq 0x4b0120
movq 0xc48(%rbx), %rsi
movq %r14, %rdi
callq 0x4b0a20
leaq 0x1926ac(%rip), %rsi    # 0x5cff36
movl $0xd, %edx
movq %rax, %rdi
callq 0x4b0120
leaq 0x1926a6(%rip), %rsi    # 0x5cff44
movl $0xe, %edx
movq %r14, %rdi
callq 0x4b0120
movsd 0xc50(%rbx), %xmm1
unpcklps 0x18c726(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x18c72e(%rip), %xmm1   # 0x5c9ff0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x18c7fa(%rip), %xmm0   # 0x5ca0d0
movq %r14, %rdi
callq 0x4b1380
leaq 0x18ca5a(%rip), %rsi    # 0x5ca33f
movl $0x9, %edx
movq %rax, %rdi
callq 0x4b0120
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop