// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_raw()
void parse_venus_raw()
{
int count;
int i;
int prn;
int snr;
double range;
double phase;
float doppler;
int flags;

   // raw measurements
   log_packet_id("venus_raw");
if(saw_venus_raw & 0x10) return;  // use extended raw data

   saw_venus_raw |= 0x08;
   minor_alarms &= (~MINOR_NO_TRACK);
   tsip_byte();  // iod
   count = tsip_byte();

   for(i=0; i<count; i++) {
      prn = 0;
      snr = 0;
      range = 0.0;
      phase = 0.0;
      doppler = 0.0;

      prn = tsip_byte();
      snr = tsip_byte();
      range = tsip_double();
      phase = tsip_double();
      doppler = tsip_single();
      flags = tsip_byte();

      if((prn >= 1) && (prn <= MAX_PRN)) {
         if((flags & 0x01) == 0.0) range = 0.0;
         if((flags & 0x02) == 0.0) doppler = 0.0F;
         if((flags & 0x04) == 0) phase = 0.0;

         sat[prn].doppler = doppler;
         sat[prn].range = range;
         sat[prn].code_phase = phase;
         if(flags & 0x08) sat[prn].ca_lli = LOCK_LOST;
         else             sat[prn].ca_lli = 0;

         sat[prn].sig_level = (float) snr;
         have_snr |= rinex_gnss(prn);

         if(doppler != 0.0F) {
            if(have_doppler == 0) need_redraw = 2018;
            have_doppler |= rinex_gnss(prn);
         }
         if(range != 0.0F) {
            have_range |= rinex_gnss(prn);
         }
         if(phase != 0.0F) {
            have_phase |= rinex_gnss(prn);
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x8c9c2(%rip), %rdi     # 0x124ac9
callq 0x58dc2
leaq 0x2a5ce1(%rip), %rax    # 0x33ddf4
movl (%rax), %ecx
testb $0x10, %cl
jne 0x982de
orl $0x8, %ecx
movl %ecx, (%rax)
leaq 0x2750ae(%rip), %rax    # 0x30d1d8
andb $-0x9, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x98143
leaq 0x1a6e30(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x9815b
leaq 0x1a6e18(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
andl $0xff, %ebx
je 0x982de
leaq 0x1a6e42(%rip), %r12    # 0x23efb0
leaq 0x1a6dfb(%rip), %r13    # 0x23ef70
callq 0x587be
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x98189
orb $0x8, (%r13)
callq 0x587be
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9819d
orb $0x8, (%r13)
callq 0x58b08
movsd %xmm0, -0x30(%rbp)
callq 0x58b08
movsd %xmm0, -0x40(%rbp)
callq 0x58a30
movss %xmm0, -0x38(%rbp)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x981cc
orb $0x8, (%r13)
movzbl %r14b, %r14d
testl %r14d, %r14d
je 0x982d6
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
testb $0x1, %al
je 0x981e8
movsd -0x30(%rbp), %xmm2
xorps %xmm0, %xmm0
testb $0x2, %al
je 0x981f4
movss -0x38(%rbp), %xmm0
testb $0x4, %al
je 0x981fd
movsd -0x40(%rbp), %xmm1
movss %xmm0, -0x30(%rbp)
cvtss2sd %xmm0, %xmm0
movl %r14d, %ecx
imulq $0x348, %rcx, %rcx      # imm = 0x348
movsd %xmm0, 0x30(%r12,%rcx)
movsd %xmm2, -0x38(%rbp)
movsd %xmm2, 0x38(%r12,%rcx)
movsd %xmm1, -0x40(%rbp)
movsd %xmm1, 0x28(%r12,%rcx)
andl $0x8, %eax
shll $0x4, %eax
movl %eax, 0x68(%r12,%rcx)
movzbl %r15b, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x20(%r12,%rcx)
movl %r14d, %edi
callq 0xdc1dd
leaq 0x2750f1(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movss -0x30(%rbp), %xmm0
ucomiss 0x74e27(%rip), %xmm0    # 0x10d090
leaq 0x2750d0(%rip), %r15    # 0x30d340
jne 0x98274
jnp 0x98292
cmpl $0x0, (%r15)
jne 0x98287
leaq 0x1805c3(%rip), %rax    # 0x218844
movl $0x7e2, (%rax)          # imm = 0x7E2
movl %r14d, %edi
callq 0xdc1dd
orl %eax, (%r15)
movsd -0x38(%rbp), %xmm0
ucomisd 0x70e79(%rip), %xmm0    # 0x109118
jne 0x982a3
jnp 0x982b4
movl %r14d, %edi
callq 0xdc1dd
leaq 0x275096(%rip), %rcx    # 0x30d348
orl %eax, (%rcx)
movsd -0x40(%rbp), %xmm0
ucomisd 0x70e57(%rip), %xmm0    # 0x109118
jne 0x982c5
jnp 0x982d6
movl %r14d, %edi
callq 0xdc1dd
leaq 0x275070(%rip), %rcx    # 0x30d344
orl %eax, (%rcx)
decl %ebx
jne 0x98175
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq