// File: DoubleString[P]RtConverter/src/Rtklib/rcvraw.cpp
// Function: bamboo::decode_subfrm2(unsigned char const*, bamboo::eph_t*)
static int decode_subfrm2(const unsigned char *buff, eph_t *eph)
{
    double sqrtA;
    int i=48;
    
    trace(4,"decode_subfrm2:\n");
    trace(5,"decode_subfrm2: buff="); traceb(5,buff,30);
    
    eph->iode=getbitu(buff,i, 8);              i+= 8;
    eph->crs =getbits(buff,i,16)*P2_5;         i+=16;
    eph->deln=getbits(buff,i,16)*P2_43*SC2RAD; i+=16;
    eph->M0  =getbits(buff,i,32)*P2_31*SC2RAD; i+=32;
    eph->cuc =getbits(buff,i,16)*P2_29;        i+=16;
    eph->e   =getbitu(buff,i,32)*P2_33;        i+=32;
    eph->cus =getbits(buff,i,16)*P2_29;        i+=16;
    sqrtA    =getbitu(buff,i,32)*P2_19;        i+=32;
    eph->toes=getbitu(buff,i,16)*16.0;         i+=16;
    eph->fit =getbitu(buff,i, 1)?0.0:4.0; /* 0:4hr,1:>4hr */
    
    eph->A=sqrtA*sqrtA;
    
    return 2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x30, -0x1c(%rbp)
leaq 0x59a87(%rip), %rsi     # 0xbf395
xorl %eax, %eax
movb %al, -0x4d(%rbp)
movl $0x4, %edi
callq 0x8b980
movb -0x4d(%rbp), %al
leaq 0x59a7f(%rip), %rsi     # 0xbf3a6
movl $0x5, %edi
movl %edi, -0x4c(%rbp)
callq 0x8b980
movl -0x4c(%rbp), %edi
movq -0x8(%rbp), %rsi
movl $0x1e, %edx
callq 0x95900
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl $0x8, %edx
callq 0x8bfc0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x1c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl $0x10, %edx
movl %edx, -0x34(%rbp)
callq 0x8c050
movl -0x34(%rbp), %edx
cvtsi2sd %eax, %xmm0
movsd 0x594ed(%rip), %xmm1    # 0xbee78
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xa0(%rax)
movl -0x1c(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x594ac(%rip), %xmm1    # 0xbee68
mulsd %xmm1, %xmm0
movsd 0x58390(%rip), %xmm1    # 0xbdd58
movsd %xmm1, -0x48(%rbp)
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x80(%rax)
movl -0x1c(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl $0x20, %edx
movl %edx, -0x38(%rbp)
callq 0x8c050
movsd -0x48(%rbp), %xmm1
movl -0x34(%rbp), %edx
cvtsi2sd %eax, %xmm0
movsd 0x575ca(%rip), %xmm2    # 0xbcfd8
mulsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x78(%rax)
movl -0x1c(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x8c050
movl -0x38(%rbp), %edx
cvtsi2sd %eax, %xmm0
movsd 0x5942d(%rip), %xmm1    # 0xbee70
movsd %xmm1, -0x40(%rbp)
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xa8(%rax)
movl -0x1c(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x8bfc0
movl -0x34(%rbp), %edx
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0x593e1(%rip), %xmm1    # 0xbee60
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x58(%rax)
movl -0x1c(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x8c050
movsd -0x40(%rbp), %xmm1
movl -0x38(%rbp), %edx
cvtsi2sd %eax, %xmm0
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb0(%rax)
movl -0x1c(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x8bfc0
movl -0x34(%rbp), %edx
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0x574fc(%rip), %xmm1    # 0xbcfe0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x8bfc0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0x593af(%rip), %xmm1    # 0xbeec0
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xc8(%rax)
movl -0x1c(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl $0x1, %edx
callq 0x8bfc0
xorps %xmm0, %xmm0
movsd 0x572aa(%rip), %xmm1    # 0xbcdf0
movsd %xmm1, -0x30(%rbp)
cmpl $0x0, %eax
movsd %xmm0, -0x28(%rbp)
jne 0x65b5f
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xd0(%rax)
movsd -0x18(%rbp), %xmm0
mulsd -0x18(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x50(%rax)
movl $0x2, %eax
addq $0x50, %rsp
popq %rbp
retq
nop