// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_ssr7(bamboo::rtcm_t*, int)
static int decode_ssr7(rtcm_t *rtcm, int sys)
{
    const int *codes;
    double udint,bias,std,pbias[MAXCODE],stdpb[MAXCODE];
    int i,j,k,type,mode,sync,iod,nsat,prn,sat,nbias,ncode,np,mw,offp,sii,swl;
    int dispe,sdc,yaw_ang,yaw_rate;
    
    type=getbitu(rtcm->buff,24,12);
    
    if ((nsat=decode_ssr7_head(rtcm,sys,&sync,&iod,&udint,&dispe,&mw,&i))<0) {
        trace(2,"rtcm3 %d length error: len=%d\n",type,rtcm->len);
        return -1;
    }
    switch (sys) {
        case SYS_GPS: np=6; offp=  0; codes=codes_gps; ncode=17; break;
        case SYS_GLO: np=5; offp=  0; codes=codes_glo; ncode= 4; break;
        case SYS_GAL: np=6; offp=  0; codes=codes_gal; ncode=19; break;
        case SYS_QZS: np=4; offp=192; codes=codes_qzs; ncode=13; break;
        case SYS_CMP: np=6; offp=  1; codes=codes_bds; ncode= 9; break;
        default: return sync?0:10;
    }
    for (j=0;j<nsat&&i+5+17+np<=rtcm->len*8;j++) {
        prn     =getbitu(rtcm->buff,i,np)+offp; i+=np;
        nbias   =getbitu(rtcm->buff,i, 5);      i+= 5;
        yaw_ang =getbitu(rtcm->buff,i, 9);      i+= 9;
        yaw_rate=getbits(rtcm->buff,i, 8);      i+= 8;
        
        for (k=0;k<MAXCODE;k++) pbias[k]=stdpb[k]=0.0;
        for (k=0;k<nbias&&i+49<=rtcm->len*8;k++) {
            mode=getbitu(rtcm->buff,i, 5); i+= 5;
            sii =getbitu(rtcm->buff,i, 1); i+= 1; /* integer-indicator */
            swl =getbitu(rtcm->buff,i, 2); i+= 2; /* WL integer-indicator */
            sdc =getbitu(rtcm->buff,i, 4); i+= 4; /* discontinuity counter */
            bias=getbits(rtcm->buff,i,20); i+=20; /* phase bias (m) */
            std =getbitu(rtcm->buff,i,17); i+=17; /* phase bias std-dev (m) */
            if (mode<=ncode) {
                pbias[codes[mode]-1]=bias*0.0001; /* (m) */
                stdpb[codes[mode]-1]=std *0.0001; /* (m) */
            }
            else {
                trace(2,"rtcm3 %d not supported mode: mode=%d\n",type,mode);
            }
        }
        if (!(sat=satno(sys,prn))) {
            trace(2,"rtcm3 %d satellite number error: prn=%d\n",type,prn);
            continue;
        }
        rtcm->ssr[sat-1].t0 [5]=rtcm->time;
        rtcm->ssr[sat-1].udi[5]=udint;
        rtcm->ssr[sat-1].iod[5]=iod;
        rtcm->ssr[sat-1].yaw_ang =yaw_ang / 256.0*180.0; /* (deg) */
        rtcm->ssr[sat-1].yaw_rate=yaw_rate/8192.0*180.0; /* (deg/s) */
        
        for (k=0;k<MAXCODE;k++) {
            rtcm->ssr[sat-1].pbias[k]=pbias[k];
            rtcm->ssr[sat-1].stdpb[k]=(float)stdpb[k];
        }
    }
    return 20;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %esi, %r14d
movq %rdi, %r13
leaq 0x9f0c4(%rdi), %r15
pushq $0x18
popq %rsi
pushq $0xc
popq %rdx
movq %r15, %rdi
callq 0x459f7
xorl %edx, %edx
cmpl $0x10, %r14d
setne %dl
cmpl $0x4, %r14d
leal 0x5b(%rdx,%rdx), %ecx
pushq $0x5a
popq %rsi
cmovnel %ecx, %esi
movl %eax, -0x30(%rbp)
movl 0x9f0c0(%r13), %ecx
leal (,%rcx,8), %eax
cmpl %eax, %esi
jg 0x3b076
leal 0x4(,%rdx,2), %eax
movq %rax, -0x48(%rbp)
cmpl $0x4, %r14d
movq %r14, -0x50(%rbp)
pushq $0x24
popq %rsi
jne 0x3abb0
pushq $0x11
popq %rdx
movq %r15, %rdi
callq 0x459f7
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movq %r13, %rdi
callq 0x3b61c
pushq $0x35
jmp 0x3abcc
pushq $0x14
popq %rdx
movq %r15, %rdi
callq 0x459f7
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movq %r13, %rdi
callq 0x3b289
pushq $0x38
popq %r12
pushq $0x4
popq %r14
movq %r15, %rdi
movl %r12d, %esi
movl %r14d, %edx
callq 0x459f7
movl %eax, %ebx
leal 0x4(%r12), %esi
pushq $0x1
popq %rdx
movq %r15, %rdi
callq 0x459f7
movq %rax, -0x60(%rbp)
leal 0x5(%r12), %esi
movq %r15, %rdi
movl %r14d, %edx
callq 0x459f7
movq %rax, -0x78(%rbp)
leal 0x9(%r12), %esi
pushq $0x10
popq %rdx
movq %r15, %rdi
callq 0x459f7
movq %rax, -0x58(%rbp)
leal 0x19(%r12), %esi
movq %r15, %rdi
movl %r14d, %edx
callq 0x459f7
movq %rax, -0x38(%rbp)
leal 0x1d(%r12), %esi
movq %r15, %rdi
pushq $0x1
popq %r14
movl %r14d, %edx
callq 0x459f7
leal 0x1e(%r12), %esi
movq %r15, %rdi
movl %r14d, %edx
callq 0x459f7
leal 0x1f(%r12), %esi
movq %r15, -0x80(%rbp)
movq %r15, %rdi
movq -0x48(%rbp), %rdx
callq 0x459f7
movl %eax, %r15d
movl %ebx, -0x2c(%rbp)
movslq %ebx, %rax
leaq 0x2a075(%rip), %rcx     # 0x64cf0
movsd (%rcx,%rax,8), %xmm0
movsd %xmm0, -0x98(%rbp)
movq 0x10(%r13), %rdi
movsd 0x18(%r13), %xmm0
leaq -0x270(%rbp), %r14
pushq $0x2
popq %rdx
movq %r14, %rsi
callq 0x47a48
subq $0x8, %rsp
leaq 0x2ae78(%rip), %rsi     # 0x65b27
pushq $0x4
popq %rdi
movq %r14, %rdx
movq -0x50(%rbp), %rcx
movl %r15d, %r8d
movq -0x60(%rbp), %r9
movq %r9, %r14
xorl %eax, %eax
pushq -0x38(%rbp)
pushq -0x58(%rbp)
movq -0x78(%rbp), %rbx
pushq %rbx
callq 0x455bc
addq $0x20, %rsp
cmpl $0x0, 0xc(%r13)
je 0x3ad1e
leaq 0x9b9d0(%r13), %rdi
callq 0x8290
leaq (%rax,%r13), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
subq $0x8, %rsp
leaq 0x2abb2(%rip), %rsi     # 0x658b4
leaq -0x270(%rbp), %rdx
movl %r15d, %ecx
movl %ebx, %r8d
movl -0x2c(%rbp), %r9d
xorl %eax, %eax
pushq %r14
callq 0x8110
popq %rcx
popq %rdx
testl %r15d, %r15d
js 0x3b06f
movq -0x50(%rbp), %rax
addl $-0x4, %eax
roll $0x1e, %eax
cmpl $0x8, %eax
jae 0x3b062
movl $0x8b, %ecx
btl %eax, %ecx
jae 0x3b062
movq -0x48(%rbp), %rcx
addl %ecx, %r12d
addl $0x1f, %r12d
leaq 0x10(%r13), %rcx
movq %rcx, -0x90(%rbp)
movl %eax, %eax
leaq 0x2ae0d(%rip), %rcx     # 0x65b74
movl (%rcx,%rax,4), %edx
leaq 0x2ae23(%rip), %rcx     # 0x65b94
movl (%rcx,%rax,4), %ecx
movl %ecx, -0x68(%rbp)
leaq 0x2ae36(%rip), %rcx     # 0x65bb4
movl (%rcx,%rax,4), %ecx
movl %ecx, -0x60(%rbp)
leaq 0x2a0e9(%rip), %rcx     # 0x64e74
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %rax, -0x58(%rbp)
leal 0x16(%rdx), %eax
movq %rax, -0xa8(%rbp)
leaq 0x6f148(%r13), %rax
movq %rax, -0x88(%rbp)
movq %rdx, -0xa0(%rbp)
leal 0x36(%rdx), %eax
movl %eax, -0x64(%rbp)
xorl %edx, %edx
movq %r13, -0xb0(%rbp)
movl %r15d, -0x3c(%rbp)
cmpl %r15d, %edx
je 0x3b09f
movq -0xa8(%rbp), %rax
addl %r12d, %eax
movl 0x9f0c0(%r13), %ecx
shll $0x3, %ecx
cmpl %ecx, %eax
jg 0x3b09f
movl %edx, -0x2c(%rbp)
movq -0x80(%rbp), %r14
movq %r14, %rdi
movl %r12d, %esi
movq -0xa0(%rbp), %r15
movl %r15d, %edx
callq 0x459f7
movl %eax, -0x38(%rbp)
leal (%r12,%r15), %esi
movq %r14, %rdi
pushq $0x5
popq %rdx
callq 0x459f7
movl %eax, %ebx
leal (%r12,%r15), %esi
addl $0x5, %esi
movq %r14, %rdi
pushq $0x9
popq %rdx
callq 0x459f7
movl %eax, -0x70(%rbp)
leal (%r12,%r15), %esi
addl $0xe, %esi
movq %r14, %rdi
pushq $0x8
popq %rdx
callq 0x45a39
movl %eax, -0x6c(%rbp)
xorl %eax, %eax
cmpq $0x37, %rax
je 0x3ae66
andq $0x0, -0x430(%rbp,%rax,8)
andq $0x0, -0x270(%rbp,%rax,8)
incq %rax
jmp 0x3ae49
movl -0x38(%rbp), %eax
addl -0x68(%rbp), %eax
movl %eax, -0x38(%rbp)
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
addl -0x64(%rbp), %r12d
movl %r12d, %r14d
leal -0x20(%r14), %r12d
subl $0x1, %ebx
jb 0x3af70
leal 0x11(%r14), %eax
movl 0x9f0c0(%r13), %ecx
shll $0x3, %ecx
cmpl %ecx, %eax
jg 0x3af70
movq -0x80(%rbp), %r15
movq %r15, %rdi
movl %r12d, %esi
pushq $0x5
popq %rdx
callq 0x459f7
movl %eax, -0x48(%rbp)
leal -0x1b(%r14), %esi
movq %r15, %rdi
pushq $0x1
popq %rdx
callq 0x459f7
leal -0x1a(%r14), %esi
movq %r15, %rdi
pushq $0x2
popq %r12
movl %r12d, %edx
callq 0x459f7
leal -0x18(%r14), %esi
movq %r15, %rdi
pushq $0x4
popq %rdx
callq 0x459f7
leal -0x14(%r14), %esi
movq %r15, %rdi
pushq $0x14
popq %rdx
callq 0x45a39
movl %eax, %r13d
movq %r15, %rdi
movl %r14d, %esi
pushq $0x11
popq %rdx
callq 0x459f7
movl -0x48(%rbp), %ecx
cmpl -0x60(%rbp), %ecx
jle 0x3af27
movl %r12d, %edi
leaq 0x2aa0a(%rip), %rsi     # 0x65925
movl -0x30(%rbp), %edx
xorl %eax, %eax
callq 0x455bc
jmp 0x3af60
movl %eax, %eax
cvtsi2sd %rax, %xmm0
cvtsi2sd %r13d, %xmm1
movsd 0x259d5(%rip), %xmm2    # 0x60910
mulsd %xmm2, %xmm1
movslq %ecx, %rax
movq -0x58(%rbp), %rcx
movslq (%rcx,%rax,4), %rax
movsd %xmm1, -0x278(%rbp,%rax,8)
mulsd %xmm2, %xmm0
movsd %xmm0, -0x438(%rbp,%rax,8)
addl $0x31, %r14d
movq -0xb0(%rbp), %r13
jmp 0x3ae80
movq -0x50(%rbp), %rdi
movl -0x38(%rbp), %ebx
movl %ebx, %esi
callq 0x452fd
testl %eax, %eax
je 0x3b03e
decl %eax
cltq
imulq $0x498, %rax, %rax      # imm = 0x498
movq -0x90(%rbp), %rcx
movups (%rcx), %xmm0
movq -0x88(%rbp), %rcx
movups %xmm0, 0x50(%rcx,%rax)
movsd -0x98(%rbp), %xmm0
movsd %xmm0, 0x88(%rcx,%rax)
movq -0x78(%rbp), %rbx
movl %ebx, 0xa4(%rcx,%rax)
cvtsi2sdl -0x70(%rbp), %xmm0
mulsd 0x26dc8(%rip), %xmm0    # 0x61d98
movsd 0x29760(%rip), %xmm1    # 0x64738
mulsd %xmm1, %xmm0
movsd %xmm0, 0x480(%rcx,%rax)
cvtsi2sdl -0x6c(%rbp), %xmm0
mulsd 0x2974e(%rip), %xmm0    # 0x64740
mulsd %xmm1, %xmm0
movsd %xmm0, 0x488(%rcx,%rax)
addq %r13, %rax
xorl %ecx, %ecx
movl -0x3c(%rbp), %r15d
movl -0x2c(%rbp), %edx
cmpq $0xdc, %rcx
je 0x3b05b
movsd -0x270(%rbp,%rcx,2), %xmm0
movsd %xmm0, 0x6f330(%rax,%rcx,2)
cvtsd2ss -0x430(%rbp,%rcx,2), %xmm0
movss %xmm0, 0x6f4e8(%rax,%rcx)
addq $0x4, %rcx
jmp 0x3b00b
pushq $0x2
popq %rdi
leaq 0x2a7f7(%rip), %rsi     # 0x6583f
movl -0x30(%rbp), %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x455bc
movl -0x3c(%rbp), %r15d
movl -0x2c(%rbp), %edx
incl %edx
jmp 0x3adc8
xorl %ecx, %ecx
testl %r14d, %r14d
pushq $0xa
popq %rax
cmovnel %ecx, %eax
jmp 0x3b08d
movl 0x9f0c0(%r13), %ecx
leaq 0x29ec6(%rip), %rsi     # 0x64f43
pushq $0x2
popq %rdi
movl -0x30(%rbp), %edx
xorl %eax, %eax
callq 0x455bc
pushq $-0x1
popq %rax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x14
jmp 0x3b08c