// File: /workspace/github_cpp_makefile_star2_O3/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_type1042(bamboo::rtcm_t*)
static int decode_type1042(rtcm_t *rtcm)
{
    eph_t eph={0};
    double toc,sqrtA;
    char *msg;
    int i=24+12,prn,sat,week,sys=SYS_CMP;
    
    if (i+499<=rtcm->len*8) {
        prn       =getbitu(rtcm->buff,i, 6);              i+= 6;
        week      =getbitu(rtcm->buff,i,13);              i+=13;
        eph.sva   =getbitu(rtcm->buff,i, 4);              i+= 4;
        eph.idot  =getbits(rtcm->buff,i,14)*P2_43*SC2RAD; i+=14;
        eph.iode  =getbitu(rtcm->buff,i, 5);              i+= 5; /* AODE */
        toc       =getbitu(rtcm->buff,i,17)*8.0;          i+=17;
        eph.f2    =getbits(rtcm->buff,i,11)*P2_66;        i+=11;
        eph.f1    =getbits(rtcm->buff,i,22)*P2_50;        i+=22;
        eph.f0    =getbits(rtcm->buff,i,24)*P2_33;        i+=24;
        eph.iodc  =getbitu(rtcm->buff,i, 5);              i+= 5; /* AODC */
        eph.crs   =getbits(rtcm->buff,i,18)*P2_6;         i+=18;
        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,18)*P2_31;        i+=18;
        eph.e     =getbitu(rtcm->buff,i,32)*P2_33;        i+=32;
        eph.cus   =getbits(rtcm->buff,i,18)*P2_31;        i+=18;
        sqrtA     =getbitu(rtcm->buff,i,32)*P2_19;        i+=32;
        eph.toes  =getbitu(rtcm->buff,i,17)*8.0;          i+=17;
        eph.cic   =getbits(rtcm->buff,i,18)*P2_31;        i+=18;
        eph.OMG0  =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        eph.cis   =getbits(rtcm->buff,i,18)*P2_31;        i+=18;
        eph.i0    =getbits(rtcm->buff,i,32)*P2_31*SC2RAD; i+=32;
        eph.crc   =getbits(rtcm->buff,i,18)*P2_6;         i+=18;
        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,10)*1E-10;        i+=10;
        eph.tgd[1]=getbits(rtcm->buff,i,10)*1E-10;        i+=10;
        eph.svh   =getbitu(rtcm->buff,i, 1);              i+= 1;
    }
    else {
        trace(2,"rtcm3 1042 length error: len=%d\n",rtcm->len);
        return -1;
    }
    trace(4,"decode_type1042: 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 1042 satellite number error: prn=%d\n",prn);
        return -1;
    }
    eph.sat=sat;
    eph.week=adjbdtweek(week);
    eph.toe=bdt2gpst(bdt2time(eph.week,eph.toes)); /* bdt -> gpst */
    eph.toc=bdt2gpst(bdt2time(eph.week,toc));      /* bdt -> gpst */
    eph.ttr=rtcm->time;
    eph.A=sqrtA*sqrtA;
    if (!strstr(rtcm->opt,"-EPHALL")) {
        if (timediff(eph.toe,rtcm->nav.eph[sat-1].toe)==0.0&&
            eph.iode==rtcm->nav.eph[sat-1].iode&&
            eph.iodc==rtcm->nav.eph[sat-1].iodc) 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 $0xd8, %rsp
xorpd %xmm0, %xmm0
movapd %xmm0, -0xd0(%rbp)
movapd %xmm0, -0xf0(%rbp)
movapd %xmm0, -0xe0(%rbp)
movl 0x9f0c0(%rdi), %edx
cmpl $0x43, %edx
jl 0x3fac7
movq %rdi, %rbx
leaq 0x9f0c4(%rdi), %r15
movq %r15, %rdi
movl $0x24, %esi
movl $0x6, %edx
callq 0x4d9d6
movl %eax, %r13d
movq %r15, %rdi
movl $0x2a, %esi
movl $0xd, %edx
callq 0x4d9d6
movl %eax, -0x30(%rbp)
movq %r15, %rdi
movl $0x37, %esi
movl $0x4, %edx
callq 0x4d9d6
movl %eax, -0xac(%rbp)
movq %r15, %rdi
movl $0x3b, %esi
movl $0xe, %edx
callq 0x4da25
movl %eax, -0x60(%rbp)
movq %r15, %rdi
movl $0x49, %esi
movl $0x5, %edx
callq 0x4d9d6
movl %eax, %r12d
movq %r15, %rdi
movl $0x4e, %esi
movl $0x11, %edx
callq 0x4d9d6
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x2b5b5(%rip), %xmm0    # 0x6aa40
movsd %xmm0, -0x40(%rbp)
movq %r15, %rdi
movl $0x5f, %esi
movl $0xb, %edx
callq 0x4da25
movl %eax, -0xa8(%rbp)
movq %r15, %rdi
movl $0x6a, %esi
movl $0x16, %edx
callq 0x4da25
movl %eax, -0xa4(%rbp)
movq %r15, %rdi
movl $0x80, %esi
movl $0x18, %edx
callq 0x4da25
movl %eax, -0x58(%rbp)
movq %r15, %rdi
movl $0x98, %esi
movl $0x5, %edx
callq 0x4d9d6
movl %eax, %r14d
movq %r15, %rdi
movl $0x9d, %esi
movl $0x12, %edx
callq 0x4da25
movl %eax, -0x9c(%rbp)
movq %r15, %rdi
movl $0xaf, %esi
movl $0x10, %edx
callq 0x4da25
movl %eax, -0x8c(%rbp)
movq %r15, %rdi
movl $0xbf, %esi
movl $0x20, %edx
callq 0x4da25
movl %eax, -0x7c(%rbp)
movq %r15, %rdi
movl $0xdf, %esi
movl $0x12, %edx
callq 0x4da25
movl %eax, -0x50(%rbp)
movq %r15, %rdi
movl $0xf1, %esi
movl $0x20, %edx
callq 0x4d9d6
movl %eax, -0x94(%rbp)
movq %r15, %rdi
movl $0x111, %esi            # imm = 0x111
movl $0x12, %edx
callq 0x4da25
movl %eax, -0x84(%rbp)
movq %r15, %rdi
movl $0x123, %esi            # imm = 0x123
movl $0x20, %edx
callq 0x4d9d6
movl %eax, -0xa0(%rbp)
movq %r15, %rdi
movl $0x143, %esi            # imm = 0x143
movl $0x11, %edx
callq 0x4d9d6
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0x2b490(%rip), %xmm0    # 0x6aa40
movsd %xmm0, -0x48(%rbp)
movq %r15, %rdi
movl $0x154, %esi            # imm = 0x154
movl $0x12, %edx
callq 0x4da25
movl %eax, -0x74(%rbp)
movq %r15, %rdi
movl $0x166, %esi            # imm = 0x166
movl $0x20, %edx
callq 0x4da25
movl %eax, -0x70(%rbp)
movq %r15, %rdi
movl $0x186, %esi            # imm = 0x186
movl $0x12, %edx
callq 0x4da25
movl %eax, -0x98(%rbp)
movq %r15, %rdi
movl $0x198, %esi            # imm = 0x198
movl $0x20, %edx
callq 0x4da25
movl %eax, -0x6c(%rbp)
movq %r15, %rdi
movl $0x1b8, %esi            # imm = 0x1B8
movl $0x12, %edx
callq 0x4da25
movl %eax, -0x90(%rbp)
movq %r15, %rdi
movl $0x1ca, %esi            # imm = 0x1CA
movl $0x20, %edx
callq 0x4da25
movl %eax, -0x68(%rbp)
movq %r15, %rdi
movl $0x1ea, %esi            # imm = 0x1EA
movl $0x18, %edx
callq 0x4da25
movl %eax, -0x64(%rbp)
movq %r15, %rdi
movl $0x202, %esi            # imm = 0x202
movl $0xa, %edx
callq 0x4da25
movl %eax, -0x80(%rbp)
movq %r15, %rdi
movl $0x20c, %esi            # imm = 0x20C
movl $0xa, %edx
callq 0x4da25
movl %eax, -0x78(%rbp)
movq %r15, %rdi
movl $0x216, %esi            # imm = 0x216
movl $0x1, %edx
callq 0x4d9d6
movl %eax, %r15d
leaq 0x3015a(%rip), %rsi     # 0x6f7ee
movl $0x4, %edi
movl %r13d, %edx
movl %r12d, %ecx
movsd -0x48(%rbp), %xmm0
movb $0x1, %al
callq 0x4d55d
cmpl $0x0, 0xc(%rbx)
je 0x3f6f1
leaq 0x9b9d0(%rbx), %rdi
callq 0x8290
leaq (%rbx,%rax), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
movl %r15d, (%rsp)
leaq 0x2fb0f(%rip), %rsi     # 0x6f1e2
movl %r13d, %edx
movl %r12d, %ecx
movl %r14d, %r8d
movl -0x30(%rbp), %r9d
movsd -0x48(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
movb $0x2, %al
callq 0x8120
movl %r15d, -0x88(%rbp)
movl -0x30(%rbp), %r15d
movl %r14d, -0x34(%rbp)
movl %r12d, -0x38(%rbp)
movl $0x20, %edi
movl %r13d, %esi
callq 0x4d28d
testl %eax, %eax
je 0x3fad5
movl %eax, %r12d
callq 0x4f542
movq %rax, %rdi
callq 0x4fa70
movq %rax, %rdi
callq 0x4fb17
leaq -0xbc(%rbp), %r13
movq %rax, %rdi
movq %r13, %rsi
callq 0x4f46f
movl (%r13), %eax
cmpl $0x2, %eax
movl $0x1, %r13d
cmovgel %eax, %r13d
subl %r15d, %r13d
leal 0x200(%r13), %eax
addl $0x5ff, %r13d           # imm = 0x5FF
testl %eax, %eax
cmovnsl %eax, %r13d
andl $0xfffffc00, %r13d      # imm = 0xFFFFFC00
addl %r15d, %r13d
movl %r13d, %edi
movsd -0x48(%rbp), %xmm0
callq 0x4f408
movq %rax, %rdi
callq 0x4fb4f
movq %rax, %r15
movsd %xmm0, -0x30(%rbp)
movl %r13d, %edi
movsd -0x40(%rbp), %xmm0
callq 0x4f408
movq %rax, %rdi
callq 0x4fb4f
movq %rax, -0x40(%rbp)
movsd %xmm0, -0xb8(%rbp)
movupd 0x10(%rbx), %xmm0
movapd %xmm0, -0xd0(%rbp)
leaq 0x9fd48(%rbx), %rdi
leaq 0x2cef9(%rip), %rsi     # 0x6c6c7
callq 0x8160
testq %rax, %rax
je 0x3fb02
cvtsi2sdl -0x60(%rbp), %xmm8
cvtsi2sdl -0x8c(%rbp), %xmm2
cvtsi2sdl -0x7c(%rbp), %xmm3
cvtsi2sdl -0x70(%rbp), %xmm5
cvtsi2sdl -0x6c(%rbp), %xmm7
cvtsi2sdl -0x68(%rbp), %xmm6
cvtsi2sdl -0x64(%rbp), %xmm4
xorps %xmm1, %xmm1
cvtsi2sdl -0x58(%rbp), %xmm1
cvtsi2sdl -0x50(%rbp), %xmm9
movl -0x94(%rbp), %eax
cvtsi2sd %rax, %xmm11
cvtsi2sdl -0x84(%rbp), %xmm12
cvtsi2sdl -0x74(%rbp), %xmm10
movsd 0x2d49d(%rip), %xmm0    # 0x6ccd0
mulsd %xmm0, %xmm8
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm4
movsd 0x2d478(%rip), %xmm0    # 0x6ccc0
mulsd %xmm0, %xmm1
movsd %xmm1, -0x60(%rbp)
mulsd %xmm0, %xmm11
movsd 0x2d45a(%rip), %xmm0    # 0x6ccb8
mulsd %xmm0, %xmm3
mulsd %xmm0, %xmm5
mulsd %xmm0, %xmm7
mulsd %xmm0, %xmm6
mulsd %xmm0, %xmm9
movsd %xmm9, -0x58(%rbp)
mulsd %xmm0, %xmm12
movsd %xmm12, -0x50(%rbp)
xorps %xmm12, %xmm12
cvtsi2sdl -0x98(%rbp), %xmm12
mulsd %xmm0, %xmm10
mulsd %xmm0, %xmm12
cvtsi2sdl -0x9c(%rbp), %xmm13
movsd 0x2d474(%rip), %xmm0    # 0x6cd20
mulsd %xmm0, %xmm13
cvtsi2sdl -0x90(%rbp), %xmm14
mulsd %xmm0, %xmm14
movsd 0x2c4e1(%rip), %xmm0    # 0x6bda8
mulsd %xmm0, %xmm8
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm3
mulsd %xmm0, %xmm5
mulsd %xmm0, %xmm7
mulsd %xmm0, %xmm6
mulsd %xmm0, %xmm4
cvtsi2sdl -0x80(%rbp), %xmm15
movsd 0x2c4c6(%rip), %xmm0    # 0x6bdb8
mulsd %xmm0, %xmm15
xorps %xmm1, %xmm1
cvtsi2sdl -0x78(%rbp), %xmm1
mulsd %xmm0, %xmm1
movslq %r12d, %rax
leaq (%rax,%rax,8), %rax
shlq $0x5, %rax
movq 0x80(%rbx), %rcx
movl %r12d, -0x120(%rcx,%rax)
movl -0x38(%rbp), %edx
movl %edx, -0x11c(%rcx,%rax)
movl -0x34(%rbp), %edx
movl %edx, -0x118(%rcx,%rax)
movl -0xac(%rbp), %edx
movl %edx, -0x114(%rcx,%rax)
movl -0x88(%rbp), %edx
movl %edx, -0x110(%rcx,%rax)
movl %r13d, -0x10c(%rcx,%rax)
xorl %edx, %edx
movq %rdx, -0x108(%rcx,%rax)
movq %r15, -0x100(%rcx,%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0xf8(%rcx,%rax)
movq -0x40(%rbp), %rsi
movq %rsi, -0xf0(%rcx,%rax)
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0xe8(%rcx,%rax)
movl -0xa0(%rbp), %esi
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
movaps -0xd0(%rbp), %xmm9
movups %xmm9, -0xe0(%rcx,%rax)
mulsd 0x2d311(%rip), %xmm0    # 0x6ccc8
mulsd %xmm0, %xmm0
movsd %xmm0, -0xd0(%rcx,%rax)
movsd %xmm11, -0xc8(%rcx,%rax)
movsd %xmm7, -0xc0(%rcx,%rax)
movsd %xmm5, -0xb8(%rcx,%rax)
movsd %xmm6, -0xb0(%rcx,%rax)
movsd %xmm3, -0xa8(%rcx,%rax)
movsd %xmm2, -0xa0(%rcx,%rax)
movsd %xmm4, -0x98(%rcx,%rax)
movsd %xmm8, -0x90(%rcx,%rax)
movsd %xmm14, -0x88(%rcx,%rax)
movsd %xmm13, -0x80(%rcx,%rax)
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x78(%rcx,%rax)
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x70(%rcx,%rax)
movsd %xmm10, -0x68(%rcx,%rax)
movsd %xmm12, -0x60(%rcx,%rax)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x58(%rcx,%rax)
xorps %xmm0, %xmm0
cvtsi2sdl -0xa8(%rbp), %xmm0
movq %rdx, -0x50(%rcx,%rax)
movsd -0x60(%rbp), %xmm2
movsd %xmm2, -0x48(%rcx,%rax)
xorps %xmm2, %xmm2
cvtsi2sdl -0xa4(%rbp), %xmm2
mulsd 0x2d29c(%rip), %xmm2    # 0x6cd18
movsd %xmm2, -0x40(%rcx,%rax)
mulsd 0x2f3c6(%rip), %xmm0    # 0x6ee50
movsd %xmm0, -0x38(%rcx,%rax)
movsd %xmm15, -0x30(%rcx,%rax)
movsd %xmm1, -0x28(%rcx,%rax)
movapd -0xf0(%rbp), %xmm0
movapd -0xe0(%rbp), %xmm1
movupd %xmm1, -0x10(%rcx,%rax)
movupd %xmm0, -0x20(%rcx,%rax)
movl %r12d, 0x9bdd4(%rbx)
movl $0x2, %eax
jmp 0x3faf0
leaq 0x2fcff(%rip), %rsi     # 0x6f7cd
movl $0x2, %edi
jmp 0x3fae4
leaq 0x2fd3c(%rip), %rsi     # 0x6f818
movl $0x2, %edi
movl %r13d, %edx
xorl %eax, %eax
callq 0x4d55d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x80(%rbx), %rax
leal -0x1(%r12), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,8), %r14
shlq $0x5, %r14
movq 0x20(%rax,%r14), %rsi
movsd 0x28(%rax,%r14), %xmm1
movq %r15, %rdi
movsd -0x30(%rbp), %xmm0
callq 0x4f51b
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3f7dc
jp 0x3f7dc
movq 0x80(%rbx), %rcx
movl -0x38(%rbp), %eax
cmpl 0x4(%rcx,%r14), %eax
jne 0x3f7dc
addq %r14, %rcx
xorl %eax, %eax
movl -0x34(%rbp), %edx
cmpl 0x8(%rcx), %edx
jne 0x3f7dc
jmp 0x3faf0