// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, %r14
movq %rdi, %rbx
movsd 0xc48(%rdi), %xmm0
unpcklps 0x18bbe1(%rip), %xmm0   # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x18bbe9(%rip), %xmm0   # 0x5bf050
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
mulsd 0xc00(%rdi), %xmm1
movapd %xmm1, 0x20(%rsp)
movq 0xc30(%rdi), %rax
andq $0x0, (%rax)
xorpd %xmm0, %xmm0
pushq $0x1
popq %r13
movl $0xfffffefb, %ebp       # imm = 0xFFFFFEFB
pushq $0xa
popq %r12
leal -0x1(%r13), %r15d
movq 0xc38(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
je 0x4335c2
cvtsi2sd %r15, %xmm2
addsd 0x18bc33(%rip), %xmm2   # 0x5bf0f8
movsd 0xbf8(%rbx), %xmm1
mulsd %xmm1, %xmm2
movsd %xmm2, 0x10(%rsp)
movl %r13d, %eax
movsd %xmm0, (%rsp)
cvtsi2sd %rax, %xmm0
mulsd %xmm1, %xmm0
pushq $0x2
popq %rdi
callq 0x40d8e5
movsd %xmm0, 0x18(%rsp)
movapd %xmm0, %xmm2
subsd (%rsp), %xmm2
mulsd 0x20(%rsp), %xmm2
movq 0xc30(%rbx), %rax
movsd (%rax,%r15,8), %xmm1
unpcklps 0x18bb27(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x18bb2f(%rip), %xmm1   # 0x5bf050
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd %xmm2, %xmm0
movapd %xmm0, (%rsp)
movq (%r14), %rax
movq -0x18(%rax), %rcx
movq $0x3, 0x8(%r14,%rcx)
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl %ebp, %ecx
orl $0x4, %ecx
movl %ecx, 0x18(%r14,%rax)
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x4a5640
movq %rax, %rdi
pushq $0x20
popq %rsi
callq 0x4a4840
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
movaps (%rsp), %xmm0
callq 0x4a5640
movq %rax, %rdi
movl %r12d, %esi
callq 0x4a4840
movq 0xc30(%rbx), %rax
incl %r13d
movsd 0x18(%rsp), %xmm0
jmp 0x43349d
leaq 0x192039(%rip), %rsi    # 0x5c5602
movq %r14, %rdi
callq 0x4a4910
movq 0xc48(%rbx), %rsi
movq %rax, %rdi
callq 0x4a4ce0
leaq 0x192028(%rip), %rsi    # 0x5c560f
movq %rax, %rdi
callq 0x4a4910
movq $0x64eaa0, %r14         # imm = 0x64EAA0
leaq 0x192007(%rip), %rsi    # 0x5c5604
movq %r14, %rdi
callq 0x4a4910
movq 0xc48(%rbx), %rsi
movq %rax, %rdi
callq 0x4a4ce0
leaq 0x191ffa(%rip), %rsi    # 0x5c5615
movq %rax, %rdi
callq 0x4a4910
leaq 0x191ff9(%rip), %rsi    # 0x5c5623
movq %r14, %rdi
callq 0x4a4910
movsd 0xc50(%rbx), %xmm1
unpcklps 0x18b9ff(%rip), %xmm1   # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x18ba07(%rip), %xmm1   # 0x5bf050
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x18ba7b(%rip), %xmm0   # 0x5bf0d8
movq %rax, %rdi
callq 0x4a5640
leaq 0x18bd10(%rip), %rsi    # 0x5bf37c
movq %rax, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4a4910