// File: /workspace/github_c_makefile_star2_O2/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
movl 0x28(%rdi), %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0xc(%rsp)
leaq 0x10(%rdi), %rdx
leaq 0x4a2c(%rip), %r15      # 0x94d5
movq %rsi, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
movl %eax, %ebp
leaq 0x18(%r14), %rdx
leaq 0x4a03(%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
movl $0x0, %r12d
movq %r13, 0x10(%rsp)
cmovgl %r13d, %r12d
shlq $0x3, %r12
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4b23
movq 0x30(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4b02
leaq 0x499c(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4b4e
movq 0x38(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4b2d
leaq 0x4971(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4b79
movq 0x40(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4b58
movl 0xc(%rsp), %eax
addl $0x3, %eax
cmpl $0x3, 0x4(%r14)
movl %eax, 0xc(%rsp)
jne 0x4bbf
leaq 0x4934(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4bb6
movq 0x48(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4b95
movq 0x10(%rsp), %rax
addl %eax, 0xc(%rsp)
leaq 0x4900(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4bea
movq 0x50(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4bc9
leaq 0x48d5(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4c15
movq 0x58(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4bf4
cmpl $0x3, 0x4(%r14)
je 0x4c26
cmpl $0x2, (%r14)
jne 0x4cfb
movq 0x10(%rsp), %rax
addl %eax, %eax
movq %rax, 0x10(%rsp)
leaq 0x488d(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4c5d
movq 0x60(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4c3c
leaq 0x4862(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4c88
movq 0x68(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4c67
movl 0xc(%rsp), %ecx
addl 0x10(%rsp), %ecx
cmpl $0x3, 0x4(%r14)
jne 0x4cff
movl %ecx, 0xc(%rsp)
leaq 0x4824(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4cc6
movq 0x70(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4ca5
leaq 0x47f9(%rip), %r15      # 0x94c6
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x4cf1
movq 0x78(%r14), %rdx
addq %r13, %rdx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
addl %eax, %ebp
addq $0x8, %r13
jmp 0x4cd0
movl 0xc(%rsp), %ecx
addl 0x10(%rsp), %ecx
jmp 0x4cff
movl 0xc(%rsp), %ecx
xorl %eax, %eax
cmpl %ecx, %ebp
sete %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq