// File: /workspace/github_c_makefile_star2_O3/esheldon[P]xshear/src/lensum.c
// Function: lensum_write
void lensum_write(Lensum* self, FILE* stream) {
    int nbin = self->nbin;
    int i=0;

    fprintf(stream,"%lld %.16g %lld",
            self->index, self->weight, self->totpairs);

    for (i=0; i<nbin; i++) 
        fprintf(stream," %lld", self->npair[i]);

    for (i=0; i<nbin; i++) 
        fprintf(stream," %.16g", self->rsum[i]);
    for (i=0; i<nbin; i++) 
        fprintf(stream," %.16g", self->wsum[i]);

    if(self->shear_units==UNITS_BOTH) {
        for (i=0; i<nbin; i++) 
            fprintf(stream," %.16g", self->ssum[i]);
    }

    for (i=0; i<nbin; i++) 
        fprintf(stream," %.16g", self->dsum[i]);
    for (i=0; i<nbin; i++) 
        fprintf(stream," %.16g", self->osum[i]);

    if(self->shear_units==UNITS_BOTH || self->shear_style==SHEAR_STYLE_LENSFIT) {
        for (i=0; i<nbin; i++) 
            fprintf(stream," %.16g", self->dsensum_w[i]);
        for (i=0; i<nbin; i++) 
            fprintf(stream," %.16g", self->osensum_w[i]);
    }
    
    if(self->shear_units==UNITS_BOTH) {
        for (i=0; i<nbin; i++) 
            fprintf(stream," %.16g", self->dsensum_s[i]);
        for (i=0; i<nbin; i++) 
            fprintf(stream," %.16g", self->osensum_s[i]);
    }

    fprintf(stream,"\n");

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rdi), %r12
movq 0x10(%rdi), %rdx
movsd 0x18(%rdi), %xmm0
movq 0x20(%rdi), %rcx
leaq 0x3f6f(%rip), %rsi      # 0x94da
movq %rbx, %rdi
movb $0x1, %al
callq 0x21a0
testl %r12d, %r12d
jle 0x56cd
movl %r12d, %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x3f55(%rip), %r15      # 0x94e4
xorl %ebp, %ebp
movq 0x30(%r14), %rax
movq (%rax,%rbp,8), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x21a0
incq %rbp
cmpq %rbp, %r13
jne 0x5591
testl %r12d, %r12d
jle 0x56cd
xorl %ebp, %ebp
leaq 0x3f2a(%rip), %r15      # 0x94ea
movq 0x38(%r14), %rax
movsd (%rax,%rbp,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21a0
incq %rbp
cmpq %rbp, %r13
jne 0x55c0
testl %r12d, %r12d
jle 0x56cd
xorl %ebp, %ebp
leaq 0x3efa(%rip), %r15      # 0x94ea
movq 0x40(%r14), %rax
movsd (%rax,%rbp,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21a0
incq %rbp
cmpq %rbp, %r13
jne 0x55f0
testl %r12d, %r12d
setle %al
cmpl $0x3, 0x4(%r14)
setne %cl
orb %al, %cl
jne 0x5651
movl %r12d, %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
leaq 0x3eb7(%rip), %r15      # 0x94ea
movq 0x48(%r14), %rax
movsd (%rax,%rbp,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21a0
incq %rbp
cmpq %rbp, %r13
jne 0x5633
leaq 0x4(%r14), %rax
testl %r12d, %r12d
jle 0x56d1
movq %rax, (%rsp)
movl %r12d, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r13d, %r13d
leaq 0x3e79(%rip), %r15      # 0x94ea
movq 0x50(%r14), %rax
movsd (%rax,%r13,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21a0
incq %r13
cmpq %r13, %rbp
jne 0x5671
testl %r12d, %r12d
jle 0x56c7
movl %r12d, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r13d, %r13d
leaq 0x3e42(%rip), %r15      # 0x94ea
movq 0x58(%r14), %rax
movsd (%rax,%r13,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21a0
incq %r13
cmpq %r13, %rbp
jne 0x56a8
movq (%rsp), %rax
jmp 0x56d1
leaq 0x4(%r14), %rax
cmpl $0x3, (%rax)
je 0x56e0
cmpl $0x2, (%r14)
jne 0x57cc
movq %rax, (%rsp)
testl %r12d, %r12d
jle 0x5752
movl %r12d, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r13d, %r13d
leaq 0x3dee(%rip), %r15      # 0x94ea
movq 0x60(%r14), %rax
movsd (%rax,%r13,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21a0
incq %r13
cmpq %r13, %rbp
jne 0x56fc
testl %r12d, %r12d
jle 0x5752
movl %r12d, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r13d, %r13d
leaq 0x3db7(%rip), %r15      # 0x94ea
movq 0x68(%r14), %rax
movsd (%rax,%r13,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21a0
incq %r13
cmpq %r13, %rbp
jne 0x5733
testl %r12d, %r12d
setle %al
movq (%rsp), %rcx
cmpl $0x3, (%rcx)
setne %cl
orb %al, %cl
jne 0x57cc
movl %r12d, %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
xorl %ebp, %ebp
leaq 0x3d71(%rip), %r15      # 0x94ea
movq 0x70(%r14), %rax
movsd (%rax,%rbp,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21a0
incq %rbp
cmpq %rbp, %r13
jne 0x5779
testl %r12d, %r12d
jle 0x57cc
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
xorl %r13d, %r13d
leaq 0x3d3d(%rip), %r15      # 0x94ea
movq 0x78(%r14), %rax
movsd (%rax,%r13,8), %xmm0
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x21a0
incq %r13
cmpq %r13, %r12
jne 0x57ad
movl $0xa, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2150