// File: /workspace/github_cpp_makefile_star2_O3/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 0x3cb53
movq %rdi, %rbx
leaq 0x9f0c4(%rdi), %r12
movq %r12, %rdi
movl $0x24, %esi
movl $0x6, %edx
callq 0x4d9d6
movl %eax, %r15d
movq %r12, %rdi
movl $0x2a, %esi
movl $0xa, %edx
callq 0x4d9d6
movl %eax, -0x48(%rbp)
movq %r12, %rdi
movl $0x34, %esi
movl $0x4, %edx
callq 0x4d9d6
movl %eax, -0xac(%rbp)
movq %r12, %rdi
movl $0x38, %esi
movl $0x2, %edx
callq 0x4d9d6
movl %eax, -0xa8(%rbp)
movq %r12, %rdi
movl $0x3a, %esi
movl $0xe, %edx
callq 0x4da25
movl %eax, -0x60(%rbp)
movq %r12, %rdi
movl $0x48, %esi
movl $0x8, %edx
callq 0x4d9d6
movl %eax, -0x2c(%rbp)
movq %r12, %rdi
movl $0x50, %esi
movl $0x10, %edx
callq 0x4d9d6
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x38(%rbp)
movq %r12, %rdi
movl $0x60, %esi
movl $0x8, %edx
callq 0x4da25
movl %eax, -0xa4(%rbp)
movq %r12, %rdi
movl $0x68, %esi
movl $0x10, %edx
callq 0x4da25
movl %eax, -0x58(%rbp)
movq %r12, %rdi
movl $0x78, %esi
movl $0x16, %edx
callq 0x4da25
movl %eax, -0xa0(%rbp)
movq %r12, %rdi
movl $0x8e, %esi
movl $0xa, %edx
callq 0x4d9d6
movl %eax, -0x40(%rbp)
movq %r12, %rdi
movl $0x98, %esi
movl $0x10, %edx
callq 0x4da25
movl %eax, -0x94(%rbp)
movq %r12, %rdi
movl $0xa8, %esi
movl $0x10, %edx
callq 0x4da25
movl %eax, -0x84(%rbp)
movq %r12, %rdi
movl $0xb8, %esi
movl $0x20, %edx
callq 0x4da25
movl %eax, -0x78(%rbp)
movq %r12, %rdi
movl $0xd8, %esi
movl $0x10, %edx
callq 0x4da25
movl %eax, -0x8c(%rbp)
movq %r12, %rdi
movl $0xe8, %esi
movl $0x20, %edx
callq 0x4d9d6
movl %eax, -0x9c(%rbp)
movq %r12, %rdi
movl $0x108, %esi            # imm = 0x108
movl $0x10, %edx
callq 0x4da25
movl %eax, -0x7c(%rbp)
movq %r12, %rdi
movl $0x118, %esi            # imm = 0x118
movl $0x20, %edx
callq 0x4d9d6
movl %eax, -0x98(%rbp)
movq %r12, %rdi
movl $0x138, %esi            # imm = 0x138
movl $0x10, %edx
callq 0x4d9d6
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x3031e(%rip), %xmm0    # 0x6cd78
movsd %xmm0, -0x50(%rbp)
movq %r12, %rdi
movl $0x148, %esi            # imm = 0x148
movl $0x10, %edx
callq 0x4da25
movl %eax, -0x6c(%rbp)
movq %r12, %rdi
movl $0x158, %esi            # imm = 0x158
movl $0x20, %edx
callq 0x4da25
movl %eax, -0x90(%rbp)
movq %r12, %rdi
movl $0x178, %esi            # imm = 0x178
movl $0x10, %edx
callq 0x4da25
movl %eax, -0x68(%rbp)
movq %r12, %rdi
movl $0x188, %esi            # imm = 0x188
movl $0x20, %edx
callq 0x4da25
movl %eax, -0x88(%rbp)
movq %r12, %rdi
movl $0x1a8, %esi            # imm = 0x1A8
movl $0x10, %edx
callq 0x4da25
movl %eax, -0x64(%rbp)
movq %r12, %rdi
movl $0x1b8, %esi            # imm = 0x1B8
movl $0x20, %edx
callq 0x4da25
movl %eax, -0x74(%rbp)
movq %r12, %rdi
movl $0x1d8, %esi            # imm = 0x1D8
movl $0x18, %edx
callq 0x4da25
movl %eax, %r14d
movq %r12, %rdi
movl $0x1f0, %esi            # imm = 0x1F0
movl $0x8, %edx
callq 0x4da25
movl %eax, -0x70(%rbp)
movq %r12, %rdi
movl $0x1f8, %esi            # imm = 0x1F8
movl $0x6, %edx
callq 0x4d9d6
movl %eax, -0x3c(%rbp)
movq %r12, %rdi
movl $0x1fe, %esi            # imm = 0x1FE
movl $0x1, %edx
callq 0x4d9d6
movl %eax, -0x80(%rbp)
movq %r12, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
movl $0x1, %edx
callq 0x4d9d6
testl %eax, %eax
je 0x3cb64
xorpd %xmm0, %xmm0
jmp 0x3cb6c
leaq 0x3263d(%rip), %rsi     # 0x6f197
movl $0x2, %edi
jmp 0x3cf92
movsd 0x2dd3c(%rip), %xmm0    # 0x6a8a8
movsd %xmm0, -0xb8(%rbp)
movsd -0x38(%rbp), %xmm0
mulsd 0x301f7(%rip), %xmm0    # 0x6cd78
movsd %xmm0, -0x38(%rbp)
leal 0x50(%r15), %r12d
xorl %r13d, %r13d
cmpl $0x28, %r15d
setge %r13b
cmovll %r15d, %r12d
incl %r13d
leaq 0x32615(%rip), %rsi     # 0x6f1b8
movl $0x4, %edi
movl %r12d, %edx
movl -0x2c(%rbp), %r15d
movl %r15d, %ecx
movsd -0x50(%rbp), %xmm0
movb $0x1, %al
callq 0x4d55d
cmpl $0x0, 0xc(%rbx)
je 0x3cc07
leaq 0x9b9d0(%rbx), %rdi
callq 0x8290
leaq (%rbx,%rax), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
movl -0x3c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x325fa(%rip), %rsi     # 0x6f1e2
movl %r12d, %edx
movl %r15d, %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 0x4d28d
testl %eax, %eax
je 0x3cf83
movl %eax, %r15d
movl -0x48(%rbp), %edi
callq 0x4fe5d
movl %eax, %r12d
movl %eax, %edi
movsd -0x50(%rbp), %xmm0
callq 0x4f24a
movq %rax, -0xc0(%rbp)
movsd %xmm0, -0x48(%rbp)
movl %r12d, %edi
movsd -0x38(%rbp), %xmm0
callq 0x4f24a
movq %rax, %r13
movsd %xmm0, -0x38(%rbp)
movups 0x10(%rbx), %xmm0
movaps %xmm0, -0xd0(%rbp)
leaq 0x9fd48(%rbx), %rdi
leaq 0x2fa59(%rip), %rsi     # 0x6c6c7
callq 0x8160
movq 0x80(%rbx), %rcx
movslq %r15d, %rdx
leaq (%rdx,%rdx,8), %rdx
testq %rax, %rax
jne 0x3cc9f
movq %rdx, %rsi
shlq $0x5, %rsi
xorl %eax, %eax
movl -0x2c(%rbp), %edi
cmpl -0x11c(%rcx,%rsi), %edi
je 0x3cf9e
xorps %xmm1, %xmm1
cvtsi2sdl -0x60(%rbp), %xmm1
cvtsi2sdl -0x84(%rbp), %xmm2
cvtsi2sdl -0x78(%rbp), %xmm3
cvtsi2sd %r14d, %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 0x2ffdf(%rip), %xmm11   # 0x6ccd0
mulsd %xmm11, %xmm1
mulsd %xmm11, %xmm2
mulsd %xmm11, %xmm4
mulsd %xmm11, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0x2ffc5(%rip), %xmm11   # 0x6ccd8
mulsd %xmm11, %xmm6
mulsd %xmm11, %xmm7
mulsd %xmm11, %xmm8
mulsd %xmm11, %xmm9
movsd 0x2ffb0(%rip), %xmm11   # 0x6cce0
mulsd %xmm11, %xmm5
movsd %xmm5, -0x58(%rbp)
mulsd %xmm11, %xmm10
movsd 0x2ff71(%rip), %xmm0    # 0x6ccb8
mulsd %xmm0, %xmm3
cvtsi2sdl -0x90(%rbp), %xmm13
mulsd %xmm0, %xmm13
cvtsi2sdl -0x88(%rbp), %xmm14
mulsd %xmm0, %xmm14
cvtsi2sdl -0x74(%rbp), %xmm15
mulsd %xmm0, %xmm15
movsd 0x2f02d(%rip), %xmm11   # 0x6bda8
mulsd %xmm11, %xmm1
mulsd %xmm11, %xmm2
mulsd %xmm11, %xmm3
mulsd %xmm11, %xmm13
mulsd %xmm11, %xmm14
mulsd %xmm11, %xmm15
cvtsi2sdl -0xa0(%rbp), %xmm12
mulsd %xmm11, %xmm4
mulsd %xmm0, %xmm12
xorps %xmm11, %xmm11
cvtsi2sdl -0x70(%rbp), %xmm11
mulsd %xmm0, %xmm11
shlq $0x5, %rdx
movl %r15d, -0x120(%rcx,%rdx)
movl -0x2c(%rbp), %eax
movl %eax, -0x11c(%rcx,%rdx)
movl -0x40(%rbp), %eax
movl %eax, -0x118(%rcx,%rdx)
movl -0xac(%rbp), %eax
movl %eax, -0x114(%rcx,%rdx)
movl -0x3c(%rbp), %eax
movl %eax, -0x110(%rcx,%rdx)
movl %r12d, -0x10c(%rcx,%rdx)
movl -0xa8(%rbp), %eax
movl %eax, -0x108(%rcx,%rdx)
movl -0x80(%rbp), %eax
movl %eax, -0x104(%rcx,%rdx)
movq -0xc0(%rbp), %rax
movq %rax, -0x100(%rcx,%rdx)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0xf8(%rcx,%rdx)
movq %r13, -0xf0(%rcx,%rdx)
movl -0x98(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd -0x38(%rbp), %xmm5
movsd %xmm5, -0xe8(%rcx,%rdx)
mulsd 0x2fe6e(%rip), %xmm0    # 0x6ccc8
movaps -0xd0(%rbp), %xmm5
movups %xmm5, -0xe0(%rcx,%rdx)
mulsd %xmm0, %xmm0
movsd %xmm0, -0xd0(%rcx,%rdx)
movl -0x9c(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x2fe34(%rip), %xmm0    # 0x6ccc0
movsd %xmm0, -0xc8(%rcx,%rdx)
movsd %xmm14, -0xc0(%rcx,%rdx)
movsd %xmm13, -0xb8(%rcx,%rdx)
movsd %xmm15, -0xb0(%rcx,%rdx)
movsd %xmm3, -0xa8(%rcx,%rdx)
movsd %xmm2, -0xa0(%rcx,%rdx)
movsd %xmm4, -0x98(%rcx,%rdx)
movsd %xmm1, -0x90(%rcx,%rdx)
movsd %xmm10, -0x88(%rcx,%rdx)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x80(%rcx,%rdx)
movsd %xmm6, -0x78(%rcx,%rdx)
movsd %xmm7, -0x70(%rcx,%rdx)
movsd %xmm8, -0x68(%rcx,%rdx)
movsd %xmm9, -0x60(%rcx,%rdx)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x58(%rcx,%rdx)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x50(%rcx,%rdx)
movsd %xmm12, -0x48(%rcx,%rdx)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x40(%rcx,%rdx)
xorps %xmm0, %xmm0
cvtsi2sdl -0xa4(%rbp), %xmm0
mulsd 0x2fe3c(%rip), %xmm0    # 0x6cd80
movsd %xmm0, -0x38(%rcx,%rdx)
movsd %xmm11, -0x30(%rcx,%rdx)
movq -0xe0(%rbp), %rax
movq %rax, -0x8(%rcx,%rdx)
movaps -0x100(%rbp), %xmm0
movaps -0xf0(%rbp), %xmm1
movups %xmm1, -0x18(%rcx,%rdx)
movups %xmm0, -0x28(%rcx,%rdx)
movl %r15d, 0x9bdd4(%rbx)
movl $0x2, %eax
jmp 0x3cf9e
leaq 0x32298(%rip), %rsi     # 0x6f222
movl $0x2, %edi
movl %r12d, %edx
xorl %eax, %eax
callq 0x4d55d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq