// File: /workspace/github_cpp_makefile_star2_O3/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_ssr1(bamboo::rtcm_t*, int)
static int decode_ssr1(rtcm_t *rtcm, int sys)
{
    double udint,deph[3],ddeph[3];
    int i,j,k,type,sync,iod,nsat,prn,sat,iode,iodcrc,refd=0,np,ni,nj,offp;
    
    type=getbitu(rtcm->buff,24,12);
    
    if ((nsat=decode_ssr1_head(rtcm,sys,&sync,&iod,&udint,&refd,&i))<0) {
        trace(2,"rtcm3 %d length error: len=%d\n",type,rtcm->len);
        return -1;
    }
    switch (sys) {
        case SYS_GPS: np=6; ni= 8; nj= 0; offp=  0; break;
        case SYS_GLO: np=5; ni= 8; nj= 0; offp=  0; break;
        case SYS_GAL: np=6; ni=10; nj= 0; offp=  0; break;
        case SYS_QZS: np=4; ni= 8; nj= 0; offp=192; break;
        case SYS_CMP: np=6; ni=10; nj=24; offp=  1; break;
        case SYS_SBS: np=6; ni= 9; nj=24; offp=120; break;
        default: return sync?0:10;
    }
    for (j=0;j<nsat&&i+121+np+ni+nj<=rtcm->len*8;j++) {
        prn     =getbitu(rtcm->buff,i,np)+offp; i+=np;
        iode    =getbitu(rtcm->buff,i,ni);      i+=ni;
        iodcrc  =getbitu(rtcm->buff,i,nj);      i+=nj;
        deph [0]=getbits(rtcm->buff,i,22)*1E-4; i+=22;
        deph [1]=getbits(rtcm->buff,i,20)*4E-4; i+=20;
        deph [2]=getbits(rtcm->buff,i,20)*4E-4; i+=20;
        ddeph[0]=getbits(rtcm->buff,i,21)*1E-6; i+=21;
        ddeph[1]=getbits(rtcm->buff,i,19)*4E-6; i+=19;
        ddeph[2]=getbits(rtcm->buff,i,19)*4E-6; i+=19;
        
        if (!(sat=satno(sys,prn))) {
            trace(2,"rtcm3 %d satellite number error: prn=%d\n",type,prn);
            continue;
        }
        rtcm->ssr[sat-1].t0 [0]=rtcm->time;
        rtcm->ssr[sat-1].udi[0]=udint;
        rtcm->ssr[sat-1].iod[0]=iod;
        rtcm->ssr[sat-1].iode=iode;     /* sbas/bds: toe/t0 modulo */
        rtcm->ssr[sat-1].iodcrc=iodcrc; /* sbas/bds: iod crc */
        rtcm->ssr[sat-1].refd=refd;
        
        for (k=0;k<3;k++) {
            rtcm->ssr[sat-1].deph [k]=deph [k];
            rtcm->ssr[sat-1].ddeph[k]=ddeph[k];
        }
        rtcm->ssr[sat-1].update=1;
    }
    return sync?0:10;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %esi, %r14d
movq %rdi, %r12
leaq -0x88(%rbp), %rbx
movl $0x0, (%rbx)
addq $0x9f0c4, %rdi          # imm = 0x9F0C4
movq %rdi, -0xc0(%rbp)
movl $0x18, %esi
movl $0xc, %edx
callq 0x4d9d6
movl %eax, %r15d
leaq -0x90(%rbp), %rax
movq %rax, (%rsp)
leaq -0x44(%rbp), %rdx
leaq -0x8c(%rbp), %rcx
leaq -0xc8(%rbp), %r8
movq %r12, %rdi
movl %r14d, %esi
movq %rbx, %r9
callq 0x42b09
testl %eax, %eax
js 0x3fc33
movq $0x0, -0x40(%rbp)
movl $0x8, %ecx
movq %rcx, -0x38(%rbp)
movl $0x6, %r13d
leal -0x1(%r14), %esi
cmpl $0x7, %esi
ja 0x3fc5b
leaq 0x2eef1(%rip), %rcx     # 0x6eafc
movslq (%rcx,%rsi,4), %rsi
addq %rcx, %rsi
movq %r14, -0x50(%rbp)
movl %r15d, -0x30(%rbp)
jmpq *%rsi
movl $0x78, -0x2c(%rbp)
movl $0x18, %ecx
movq %rcx, -0x40(%rbp)
movl $0x9, %ecx
jmp 0x3fc88
movl 0x9f0c0(%r12), %ecx
leaq 0x2f305(%rip), %rsi     # 0x6ef47
movl $0x2, %edi
movl %r15d, %edx
xorl %eax, %eax
callq 0x4d55d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3ff83
cmpl $0x10, %r14d
je 0x3fca8
cmpl $0x20, %r14d
jne 0x3ff75
movl %r15d, -0x30(%rbp)
movq %r14, -0x50(%rbp)
movl $0x1, -0x2c(%rbp)
movl $0x18, %ecx
movq %rcx, -0x40(%rbp)
movl $0xa, %ecx
movq %rcx, -0x38(%rbp)
jmp 0x3fcbd
movl $0xa, %ecx
movq %rcx, -0x38(%rbp)
jmp 0x3fc9f
movl $0x5, %r13d
movl $0x0, -0x2c(%rbp)
jmp 0x3fcbd
movl %r15d, -0x30(%rbp)
movq %r14, -0x50(%rbp)
movl $0xc0, -0x2c(%rbp)
movl $0x4, %r13d
testl %eax, %eax
je 0x3ff75
movl -0x90(%rbp), %r14d
leaq 0x10(%r12), %rcx
movq %rcx, -0xa8(%rbp)
leaq 0x6f148(%r12), %rcx
movq %rcx, -0xa0(%rbp)
movsd -0xc8(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movl -0x8c(%rbp), %ecx
movl %ecx, -0x60(%rbp)
movl -0x88(%rbp), %ecx
movl %ecx, -0x5c(%rbp)
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rsi
leal (%rsi,%rcx), %r15d
leal (%r15,%r13), %ecx
addl $0x79, %ecx
movl %ecx, -0x64(%rbp)
addl %r14d, %r15d
leal (%rsi,%r14), %ecx
movq %rcx, -0x58(%rbp)
movq %r12, -0xb8(%rbp)
movq %r13, -0xb0(%rbp)
leal (%r15,%r13), %esi
addl $0x79, %esi
movl 0x9f0c0(%r12), %ecx
shll $0x3, %ecx
cmpl %ecx, %esi
jg 0x3ff75
movl %eax, -0x84(%rbp)
movq -0xc0(%rbp), %r12
movq %r12, %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0x4d9d6
movl %eax, %ebx
addl -0x2c(%rbp), %ebx
addl %r13d, %r14d
movq %r12, %rdi
movl %r14d, %esi
movq -0x38(%rbp), %rdx
callq 0x4d9d6
movl %eax, -0x80(%rbp)
movq -0x58(%rbp), %rax
leal (%rax,%r13), %esi
movq %r12, %rdi
movq -0x40(%rbp), %rdx
callq 0x4d9d6
movl %eax, -0x7c(%rbp)
leal (%r15,%r13), %esi
movq %r12, %rdi
movl $0x16, %edx
callq 0x4da25
movl %eax, -0x78(%rbp)
leal (%r15,%r13), %esi
addl $0x16, %esi
movq %r12, %rdi
movl $0x14, %edx
callq 0x4da25
movl %eax, -0x74(%rbp)
leal (%r15,%r13), %esi
addl $0x2a, %esi
movq %r12, %rdi
movl $0x14, %edx
callq 0x4da25
movl %eax, -0x70(%rbp)
leal (%r15,%r13), %esi
addl $0x3e, %esi
movq %r12, %rdi
movl $0x15, %edx
callq 0x4da25
movl %eax, -0x6c(%rbp)
leal (%r15,%r13), %esi
addl $0x53, %esi
movq %r12, %rdi
movl $0x13, %edx
callq 0x4da25
movl %eax, -0x68(%rbp)
leal (%r15,%r13), %esi
addl $0x66, %esi
movq %r12, %rdi
movl $0x13, %edx
callq 0x4da25
movl %eax, %r12d
movq -0x50(%rbp), %rdi
movl %ebx, %esi
callq 0x4d28d
testl %eax, %eax
je 0x3ff22
cvtsi2sd %r12d, %xmm0
movsd 0x2f013(%rip), %xmm3    # 0x6ee58
mulsd %xmm3, %xmm0
cvtsi2sdl -0x68(%rbp), %xmm1
cvtsi2sdl -0x6c(%rbp), %xmm2
mulsd %xmm3, %xmm1
mulsd 0x2cde1(%rip), %xmm2    # 0x6cc40
xorps %xmm3, %xmm3
cvtsi2sdl -0x70(%rbp), %xmm3
movsd 0x2eff1(%rip), %xmm5    # 0x6ee60
mulsd %xmm5, %xmm3
cvtsi2sdl -0x74(%rbp), %xmm4
mulsd %xmm5, %xmm4
xorps %xmm5, %xmm5
cvtsi2sdl -0x78(%rbp), %xmm5
mulsd 0x2aa94(%rip), %xmm5    # 0x6a920
decl %eax
cltq
imulq $0x498, %rax, %rax      # imm = 0x498
movq -0xa8(%rbp), %rcx
movups (%rcx), %xmm6
movq -0xa0(%rbp), %rcx
movups %xmm6, (%rcx,%rax)
movsd -0x98(%rbp), %xmm6
movsd %xmm6, 0x60(%rcx,%rax)
movl -0x60(%rbp), %edx
movl %edx, 0x90(%rcx,%rax)
movl -0x80(%rbp), %edx
movl %edx, 0xa8(%rcx,%rax)
movl -0x7c(%rbp), %edx
movl %edx, 0xac(%rcx,%rax)
movl -0x5c(%rbp), %edx
movl %edx, 0xb4(%rcx,%rax)
movsd %xmm5, 0xb8(%rcx,%rax)
movsd %xmm4, 0xc0(%rcx,%rax)
movsd %xmm3, 0xc8(%rcx,%rax)
movsd %xmm2, 0xd0(%rcx,%rax)
movsd %xmm1, 0xd8(%rcx,%rax)
movsd %xmm0, 0xe0(%rcx,%rax)
movb $0x1, 0x490(%rcx,%rax)
jmp 0x3ff3a
movl $0x2, %edi
leaq 0x2f915(%rip), %rsi     # 0x6f843
movl -0x30(%rbp), %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x4d55d
addl -0x38(%rbp), %r14d
movq -0x40(%rbp), %rax
addl %eax, %r14d
addl $0x79, %r14d
movl -0x64(%rbp), %eax
addl %eax, %r15d
movq -0x58(%rbp), %rcx
addl %eax, %ecx
movq %rcx, -0x58(%rbp)
movl -0x84(%rbp), %eax
decl %eax
movq -0xb8(%rbp), %r12
movq -0xb0(%rbp), %r13
jne 0x3fd38
xorl %ecx, %ecx
cmpl $0x0, -0x44(%rbp)
movl $0xa, %eax
cmovnel %ecx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq