// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_type1010(bamboo::rtcm_t*)
static int decode_type1010(rtcm_t *rtcm)
{
    double pr1,cnr1,tt,cp1,lam1;
    int i=24+61,j,index,nsat,sync,prn,sat,code,freq,ppr1,lock1,amb,sys=SYS_GLO;
    
    if ((nsat=decode_head1009(rtcm,&sync))<0) return -1;
    
    for (j=0;j<nsat&&rtcm->obs.n<MAXOBS&&i+79<=rtcm->len*8;j++) {
        prn  =getbitu(rtcm->buff,i, 6); i+= 6;
        code =getbitu(rtcm->buff,i, 1); i+= 1;
        freq =getbitu(rtcm->buff,i, 5); i+= 5;
        pr1  =getbitu(rtcm->buff,i,25); i+=25;
        ppr1 =getbits(rtcm->buff,i,20); i+=20;
        lock1=getbitu(rtcm->buff,i, 7); i+= 7;
        amb  =getbitu(rtcm->buff,i, 7); i+= 7;
        cnr1 =getbitu(rtcm->buff,i, 8); i+= 8;
        if (!(sat=satno(sys,prn))) {
            trace(2,"rtcm3 1010 satellite number error: prn=%d\n",prn);
            continue;
        }
        tt=timediff(rtcm->obs.data[0].time,rtcm->time);
        if (rtcm->obsflag||fabs(tt)>1E-9) {
            rtcm->obs.n=rtcm->obsflag=0;
        }
        if ((index=obsindex(&rtcm->obs,rtcm->time,sat))<0) continue;
        pr1=pr1*0.02+amb*PRUNIT_GLO;
        if (ppr1!=(int)0xFFF80000) {
            rtcm->obs.data[index].P[0]=pr1;
            lam1=CLIGHT/(FREQ1_GLO+DFRQ1_GLO*(freq-7));
            cp1=adjcp(rtcm,sat,0,ppr1*0.0005/lam1);
            rtcm->obs.data[index].L[0]=pr1/lam1+cp1;
        }
        rtcm->obs.data[index].LLI[0]=lossoflock(rtcm,sat,0,lock1);
        rtcm->obs.data[index].SNR[0]=snratio(cnr1*0.25);
        rtcm->obs.data[index].code[0]=code?CODE_L1P:CODE_L1C;
    }
    return sync?0:1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq -0x4c(%rbp), %rsi
callq 0x43167
testl %eax, %eax
js 0x3c94e
je 0x3c943
leaq 0x30(%rbx), %rcx
movq %rcx, -0x60(%rbp)
leaq 0x9f0c4(%rbx), %r12
leaq 0x9bdd8(%rbx), %rcx
movq %rcx, -0x58(%rbp)
leaq 0x9cc60(%rbx), %rcx
movq %rcx, -0x68(%rbp)
movl $0xa4, %r14d
movq -0x60(%rbp), %rcx
cmpl $0x3f, (%rcx)
jg 0x3c943
movl 0x9f0c0(%rbx), %ecx
shll $0x3, %ecx
cmpl %ecx, %r14d
jg 0x3c943
movl %eax, -0x48(%rbp)
leal -0x4f(%r14), %esi
movq %r12, %rdi
movl $0x6, %edx
callq 0x4e341
movl %eax, %r15d
leal -0x49(%r14), %esi
movq %r12, %rdi
movl $0x1, %edx
callq 0x4e341
movl %eax, -0x44(%rbp)
leal -0x48(%r14), %esi
movq %r12, %rdi
movl $0x5, %edx
callq 0x4e341
movl %eax, -0x34(%rbp)
leal -0x43(%r14), %esi
movq %r12, %rdi
movl $0x19, %edx
callq 0x4e341
movl %eax, -0x30(%rbp)
leal -0x2a(%r14), %esi
movq %r12, %rdi
movl $0x14, %edx
callq 0x4e390
movl %eax, -0x38(%rbp)
leal -0x16(%r14), %esi
movq %r12, %rdi
movl $0x7, %edx
callq 0x4e341
movl %eax, -0x40(%rbp)
leal -0xf(%r14), %esi
movq %r12, %rdi
movl $0x7, %edx
callq 0x4e341
movl %eax, -0x2c(%rbp)
leal -0x8(%r14), %esi
movq %r12, %rdi
movl $0x8, %edx
callq 0x4e341
movl %eax, -0x3c(%rbp)
movl $0x4, %edi
movl %r15d, %esi
callq 0x4dbc5
testl %eax, %eax
je 0x3c82b
movl %eax, %r13d
movq 0x38(%rbx), %rax
movq (%rax), %rdi
movsd 0x8(%rax), %xmm0
movq 0x10(%rbx), %rsi
movsd 0x18(%rbx), %xmm1
callq 0x4fe97
cmpl $0x0, 0x9bdd0(%rbx)
jne 0x3c744
andpd 0x2d1f6(%rip), %xmm0    # 0x69930
ucomisd 0x305c6(%rip), %xmm0    # 0x6cd08
jbe 0x3c74f
xorl %eax, %eax
movl %eax, 0x9bdd0(%rbx)
movl %eax, 0x30(%rbx)
movq 0x10(%rbx), %rsi
movsd 0x18(%rbx), %xmm0
movq -0x60(%rbp), %rdi
movl %r13d, %edx
callq 0x430c2
testl %eax, %eax
js 0x3c92b
movl %eax, %eax
movl -0x38(%rbp), %edi
cmpl $0xfff80000, %edi       # imm = 0xFFF80000
je 0x3c876
movl -0x30(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl -0x2c(%rbp), %xmm1
mulsd 0x326a8(%rip), %xmm1    # 0x6ee40
mulsd 0x2f680(%rip), %xmm0    # 0x6be20
addsd %xmm1, %xmm0
movq 0x38(%rbx), %rcx
leaq (%rax,%rax,2), %rdx
shlq $0x5, %rdx
movsd %xmm0, 0x38(%rcx,%rdx)
movl -0x34(%rbp), %esi
addl $-0x7, %esi
cvtsi2sd %esi, %xmm2
mulsd 0x2e1c0(%rip), %xmm2    # 0x6a988
addsd 0x2e1c0(%rip), %xmm2    # 0x6a990
movsd 0x2f5c8(%rip), %xmm1    # 0x6bda0
divsd %xmm2, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %edi, %xmm2
mulsd 0x3261d(%rip), %xmm2    # 0x6ee08
divsd %xmm1, %xmm2
leal -0x1(%r13), %esi
movslq %esi, %rsi
leaq (%rsi,%rsi,2), %rsi
movq -0x58(%rbp), %rdi
movsd (%rdi,%rsi,8), %xmm3
ucomisd 0x2e0fd(%rip), %xmm3    # 0x6a908
jne 0x3c80f
jnp 0x3c85c
movapd %xmm3, %xmm4
addsd 0x325f5(%rip), %xmm4    # 0x6ee10
ucomisd %xmm2, %xmm4
jbe 0x3c846
addsd 0x325ff(%rip), %xmm2    # 0x6ee28
jmp 0x3c85c
movl $0x2, %edi
leaq 0x32903(%rip), %rsi     # 0x6f13a
movl %r15d, %edx
xorl %eax, %eax
callq 0x4ded0
jmp 0x3c92b
addsd 0x325ca(%rip), %xmm3    # 0x6ee18
ucomisd %xmm3, %xmm2
jbe 0x3c85c
addsd 0x325c4(%rip), %xmm2    # 0x6ee20
movq -0x58(%rbp), %rdi
leaq (%rdi,%rsi,8), %rsi
movsd %xmm2, (%rsi)
divsd %xmm1, %xmm0
addsd %xmm2, %xmm0
movsd %xmm0, 0x20(%rcx,%rdx)
movl -0x40(%rbp), %edi
testl %edi, %edi
movq -0x68(%rbp), %rdx
jne 0x3c897
leal -0x1(%r13), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
cmpw $0x0, (%rdx,%rcx,2)
je 0x3c93c
leal -0x1(%r13), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movzwl (%rdx,%rcx,2), %ecx
cmpl %ecx, %edi
setl %cl
movq %rdx, %rsi
movl -0x3c(%rbp), %edx
xorps %xmm0, %xmm0
cvtsi2sd %rdx, %xmm0
decl %r13d
movslq %r13d, %rdx
leaq (%rdx,%rdx,2), %rdx
movw %di, (%rsi,%rdx,2)
movq 0x38(%rbx), %rdx
shlq $0x5, %rax
leaq (%rax,%rax,2), %rax
mulsd 0x2e135(%rip), %xmm0    # 0x6aa10
ucomisd 0x3254d(%rip), %xmm0    # 0x6ee30
movb %cl, 0x15(%rdx,%rax)
movapd %xmm0, %xmm1
mulsd 0x2dfb5(%rip), %xmm1    # 0x6a8a8
addsd 0x2f37d(%rip), %xmm1    # 0x6bc78
cvttsd2si %xmm1, %ecx
movl $0x0, %edx
cmovael %edx, %ecx
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
cmovael %edx, %ecx
movq 0x38(%rbx), %rdx
movb %cl, 0x12(%rdx,%rax)
cmpl $0x1, -0x44(%rbp)
movb $0x2, %cl
sbbb $0x0, %cl
movq 0x38(%rbx), %rdx
movb %cl, 0x18(%rdx,%rax)
addl $0x4f, %r14d
movl -0x48(%rbp), %eax
decl %eax
jne 0x3c635
jmp 0x3c943
movb $0x1, %cl
jmp 0x3c8ab
xorl %eax, %eax
cmpl $0x0, -0x4c(%rbp)
sete %al
jmp 0x3c953
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq