// File: /workspace/github_c_makefile_star2_O3/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 0x37e0(%rip), %r15      # 0x94e5
movq %rsi, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
movl %eax, %ebp
leaq 0x18(%r14), %rdx
leaq 0x37b7(%rip), %rsi      # 0x94d6
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 0x5df0
movl %r13d, %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
leaq 0x3781(%rip), %r15      # 0x94e5
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 0x5d67
movq 0x8(%rsp), %r12
testl %r12d, %r12d
jle 0x5df0
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq %r12, %r13
xorl %r15d, %r15d
movq 0x38(%r14), %rdx
addq %r15, %rdx
movq %rbx, %rdi
leaq 0x3728(%rip), %rsi      # 0x94d6
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r15
decq %r13
jne 0x5d9d
cmpl $0x0, 0x8(%rsp)
jle 0x5df0
leaq 0x3708(%rip), %r15      # 0x94d6
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 0x5dd1
movq 0x8(%rsp), %r13
leal 0x3(%r13,%r13,4), %ecx
cmpl $0x3, 0x4(%r14)
jne 0x5e4a
addl %r13d, %ecx
testl %r13d, %r13d
jle 0x5f63
movq %rcx, (%rsp)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x36b7(%rip), %r15      # 0x94d6
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 0x5e22
movq 0x8(%rsp), %r13
movq (%rsp), %rcx
movq %rcx, (%rsp)
testl %r13d, %r13d
jle 0x5ebd
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x3675(%rip), %r15      # 0x94d6
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 0x5e64
movq 0x8(%rsp), %r13
testl %r13d, %r13d
jle 0x5ebd
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x363b(%rip), %r15      # 0x94d6
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 0x5e9e
cmpl $0x3, 0x4(%r14)
je 0x5ece
cmpl $0x2, (%r14)
jne 0x5feb
movq 0x8(%rsp), %r13
leal (,%r13,2), %eax
movq (%rsp), %rcx
leal (%rcx,%r13,2), %ecx
testl %r13d, %r13d
jle 0x5f6f
movl %eax, 0x14(%rsp)
movq %rcx, (%rsp)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movq %r13, %r12
xorl %r15d, %r15d
movq 0x60(%r14), %rdx
addq %r15, %rdx
movq %rbx, %rdi
leaq 0x35c4(%rip), %rsi      # 0x94d6
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r15
decq %r12
jne 0x5f01
cmpl $0x0, 0x8(%rsp)
jle 0x5f54
leaq 0x35a4(%rip), %r15      # 0x94d6
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 0x5f35
movq 0x8(%rsp), %r13
movq (%rsp), %rcx
movl 0x14(%rsp), %eax
jmp 0x5f6f
leal (,%r13,2), %eax
leal (%rcx,%r13,2), %ecx
cmpl $0x3, 0x4(%r14)
jne 0x5fef
addl %eax, %ecx
testl %r13d, %r13d
jle 0x5fef
movq %rcx, (%rsp)
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x3547(%rip), %r15      # 0x94d6
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 0x5f92
movq 0x8(%rsp), %r13
testl %r13d, %r13d
jle 0x5feb
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
leaq 0x350d(%rip), %r15      # 0x94d6
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 0x5fcc
movq (%rsp), %rcx
xorl %eax, %eax
cmpl %ecx, %ebp
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq