// File: /workspace/github_cpp_makefile_star2_O3/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 0x428c3
testl %eax, %eax
js 0x3c2b1
je 0x3c2a6
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 0x3c2a6
movl 0x9f0c0(%rbx), %ecx
shll $0x3, %ecx
cmpl %ecx, %r14d
jg 0x3c2a6
movl %eax, -0x48(%rbp)
leal -0x4f(%r14), %esi
movq %r12, %rdi
movl $0x6, %edx
callq 0x4d9d6
movl %eax, %r15d
leal -0x49(%r14), %esi
movq %r12, %rdi
movl $0x1, %edx
callq 0x4d9d6
movl %eax, -0x44(%rbp)
leal -0x48(%r14), %esi
movq %r12, %rdi
movl $0x5, %edx
callq 0x4d9d6
movl %eax, -0x34(%rbp)
leal -0x43(%r14), %esi
movq %r12, %rdi
movl $0x19, %edx
callq 0x4d9d6
movl %eax, -0x30(%rbp)
leal -0x2a(%r14), %esi
movq %r12, %rdi
movl $0x14, %edx
callq 0x4da25
movl %eax, -0x38(%rbp)
leal -0x16(%r14), %esi
movq %r12, %rdi
movl $0x7, %edx
callq 0x4d9d6
movl %eax, -0x40(%rbp)
leal -0xf(%r14), %esi
movq %r12, %rdi
movl $0x7, %edx
callq 0x4d9d6
movl %eax, -0x2c(%rbp)
leal -0x8(%r14), %esi
movq %r12, %rdi
movl $0x8, %edx
callq 0x4d9d6
movl %eax, -0x3c(%rbp)
movl $0x4, %edi
movl %r15d, %esi
callq 0x4d28d
testl %eax, %eax
je 0x3c0fd
movl %eax, %r13d
movq 0x38(%rbx), %rax
movq (%rax), %rdi
movsd 0x8(%rax), %xmm0
movq 0x10(%rbx), %rsi
movsd 0x18(%rbx), %xmm1
callq 0x4f51b
cmpl $0x0, 0x9bdd0(%rbx)
jne 0x3c0bd
andpd 0x2d87d(%rip), %xmm0    # 0x69930
ucomisd 0x30c4d(%rip), %xmm0    # 0x6cd08
jbe 0x3c0c8
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 0x42820
testl %eax, %eax
js 0x3c297
movl %eax, %eax
movl -0x38(%rbp), %edi
cmpl $0xfff80000, %edi       # imm = 0xFFF80000
jne 0x3c118
decl %r13d
movslq %r13d, %rsi
jmp 0x3c1f6
movl $0x2, %edi
leaq 0x33031(%rip), %rsi     # 0x6f13a
movl %r15d, %edx
xorl %eax, %eax
callq 0x4d55d
jmp 0x3c297
movl -0x30(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl -0x2c(%rbp), %xmm1
mulsd 0x32d0d(%rip), %xmm1    # 0x6ee40
mulsd 0x2fce5(%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 0x2e825(%rip), %xmm2    # 0x6a988
addsd 0x2e825(%rip), %xmm2    # 0x6a990
movsd 0x2fc2d(%rip), %xmm1    # 0x6bda0
divsd %xmm2, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %edi, %xmm2
mulsd 0x32c82(%rip), %xmm2    # 0x6ee08
divsd %xmm1, %xmm2
decl %r13d
movslq %r13d, %rsi
leaq (%rsi,%rsi,2), %rdi
movq -0x58(%rbp), %r8
movsd (%r8,%rdi,8), %xmm3
ucomisd 0x2e762(%rip), %xmm3    # 0x6a908
jne 0x3c1aa
jnp 0x3c1dc
movapd %xmm3, %xmm4
addsd 0x32c5a(%rip), %xmm4    # 0x6ee10
ucomisd %xmm2, %xmm4
jbe 0x3c1c6
addsd 0x32c64(%rip), %xmm2    # 0x6ee28
jmp 0x3c1dc
addsd 0x32c4a(%rip), %xmm3    # 0x6ee18
ucomisd %xmm3, %xmm2
jbe 0x3c1dc
addsd 0x32c44(%rip), %xmm2    # 0x6ee20
movq -0x58(%rbp), %r8
leaq (%r8,%rdi,8), %rdi
movsd %xmm2, (%rdi)
divsd %xmm1, %xmm0
addsd %xmm2, %xmm0
movsd %xmm0, 0x20(%rcx,%rdx)
movl -0x3c(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
movl -0x40(%rbp), %r9d
testl %r9d, %r9d
sete %cl
leaq (%rsi,%rsi,2), %rdx
movq -0x68(%rbp), %r8
movzwl (%r8,%rdx,2), %esi
testw %si, %si
sete %dil
andb %cl, %dil
movzwl %si, %ecx
cmpl %ecx, %r9d
setl %cl
orb %dil, %cl
movw %r9w, (%r8,%rdx,2)
movq 0x38(%rbx), %rdx
shlq $0x5, %rax
leaq (%rax,%rax,2), %rax
mulsd 0x2e7c9(%rip), %xmm0    # 0x6aa10
ucomisd 0x32be1(%rip), %xmm0    # 0x6ee30
movb %cl, 0x15(%rdx,%rax)
movapd %xmm0, %xmm1
mulsd 0x2e649(%rip), %xmm1    # 0x6a8a8
addsd 0x2fa11(%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 0x3bfb2
xorl %eax, %eax
cmpl $0x0, -0x4c(%rbp)
sete %al
jmp 0x3c2b6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq