// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_type1019(bamboo::rtcm_t*)
static int decode_type1019(rtcm_t *rtcm)
{
    eph_t eph={0};
    double toc,sqrtA;
    char *msg;
    int i=24+12,prn,sat,week,sys=SYS_GPS;
    
    if (i+476<=rtcm->len*8) {
        prn       =getbitu(rtcm->buff,i, 6);              i+= 6;
        week      =getbitu(rtcm->buff,i,10);              i+=10;
        eph.sva   =getbitu(rtcm->buff,i, 4);              i+= 4;
        eph.code  =getbitu(rtcm->buff,i, 2);              i+= 2;
        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.f2    =getbits(rtcm->buff,i, 8)*P2_55;        i+= 8;
        eph.f1    =getbits(rtcm->buff,i,16)*P2_43;        i+=16;
        eph.f0    =getbits(rtcm->buff,i,22)*P2_31;        i+=22;
        eph.iodc  =getbitu(rtcm->buff,i,10);              i+=10;
        eph.crs   =getbits(rtcm->buff,i,16)*P2_5;         i+=16;
        eph.deln  =getbits(rtcm->buff,i,16)*P2_43*SC2RAD; i+=16;
        eph.M0    =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        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)*P2_29;        i+=16;
        sqrtA     =getbitu(rtcm->buff,i,32)*P2_19;        i+=32;
        eph.toes  =getbitu(rtcm->buff,i,16)*16.0;         i+=16;
        eph.cic   =getbits(rtcm->buff,i,16)*P2_29;        i+=16;
        eph.OMG0  =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        eph.cis   =getbits(rtcm->buff,i,16)*P2_29;        i+=16;
        eph.i0    =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        eph.crc   =getbits(rtcm->buff,i,16)*P2_5;         i+=16;
        eph.omg   =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        eph.OMGd  =getbits(rtcm->buff,i,24)*P2_43*SC2RAD; i+=24;
        eph.tgd[0]=getbits(rtcm->buff,i, 8)*P2_31;        i+= 8;
        eph.svh   =getbitu(rtcm->buff,i, 6);              i+= 6;
        eph.flag  =getbitu(rtcm->buff,i, 1);              i+= 1;
        eph.fit   =getbitu(rtcm->buff,i, 1)?0.0:4.0; /* 0:4hr,1:>4hr */
    }
    else {
        trace(2,"rtcm3 1019 length error: len=%d\n",rtcm->len);
        return -1;
    }
    if (prn>=40) {
        sys=SYS_SBS; prn+=80;
    }
    trace(4,"decode_type1019: prn=%d iode=%d toe=%.0f\n",prn,eph.iode,eph.toes);
    
    if (rtcm->outtype) {
        msg=rtcm->msgtype+strlen(rtcm->msgtype);
        sprintf(msg," prn=%2d iode=%3d iodc=%3d week=%d toe=%6.0f toc=%6.0f svh=%02X",
                prn,eph.iode,eph.iodc,week,eph.toes,toc,eph.svh);
    }
    if (!(sat=satno(sys,prn))) {
        trace(2,"rtcm3 1019 satellite number error: prn=%d\n",prn);
        return -1;
    }
    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;
    if (!strstr(rtcm->opt,"-EPHALL")) {
        if (eph.iode==rtcm->nav.eph[sat-1].iode) return 0; /* unchanged */
    }
    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
