// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm2.cpp
// Function: bamboo::decode_type17(bamboo::rtcm_t*)
static int decode_type17(rtcm_t *rtcm)
{
    eph_t eph={0};
    double toc,sqrtA;
    int i=48,week,prn,sat;
    
    trace(4,"decode_type17: len=%d\n",rtcm->len);
    
    if (i+480<=rtcm->len*8) {
        week      =getbitu(rtcm->buff,i,10);              i+=10;
        eph.idot  =getbits(rtcm->buff,i,14)*P2_43*SC2RAD; i+=14;
        eph.iode  =getbitu(rtcm->buff,i, 8);              i+= 8;
        toc       =getbitu(rtcm->buff,i,16)*16.0;         i+=16;
        eph.f1    =getbits(rtcm->buff,i,16)*P2_43;        i+=16;
        eph.f2    =getbits(rtcm->buff,i, 8)*P2_55;        i+= 8;
        eph.crs   =getbits(rtcm->buff,i,16)*P2_5;         i+=16;
        eph.deln  =getbits(rtcm->buff,i,16)*P2_43*SC2RAD; i+=16;
        eph.cuc   =getbits(rtcm->buff,i,16)*P2_29;        i+=16;
        eph.e     =getbitu(rtcm->buff,i,32)*P2_33;        i+=32;
        eph.cus   =getbits(rtcm->buff,i,16);              i+=16;
        sqrtA     =getbitu(rtcm->buff,i,32)*P2_19;        i+=32;
        eph.toes  =getbitu(rtcm->buff,i,16);              i+=16;
        eph.OMG0  =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        eph.cic   =getbits(rtcm->buff,i,16)*P2_29;        i+=16;
        eph.i0    =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        eph.cis   =getbits(rtcm->buff,i,16)*P2_29;        i+=16;
        eph.omg   =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        eph.crc   =getbits(rtcm->buff,i,16)*P2_5;         i+=16;
        eph.OMGd  =getbits(rtcm->buff,i,24)*P2_43*SC2RAD; i+=24;
        eph.M0    =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        eph.iodc  =getbitu(rtcm->buff,i,10);              i+=10;
        eph.f0    =getbits(rtcm->buff,i,22)*P2_31;        i+=22;
        prn       =getbitu(rtcm->buff,i, 5);              i+= 5+3;
        eph.tgd[0]=getbits(rtcm->buff,i, 8)*P2_31;        i+= 8;
        eph.code  =getbitu(rtcm->buff,i, 2);              i+= 2;
        eph.sva   =getbitu(rtcm->buff,i, 4);              i+= 4;
        eph.svh   =getbitu(rtcm->buff,i, 6);              i+= 6;
        eph.flag  =getbitu(rtcm->buff,i, 1);
    }
    else {
        trace(2,"rtcm2 17 length error: len=%d\n",rtcm->len);
        return -1;
    }
    if (prn==0) prn=32;
    sat=satno(SYS_GPS,prn);
    eph.sat=sat;
    eph.week=adjgpsweek(week);
    eph.toe=gpst2time(eph.week,eph.toes);
    eph.toc=gpst2time(eph.week,toc);
    eph.ttr=rtcm->time;
    eph.A=sqrtA*sqrtA;
    rtcm->nav.eph[sat-1]=eph;
    rtcm->ephsat=sat;
    return 2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x110(%rbp)
movl 0x9f0c0(%rdi), %edx
leaq 0x345da(%rip), %rsi     # 0x6e53a
movl $0x4, %edi
xorl %eax, %eax
callq 0x4ded0
movl 0x9f0c0(%rbx), %edx
cmpl $0x42, %edx
jl 0x3a5e4
leaq 0x9f0c4(%rbx), %r12
movq %r12, %rdi
movl $0x30, %esi
movl $0xa, %edx
callq 0x4e341
movl %eax, %r15d
movq %r12, %rdi
movl $0x3a, %esi
movl $0xe, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32d18(%rip), %xmm0    # 0x6ccd0
mulsd 0x31de8(%rip), %xmm0    # 0x6bda8
movsd %xmm0, -0xf8(%rbp)
movq %r12, %rdi
movl $0x48, %esi
movl $0x8, %edx
callq 0x4e341
movl %eax, -0x3c(%rbp)
movq %r12, %rdi
movl $0x50, %esi
movl $0x10, %edx
callq 0x4e341
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x32d77(%rip), %xmm0    # 0x6cd78
movsd %xmm0, -0xd8(%rbp)
movq %r12, %rdi
movl $0x60, %esi
movl $0x10, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32ca6(%rip), %xmm0    # 0x6ccd0
movsd %xmm0, -0xf0(%rbp)
movq %r12, %rdi
movl $0x70, %esi
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32d2d(%rip), %xmm0    # 0x6cd80
movsd %xmm0, -0xe8(%rbp)
movq %r12, %rdi
movl $0x78, %esi
movl $0x10, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32c64(%rip), %xmm0    # 0x6cce0
movsd %xmm0, -0xe0(%rbp)
movq %r12, %rdi
movl $0x88, %esi
movl $0x10, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32c2b(%rip), %xmm0    # 0x6ccd0
mulsd 0x31cfb(%rip), %xmm0    # 0x6bda8
movsd %xmm0, -0xd0(%rbp)
movq %r12, %rdi
movl $0x98, %esi
movl $0x10, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32c02(%rip), %xmm0    # 0x6ccd8
movsd %xmm0, -0xc8(%rbp)
movl $0x20, %r14d
movq %r12, %rdi
movl $0xa8, %esi
movl $0x20, %edx
callq 0x4e341
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x32bb8(%rip), %xmm0    # 0x6ccc0
movsd %xmm0, -0xb8(%rbp)
movq %r12, %rdi
movl $0xc8, %esi
movl $0x10, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0xc0(%rbp)
movq %r12, %rdi
movl $0xd8, %esi
movl $0x20, %edx
callq 0x4e341
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x32b73(%rip), %xmm0    # 0x6ccc8
movsd %xmm0, -0xb0(%rbp)
movq %r12, %rdi
movl $0xf8, %esi
movl $0x10, %edx
callq 0x4e341
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x48(%rbp)
movq %r12, %rdi
movl $0x108, %esi            # imm = 0x108
movl $0x20, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32b19(%rip), %xmm0    # 0x6ccb8
mulsd 0x31c01(%rip), %xmm0    # 0x6bda8
movsd %xmm0, -0xa8(%rbp)
movq %r12, %rdi
movl $0x128, %esi            # imm = 0x128
movl $0x10, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32b08(%rip), %xmm0    # 0x6ccd8
movsd %xmm0, -0xa0(%rbp)
movq %r12, %rdi
movl $0x138, %esi            # imm = 0x138
movl $0x20, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32abf(%rip), %xmm0    # 0x6ccb8
mulsd 0x31ba7(%rip), %xmm0    # 0x6bda8
movsd %xmm0, -0x90(%rbp)
movq %r12, %rdi
movl $0x158, %esi            # imm = 0x158
movl $0x10, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32aae(%rip), %xmm0    # 0x6ccd8
movsd %xmm0, -0x98(%rbp)
movq %r12, %rdi
movl $0x168, %esi            # imm = 0x168
movl $0x20, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32a65(%rip), %xmm0    # 0x6ccb8
mulsd 0x31b4d(%rip), %xmm0    # 0x6bda8
movsd %xmm0, -0x88(%rbp)
movq %r12, %rdi
movl $0x188, %esi            # imm = 0x188
movl $0x10, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32a5c(%rip), %xmm0    # 0x6cce0
movsd %xmm0, -0x80(%rbp)
movq %r12, %rdi
movl $0x198, %esi            # imm = 0x198
movl $0x18, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x32a26(%rip), %xmm0    # 0x6ccd0
mulsd 0x31af6(%rip), %xmm0    # 0x6bda8
movsd %xmm0, -0x78(%rbp)
movq %r12, %rdi
movl $0x1b0, %esi            # imm = 0x1B0
movl $0x20, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x329e0(%rip), %xmm0    # 0x6ccb8
mulsd 0x31ac8(%rip), %xmm0    # 0x6bda8
movsd %xmm0, -0x70(%rbp)
movq %r12, %rdi
movl $0x1d0, %esi            # imm = 0x1D0
movl $0xa, %edx
callq 0x4e341
movl %eax, -0x38(%rbp)
movq %r12, %rdi
movl $0x1da, %esi            # imm = 0x1DA
movl $0x16, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x3299d(%rip), %xmm0    # 0x6ccb8
movsd %xmm0, -0x68(%rbp)
movq %r12, %rdi
movl $0x1f0, %esi            # imm = 0x1F0
movl $0x5, %edx
callq 0x4e341
movq %rbx, -0x58(%rbp)
movl %eax, %ebx
movq %r12, %rdi
movl $0x1f8, %esi            # imm = 0x1F8
movl $0x8, %edx
callq 0x4e390
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x3295f(%rip), %xmm0    # 0x6ccb8
movsd %xmm0, -0x60(%rbp)
movl $0x2, %r13d
movq %r12, %rdi
movl $0x200, %esi            # imm = 0x200
movl $0x2, %edx
callq 0x4e341
movl %eax, -0x34(%rbp)
movq %r12, %rdi
movl $0x202, %esi            # imm = 0x202
movl $0x4, %edx
callq 0x4e341
movl %eax, -0x30(%rbp)
movq %r12, %rdi
movl $0x206, %esi            # imm = 0x206
movl $0x6, %edx
callq 0x4e341
movl %eax, -0x2c(%rbp)
movq %r12, %rdi
movl $0x20c, %esi            # imm = 0x20C
movl $0x1, %edx
callq 0x4e341
movl %eax, %r12d
testl %ebx, %ebx
cmovel %r14d, %ebx
movl $0x1, %edi
movl %ebx, %esi
callq 0x4dbc5
movl %eax, %r14d
movl %r15d, %edi
callq 0x5081e
movl %eax, %ebx
movl %eax, %edi
movsd -0x48(%rbp), %xmm0
callq 0x4fbc6
movq %rax, %r15
movsd %xmm0, -0x50(%rbp)
movl %ebx, %edi
movsd -0xd8(%rbp), %xmm0
callq 0x4fbc6
movq -0x58(%rbp), %r8
movups 0x10(%r8), %xmm1
movaps %xmm1, -0x110(%rbp)
movq 0x80(%r8), %rcx
movslq %r14d, %rdx
leaq (%rdx,%rdx,8), %rsi
shlq $0x5, %rsi
movl %edx, -0x120(%rcx,%rsi)
movl -0x3c(%rbp), %edi
movl %edi, -0x11c(%rcx,%rsi)
movl -0x38(%rbp), %edi
movl %edi, -0x118(%rcx,%rsi)
movl -0x30(%rbp), %edi
movl %edi, -0x114(%rcx,%rsi)
movl -0x2c(%rbp), %edi
movl %edi, -0x110(%rcx,%rsi)
movl %ebx, -0x10c(%rcx,%rsi)
movl -0x34(%rbp), %edi
movl %edi, -0x108(%rcx,%rsi)
movl %r12d, -0x104(%rcx,%rsi)
movq %r15, -0x100(%rcx,%rsi)
movsd -0x50(%rbp), %xmm1
movsd %xmm1, -0xf8(%rcx,%rsi)
movq %rax, -0xf0(%rcx,%rsi)
movsd %xmm0, -0xe8(%rcx,%rsi)
movaps -0x110(%rbp), %xmm0
movups %xmm0, -0xe0(%rcx,%rsi)
movsd -0xb0(%rbp), %xmm0
mulsd %xmm0, %xmm0
movsd %xmm0, -0xd0(%rcx,%rsi)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0xc8(%rcx,%rsi)
movsd -0x90(%rbp), %xmm0
movsd %xmm0, -0xc0(%rcx,%rsi)
movsd -0xa8(%rbp), %xmm0
movsd %xmm0, -0xb8(%rcx,%rsi)
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0xb0(%rcx,%rsi)
movsd -0x70(%rbp), %xmm0
movsd %xmm0, -0xa8(%rcx,%rsi)
movsd -0xd0(%rbp), %xmm0
movsd %xmm0, -0xa0(%rcx,%rsi)
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x98(%rcx,%rsi)
movsd -0xf8(%rbp), %xmm0
movsd %xmm0, -0x90(%rcx,%rsi)
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x88(%rcx,%rsi)
movsd -0xe0(%rbp), %xmm0
movsd %xmm0, -0x80(%rcx,%rsi)
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x78(%rcx,%rsi)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x70(%rcx,%rsi)
movsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0x68(%rcx,%rsi)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, -0x60(%rcx,%rsi)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x58(%rcx,%rsi)
xorl %eax, %eax
movq %rax, -0x50(%rcx,%rsi)
movsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x48(%rcx,%rsi)
movsd -0xf0(%rbp), %xmm0
movsd %xmm0, -0x40(%rcx,%rsi)
movsd -0xe8(%rbp), %xmm0
movsd %xmm0, -0x38(%rcx,%rsi)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x30(%rcx,%rsi)
xorps %xmm0, %xmm0
movups %xmm0, -0x18(%rcx,%rsi)
movups %xmm0, -0x28(%rcx,%rsi)
movq %rax, -0x8(%rcx,%rsi)
movl %edx, 0x9bdd4(%r8)
jmp 0x3a5fd
leaq 0x33f66(%rip), %rsi     # 0x6e551
movl $0x2, %edi
xorl %eax, %eax
callq 0x4ded0
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl %r13d, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq