// File: /workspace/github_c_makefile_star2_O0/esheldon[P]xshear/src/source.c
// Function: source_read
int source_read(FILE* stream, Source* src) {
    size_t i=0;
    double ra_rad,dec_rad;
    int nread=0;
    int nexpect=0;

    if(src->sourceid_style==SOURCEID_STYLE_INDEX) {
    	nread += fscanf(stream, "%ld %lf %lf %lf %lf", 
                    &src->index,
                    &src->ra, &src->dec,
                    &src->g1, &src->g2);
    	nexpect += 5;
    } else {
    	nread += fscanf(stream, "%lf %lf %lf %lf",
                    &src->ra, &src->dec,
                    &src->g1, &src->g2);
    	src->index=0;
    	nexpect += 4;    
    }

    if (src->shear_style==SHEAR_STYLE_LENSFIT) {
        nread += fscanf(stream, "%lf %lf", &src->g1sens, &src->g2sens);
        nexpect += 2;
    }

    nread += fscanf(stream, "%lf", &src->weight);

    nexpect += 1;

    if (src->scstyle == SIGMACRIT_STYLE_INTERP) {
        nexpect += src->scinv->size;
        for (i=0; i<src->scinv->size; i++) {
            nread += fscanf(stream,"%lf", &src->scinv->data[i]);
        }
    } else {
        nread += fscanf(stream,"%lf", &src->z);
        nexpect += 1;
    }

    if (src->scstyle == SIGMACRIT_STYLE_SAMPLE) {
        nread += fscanf(stream,"%lf", &src->zs);
        nexpect += 1;
    }

    ra_rad = src->ra*D2R;
    dec_rad = src->dec*D2R;
    src->sinra = sin(ra_rad);
    src->cosra = cos(ra_rad);
    src->sindec = sin(dec_rad);
    src->cosdec = cos(dec_rad);

    // add sin(lam),cos(lam),sin(eta),cos(eta)
    if (src->mask_style == MASK_STYLE_SDSS) {
        eq2sdss_sincos(src->ra,src->dec,
                &src->sinlam, &src->coslam,
                &src->sineta, &src->coseta);
    }

    return (nread == nexpect);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, 0xc(%rax)
jne 0x742f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x10, %rdx
movq -0x10(%rbp), %rcx
addq $0x18, %rcx
movq -0x10(%rbp), %r8
addq $0x20, %r8
movq -0x10(%rbp), %r9
addq $0x28, %r9
movq -0x10(%rbp), %rax
addq $0x30, %rax
leaq 0x85a1(%rip), %rsi      # 0xf9b4
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2070
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x5, %eax
movl %eax, -0x30(%rbp)
jmp 0x747c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x18, %rdx
movq -0x10(%rbp), %rcx
addq $0x20, %rcx
movq -0x10(%rbp), %r8
addq $0x28, %r8
movq -0x10(%rbp), %r9
addq $0x30, %r9
leaq 0x855e(%rip), %rsi      # 0xf9b8
movb $0x0, %al
callq 0x2070
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
movl -0x30(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x74b6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x38, %rdx
movq -0x10(%rbp), %rcx
addq $0x40, %rcx
leaq 0x8520(%rip), %rsi      # 0xf9c0
movb $0x0, %al
callq 0x2070
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x48, %rdx
leaq 0x84fb(%rip), %rsi      # 0xf9c4
movb $0x0, %al
callq 0x2070
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, 0x8(%rax)
jne 0x7556
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq (%rax), %rcx
movslq -0x30(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x30(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpq (%rcx), %rax
jae 0x7554
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x18(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x848b(%rip), %rsi      # 0xf9c4
movb $0x0, %al
callq 0x2070
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x7506
jmp 0x757f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x68, %rdx
leaq 0x845b(%rip), %rsi      # 0xf9c4
movb $0x0, %al
callq 0x2070
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x3, 0x8(%rax)
jne 0x75b2
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x78, %rdx
leaq 0x8428(%rip), %rsi      # 0xf9c4
movb $0x0, %al
callq 0x2070
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movsd 0x83aa(%rip), %xmm0     # 0xf968
mulsd 0x18(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movsd 0x8394(%rip), %xmm0     # 0xf968
mulsd 0x20(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x2220
movq -0x10(%rbp), %rax
movsd %xmm0, 0x88(%rax)
movsd -0x20(%rbp), %xmm0
callq 0x2120
movq -0x10(%rbp), %rax
movsd %xmm0, 0x90(%rax)
movsd -0x28(%rbp), %xmm0
callq 0x2220
movq -0x10(%rbp), %rax
movsd %xmm0, 0x98(%rax)
movsd -0x28(%rbp), %xmm0
callq 0x2120
movq -0x10(%rbp), %rax
movsd %xmm0, 0xa0(%rax)
movq -0x10(%rbp), %rax
cmpl $0x2, 0x4(%rax)
jne 0x7683
movq -0x10(%rbp), %rax
movsd 0x18(%rax), %xmm0
movq -0x10(%rbp), %rax
movsd 0x20(%rax), %xmm1
movq -0x10(%rbp), %rdi
addq $0xa8, %rdi
movq -0x10(%rbp), %rsi
addq $0xb0, %rsi
movq -0x10(%rbp), %rdx
addq $0xb8, %rdx
movq -0x10(%rbp), %rcx
addq $0xc0, %rcx
callq 0xdb00
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)