// File: /workspace/github_c_makefile_star2_O1/esheldon[P]xshear/src/lensum.c
// Function: lensum_read_into
int lensum_read_into(Lensum* self, FILE* stream) {
    int nbin=self->nbin;
    int nexpect = 3+5*nbin;
    int nread=0;
    int i=0;

    nread+=fscanf(stream,"%lld", &self->index);
    nread+=fscanf(stream,"%lf", &self->weight);
    nread+=fscanf(stream,"%lld", &self->totpairs);

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

    for (i=0; i<nbin; i++) 
        nread+=fscanf(stream,"%lf", &self->rsum[i]);
        
        
    for (i=0; i<nbin; i++) 
        nread+=fscanf(stream,"%lf", &self->wsum[i]);

    if(self->shear_units==UNITS_BOTH) {
        nexpect += nbin;
        for (i=0; i<nbin; i++) 
            nread+=fscanf(stream,"%lf", &self->ssum[i]);
    }
    
    for (i=0; i<nbin; i++) 
        nread+=fscanf(stream,"%lf", &self->dsum[i]);
    for (i=0; i<nbin; i++) 
        nread+=fscanf(stream,"%lf", &self->osum[i]);

    if(self->shear_units==UNITS_BOTH || self->shear_style==SHEAR_STYLE_LENSFIT) {
        nexpect += 2*nbin;
        for (i=0; i<nbin; i++) 
            nread+=fscanf(stream,"%lf", &self->dsensum_w[i]);
        for (i=0; i<nbin; i++) 
            nread+=fscanf(stream,"%lf", &self->osensum_w[i]);
    }
    
    if(self->shear_units==UNITS_BOTH) {
        nexpect += 2*nbin;
        for (i=0; i<nbin; i++) 
            nread+=fscanf(stream,"%lf", &self->dsensum_s[i]);
        for (i=0; i<nbin; i++) 
            nread+=fscanf(stream,"%lf", &self->osensum_s[i]);
    }
    
    return (nread == nexpect);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rdi), %r13
leaq 0x10(%rdi), %rdx
leaq 0x38eb(%rip), %r15      # 0x94d5
movq %rsi, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
movl %eax, %ebp
leaq 0x18(%r14), %rdx
leaq 0x38c2(%rip), %rsi      # 0x94c6
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2070
movl %eax, %r12d
addl %ebp, %r12d
leaq 0x20(%r14), %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
movl %eax, %ebp
addl %r12d, %ebp
testl %r13d, %r13d
movq %r13, 0x8(%rsp)
jle 0x5c67
movl %r13d, %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
leaq 0x3890(%rip), %r15      # 0x94d5
xorl %r13d, %r13d
movq 0x30(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
decq %r12
jne 0x5c48
movq 0x8(%rsp), %r12
testl %r12d, %r12d
jle 0x5ca1
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
leaq 0x3847(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
movq 0x38(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
decq %r12
jne 0x5c82
movq 0x8(%rsp), %r12
testl %r12d, %r12d
jle 0x5cdb
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
leaq 0x380d(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
movq 0x40(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
decq %r12
jne 0x5cbc
movq 0x8(%rsp), %r13
leal 0x3(%r13,%r13,4), %eax
cmpl $0x3, 0x4(%r14)
jne 0x5d33
addl %r13d, %eax
testl %r13d, %r13d
jle 0x5d33
movq %rax, 0x10(%rsp)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x37bf(%rip), %r15      # 0x94c6
xorl %r12d, %r12d
movq 0x48(%r14), %rdx
addq %r12, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r12
decq %r13
jne 0x5d0a
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rsp)
testl %r13d, %r13d
jle 0x5d6d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x377b(%rip), %r15      # 0x94c6
xorl %r12d, %r12d
movq 0x50(%r14), %rdx
addq %r12, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r12
decq %r13
jne 0x5d4e
movq 0x8(%rsp), %r13
testl %r13d, %r13d
jle 0x5da7
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x3741(%rip), %r15      # 0x94c6
xorl %r12d, %r12d
movq 0x58(%r14), %rdx
addq %r12, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r12
decq %r13
jne 0x5d88
cmpl $0x3, 0x4(%r14)
je 0x5db8
cmpl $0x2, (%r14)
jne 0x5e3a
movq 0x8(%rsp), %r13
testl %r13d, %r13d
jle 0x5df2
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x36f6(%rip), %r15      # 0x94c6
xorl %r12d, %r12d
movq 0x60(%r14), %rdx
addq %r12, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r12
decq %r13
jne 0x5dd3
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %rax
leal (%rax,%r13,2), %eax
movq %rax, 0x10(%rsp)
testl %r13d, %r13d
jle 0x5e3f
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x36ae(%rip), %r15      # 0x94c6
xorl %r12d, %r12d
movq 0x68(%r14), %rdx
addq %r12, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r12
decq %r13
jne 0x5e1b
movq 0x8(%rsp), %r13
cmpl $0x3, 0x4(%r14)
jne 0x5ec3
testl %r13d, %r13d
jle 0x5e7b
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x366d(%rip), %r15      # 0x94c6
xorl %r12d, %r12d
movq 0x70(%r14), %rdx
addq %r12, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r12
decq %r13
jne 0x5e5c
movq 0x8(%rsp), %r13
movq 0x10(%rsp), %rax
leal (%rax,%r13,2), %eax
movq %rax, 0x10(%rsp)
testl %r13d, %r13d
jle 0x5ec3
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x3625(%rip), %r15      # 0x94c6
xorl %r12d, %r12d
movq 0x78(%r14), %rdx
addq %r12, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r12
decq %r13
jne 0x5ea4
xorl %eax, %eax
cmpl 0x10(%rsp), %ebp
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq