// File: DoubleString[P]RtConverter/src/Rtklib/rcvraw.cpp
// Function: bamboo::decode_subfrm1(unsigned char const*, bamboo::eph_t*)
static int decode_subfrm1(const unsigned char *buff, eph_t *eph)
{
    double tow,toc;
    int i=48,week,iodc0,iodc1,tgd;
    
    trace(4,"decode_subfrm1:\n");
    trace(5,"decode_subfrm1: buff="); traceb(5,buff,30);
    
    tow        =getbitu(buff,24,17)*6.0;           /* transmission time */
    week       =getbitu(buff,i,10);       i+=10;
    eph->code  =getbitu(buff,i, 2);       i+= 2;
    eph->sva   =getbitu(buff,i, 4);       i+= 4;   /* ura index */
    eph->svh   =getbitu(buff,i, 6);       i+= 6;
    iodc0      =getbitu(buff,i, 2);       i+= 2;
    eph->flag  =getbitu(buff,i, 1);       i+= 1+87;
    tgd        =getbits(buff,i, 8);       i+= 8;
    iodc1      =getbitu(buff,i, 8);       i+= 8;
    toc        =getbitu(buff,i,16)*16.0;  i+=16;
    eph->f2    =getbits(buff,i, 8)*P2_55; i+= 8;
    eph->f1    =getbits(buff,i,16)*P2_43; i+=16;
    eph->f0    =getbits(buff,i,22)*P2_31;
    
    eph->tgd[0]=tgd==-128?0.0:tgd*P2_31; /* ref [4] */
    eph->iodc=(iodc0<<8)+iodc1;
    eph->week=adjgpsweek(week); /* week of tow */
    eph->ttr=gpst2time(eph->week,tow);
    eph->toc=gpst2time(eph->week,toc);
    
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x30, -0x24(%rbp)
leaq 0x59d7d(%rip), %rsi     # 0xbf36e
xorl %eax, %eax
movb %al, -0x69(%rbp)
movl $0x4, %edi
movl %edi, -0x64(%rbp)
callq 0x8b980
movb -0x69(%rbp), %al
leaq 0x59d72(%rip), %rsi     # 0xbf37f
movl $0x5, %edi
movl %edi, -0x68(%rbp)
callq 0x8b980
movl -0x68(%rbp), %edi
movq -0x8(%rbp), %rsi
movl $0x1e, %edx
callq 0x95900
movq -0x8(%rbp), %rdi
movl $0x18, %esi
movl $0x11, %edx
callq 0x8bfc0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0x57923(%rip), %xmm1    # 0xbcf70
mulsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0xa, %edx
callq 0x8bfc0
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x2, %edx
movl %edx, -0x60(%rbp)
callq 0x8bfc0
movl -0x64(%rbp), %edx
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8bfc0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x24(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x6, %edx
callq 0x8bfc0
movl -0x60(%rbp), %edx
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x24(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8bfc0
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x1, %edx
callq 0x8bfc0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl -0x24(%rbp), %eax
addl $0x58, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x8, %edx
movl %edx, -0x5c(%rbp)
callq 0x8c050
movl -0x5c(%rbp), %edx
movl %eax, -0x34(%rbp)
movl -0x24(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x8bfc0
movl %eax, -0x30(%rbp)
movl -0x24(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x10, %edx
callq 0x8bfc0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0x5974a(%rip), %xmm1    # 0xbeec0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x8, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x59713(%rip), %xmm1    # 0xbeeb8
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xe8(%rax)
movl -0x24(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x10, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x5968d(%rip), %xmm1    # 0xbee68
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xe0(%rax)
movl -0x24(%rbp), %eax
addl $0x10, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x16, %edx
callq 0x8c050
cvtsi2sd %eax, %xmm0
movsd 0x577c7(%rip), %xmm1    # 0xbcfd8
mulsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xd8(%rax)
cmpl $-0x80, -0x34(%rbp)
jne 0x65831
xorps %xmm0, %xmm0
movsd %xmm0, -0x78(%rbp)
jmp 0x65847
cvtsi2sdl -0x34(%rbp), %xmm0
movsd 0x5779a(%rip), %xmm1    # 0xbcfd8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x78(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xf0(%rax)
movl -0x2c(%rbp), %ecx
shll $0x8, %ecx
addl -0x30(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0x28(%rbp), %edi
callq 0x8f7e0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %edi
movsd -0x18(%rbp), %xmm0
callq 0x8e4a0
movq %rax, -0x48(%rbp)
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq -0x40(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %edi
movsd -0x20(%rbp), %xmm0
callq 0x8e4a0
movq %rax, -0x58(%rbp)
movsd %xmm0, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, 0x30(%rax)
movq -0x50(%rbp), %rcx
movq %rcx, 0x38(%rax)
movl $0x1, %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)