xorps %xmm0, %xmm0
movaps %xmm0, -0xd0(%rbp)
movaps %xmm0, -0x100(%rbp)
movaps %xmm0, -0xf0(%rbp)
movq $0x0, -0xe0(%rbp)
movl 0x9f0c0(%rdi), %edx
cmpl $0x40, %edx
jl 0x3d210
movq %rdi, %rbx
leaq 0x9f0c4(%rdi), %r12
movq %r12, %rdi
movl $0x24, %esi
movl $0x6, %edx
callq 0x4e341
movl %eax, %r14d
movq %r12, %rdi
movl $0x2a, %esi
movl $0xa, %edx
callq 0x4e341
movl %eax, -0x48(%rbp)
movq %r12, %rdi
movl $0x34, %esi
movl $0x4, %edx
callq 0x4e341
movl %eax, -0xac(%rbp)
movq %r12, %rdi
movl $0x38, %esi
movl $0x2, %edx
callq 0x4e341
movl %eax, -0xa8(%rbp)
movq %r12, %rdi
movl $0x3a, %esi
movl $0xe, %edx
callq 0x4e390
movl %eax, -0x60(%rbp)
movq %r12, %rdi
movl $0x48, %esi
movl $0x8, %edx
callq 0x4e341
movl %eax, -0x2c(%rbp)
movq %r12, %rdi
movl $0x50, %esi
movl $0x10, %edx
callq 0x4e341
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x38(%rbp)
movq %r12, %rdi
movl $0x60, %esi
movl $0x8, %edx
callq 0x4e390
movl %eax, -0xa4(%rbp)
movq %r12, %rdi
movl $0x68, %esi
movl $0x10, %edx
callq 0x4e390
movl %eax, -0x58(%rbp)
movq %r12, %rdi
movl $0x78, %esi
movl $0x16, %edx
callq 0x4e390
movl %eax, -0xa0(%rbp)
movq %r12, %rdi
movl $0x8e, %esi
movl $0xa, %edx
callq 0x4e341
movl %eax, -0x40(%rbp)
movq %r12, %rdi
movl $0x98, %esi
movl $0x10, %edx
callq 0x4e390
movl %eax, -0x94(%rbp)
movq %r12, %rdi
movl $0xa8, %esi
movl $0x10, %edx
callq 0x4e390
movl %eax, -0x80(%rbp)
movq %r12, %rdi
movl $0xb8, %esi
movl $0x20, %edx
callq 0x4e390
movl %eax, -0x78(%rbp)
movq %r12, %rdi
movl $0xd8, %esi
movl $0x10, %edx
callq 0x4e390
movl %eax, -0x8c(%rbp)
movq %r12, %rdi
movl $0xe8, %esi
movl $0x20, %edx
callq 0x4e341
movl %eax, -0x9c(%rbp)
movq %r12, %rdi
movl $0x108, %esi            # imm = 0x108
movl $0x10, %edx
callq 0x4e390
movl %eax, -0x7c(%rbp)
movq %r12, %rdi
movl $0x118, %esi            # imm = 0x118
movl $0x20, %edx
callq 0x4e341
movl %eax, -0x98(%rbp)
movq %r12, %rdi
movl $0x138, %esi            # imm = 0x138
movl $0x10, %edx
callq 0x4e341
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x2fc64(%rip), %xmm0    # 0x6cd78
movsd %xmm0, -0x50(%rbp)
movq %r12, %rdi
movl $0x148, %esi            # imm = 0x148
movl $0x10, %edx
callq 0x4e390
movl %eax, -0x6c(%rbp)
movq %r12, %rdi
movl $0x158, %esi            # imm = 0x158
movl $0x20, %edx
callq 0x4e390
movl %eax, -0x90(%rbp)
movq %r12, %rdi
movl $0x178, %esi            # imm = 0x178
movl $0x10, %edx
callq 0x4e390
movl %eax, -0x68(%rbp)
movq %r12, %rdi
movl $0x188, %esi            # imm = 0x188
movl $0x20, %edx
callq 0x4e390
movl %eax, -0x88(%rbp)
movq %r12, %rdi
movl $0x1a8, %esi            # imm = 0x1A8
movl $0x10, %edx
callq 0x4e390
movl %eax, -0x64(%rbp)
movq %r12, %rdi
movl $0x1b8, %esi            # imm = 0x1B8
movl $0x20, %edx
callq 0x4e390
movl %eax, -0x74(%rbp)
movq %r12, %rdi
movl $0x1d8, %esi            # imm = 0x1D8
movl $0x18, %edx
callq 0x4e390
movl %eax, %r15d
movq %r12, %rdi
movl $0x1f0, %esi            # imm = 0x1F0
movl $0x8, %edx
callq 0x4e390
movl %eax, -0x70(%rbp)
movq %r12, %rdi
movl $0x1f8, %esi            # imm = 0x1F8
movl $0x6, %edx
callq 0x4e341
movl %eax, -0x3c(%rbp)
movq %r12, %rdi
movl $0x1fe, %esi            # imm = 0x1FE
movl $0x1, %edx
callq 0x4e341
movl %eax, -0x84(%rbp)
movq %r12, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
movl $0x1, %edx
callq 0x4e341
testl %eax, %eax
je 0x3d221
xorpd %xmm0, %xmm0
jmp 0x3d229
leaq 0x31f80(%rip), %rsi     # 0x6f197
movl $0x2, %edi
jmp 0x3d655
movsd 0x2d67f(%rip), %xmm0    # 0x6a8a8
movsd %xmm0, -0xb8(%rbp)
movsd -0x38(%rbp), %xmm0
mulsd 0x2fb3a(%rip), %xmm0    # 0x6cd78
movsd %xmm0, -0x38(%rbp)
leal 0x50(%r14), %r12d
xorl %r13d, %r13d
cmpl $0x28, %r14d
setge %r13b
cmovll %r14d, %r12d
incl %r13d
leaq 0x31f58(%rip), %rsi     # 0x6f1b8
movl $0x4, %edi
movl %r12d, %edx
movl -0x2c(%rbp), %r14d
movl %r14d, %ecx
movsd -0x50(%rbp), %xmm0
movb $0x1, %al
callq 0x4ded0
cmpl $0x0, 0xc(%rbx)
je 0x3d2c4
leaq 0x9b9d0(%rbx), %rdi
callq 0x8290
leaq (%rbx,%rax), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
movl -0x3c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x31f3d(%rip), %rsi     # 0x6f1e2
movl %r12d, %edx
movl %r14d, %ecx
movl -0x40(%rbp), %r8d
movl -0x48(%rbp), %r9d
movsd -0x50(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movb $0x2, %al
callq 0x8120
movl %r13d, %edi
movl %r12d, %esi
callq 0x4dbc5
testl %eax, %eax
je 0x3d646
movl %eax, %r13d
movl -0x48(%rbp), %edi
callq 0x5081e
movl %eax, %r14d
movl %eax, %edi
movsd -0x50(%rbp), %xmm0
callq 0x4fbc6
movq %rax, -0x48(%rbp)
movsd %xmm0, -0xc0(%rbp)
movl %r14d, %edi
movsd -0x38(%rbp), %xmm0
callq 0x4fbc6
movq %rax, %r12
movsd %xmm0, -0x38(%rbp)
movups 0x10(%rbx), %xmm0
movaps %xmm0, -0xd0(%rbp)
leaq 0x9fd48(%rbx), %rdi
leaq 0x2f39c(%rip), %rsi     # 0x6c6c7
callq 0x8160
movslq %r13d, %rcx
testq %rax, %rax
jne 0x3d359
movq 0x80(%rbx), %rdx
leaq (%rcx,%rcx,8), %rsi
shlq $0x5, %rsi
xorl %eax, %eax
movl -0x2c(%rbp), %edi
cmpl -0x11c(%rdx,%rsi), %edi
je 0x3d661
xorps %xmm1, %xmm1
cvtsi2sdl -0x60(%rbp), %xmm1
cvtsi2sdl -0x80(%rbp), %xmm2
cvtsi2sdl -0x78(%rbp), %xmm3
cvtsi2sd %r15d, %xmm4
xorps %xmm0, %xmm0
cvtsi2sdl -0x58(%rbp), %xmm0
cvtsi2sdl -0x94(%rbp), %xmm5
cvtsi2sdl -0x8c(%rbp), %xmm6
cvtsi2sdl -0x7c(%rbp), %xmm7
cvtsi2sdl -0x6c(%rbp), %xmm8
cvtsi2sdl -0x68(%rbp), %xmm9
cvtsi2sdl -0x64(%rbp), %xmm10
movsd 0x2f928(%rip), %xmm11   # 0x6ccd0
mulsd %xmm11, %xmm1
mulsd %xmm11, %xmm2
mulsd %xmm11, %xmm4
mulsd %xmm11, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0x2f90e(%rip), %xmm11   # 0x6ccd8
mulsd %xmm11, %xmm6
mulsd %xmm11, %xmm7
mulsd %xmm11, %xmm8
mulsd %xmm11, %xmm9
movsd 0x2f8f9(%rip), %xmm11   # 0x6cce0
mulsd %xmm11, %xmm5
movsd %xmm5, -0x58(%rbp)
mulsd %xmm11, %xmm10
movsd 0x2f8ba(%rip), %xmm0    # 0x6ccb8
mulsd %xmm0, %xmm3
cvtsi2sdl -0x90(%rbp), %xmm12
cvtsi2sdl -0x88(%rbp), %xmm14
mulsd %xmm0, %xmm12
mulsd %xmm0, %xmm14
cvtsi2sdl -0x74(%rbp), %xmm15
mulsd %xmm0, %xmm15
movsd 0x2e976(%rip), %xmm11   # 0x6bda8
mulsd %xmm11, %xmm1
mulsd %xmm11, %xmm2
mulsd %xmm11, %xmm3
mulsd %xmm11, %xmm12
mulsd %xmm11, %xmm14
mulsd %xmm11, %xmm15
mulsd %xmm11, %xmm4
cvtsi2sdl -0xa0(%rbp), %xmm13
mulsd %xmm0, %xmm13
xorps %xmm11, %xmm11
cvtsi2sdl -0x70(%rbp), %xmm11
mulsd %xmm0, %xmm11
leaq (%rcx,%rcx,8), %rax
shlq $0x5, %rax
movq 0x80(%rbx), %rdx
movl %ecx, -0x120(%rdx,%rax)
movl -0x2c(%rbp), %esi
movl %esi, -0x11c(%rdx,%rax)
movl -0x40(%rbp), %esi
movl %esi, -0x118(%rdx,%rax)
movl -0xac(%rbp), %esi
movl %esi, -0x114(%rdx,%rax)
movl -0x3c(%rbp), %esi
movl %esi, -0x110(%rdx,%rax)
movl %r14d, -0x10c(%rdx,%rax)
movl -0xa8(%rbp), %esi
movl %esi, -0x108(%rdx,%rax)
movl -0x84(%rbp), %esi
movl %esi, -0x104(%rdx,%rax)
movq -0x48(%rbp), %rsi
movq %rsi, -0x100(%rdx,%rax)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0xf8(%rdx,%rax)
movq %r12, -0xf0(%rdx,%rax)
movl -0x98(%rbp), %esi
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
movsd -0x38(%rbp), %xmm5
movsd %xmm5, -0xe8(%rdx,%rax)
mulsd 0x2f7aa(%rip), %xmm0    # 0x6ccc8
movaps -0xd0(%rbp), %xmm5
movups %xmm5, -0xe0(%rdx,%rax)
mulsd %xmm0, %xmm0
movsd %xmm0, -0xd0(%rdx,%rax)
movl -0x9c(%rbp), %esi
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
mulsd 0x2f770(%rip), %xmm0    # 0x6ccc0
movsd %xmm0, -0xc8(%rdx,%rax)
movsd %xmm14, -0xc0(%rdx,%rax)
movsd %xmm12, -0xb8(%rdx,%rax)
movsd %xmm15, -0xb0(%rdx,%rax)
movsd %xmm3, -0xa8(%rdx,%rax)
movsd %xmm2, -0xa0(%rdx,%rax)
movsd %xmm4, -0x98(%rdx,%rax)
movsd %xmm1, -0x90(%rdx,%rax)
movsd %xmm10, -0x88(%rdx,%rax)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x80(%rdx,%rax)
movsd %xmm6, -0x78(%rdx,%rax)
movsd %xmm7, -0x70(%rdx,%rax)
movsd %xmm8, -0x68(%rdx,%rax)
movsd %xmm9, -0x60(%rdx,%rax)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x58(%rdx,%rax)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x50(%rdx,%rax)
movsd %xmm13, -0x48(%rdx,%rax)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x40(%rdx,%rax)
xorps %xmm0, %xmm0
cvtsi2sdl -0xa4(%rbp), %xmm0
mulsd 0x2f778(%rip), %xmm0    # 0x6cd80
movsd %xmm0, -0x38(%rdx,%rax)
movsd %xmm11, -0x30(%rdx,%rax)
movq -0xe0(%rbp), %rsi
movq %rsi, -0x8(%rdx,%rax)
movaps -0x100(%rbp), %xmm0
movaps -0xf0(%rbp), %xmm1
movups %xmm1, -0x18(%rdx,%rax)
movups %xmm0, -0x28(%rdx,%rax)
movl %ecx, 0x9bdd4(%rbx)
movl $0x2, %eax
jmp 0x3d661
leaq 0x31bd5(%rip), %rsi     # 0x6f222
movl $0x2, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x4ded0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq