// File: /workspace/github_cpp_makefile_star2_O2/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 0x84957(%rip), %rdi     # 0x10ea11
callq 0x520bf
leaq 0x29dd2e(%rip), %rax    # 0x327df4
movl (%rax), %ecx
testb $0x10, %cl
jne 0x8a241
orl $0x8, %ecx
movl %ecx, (%rax)
leaq 0x26d0fb(%rip), %rax    # 0x2f71d8
andb $-0x9, (%rax)
callq 0x51c47
callq 0x51c47
movzbl %al, %r15d
leaq 0x19eebb(%rip), %r12    # 0x228fb0
leaq 0x26d244(%rip), %r13    # 0x2f7340
subl $0x1, %r15d
jb 0x8a241
callq 0x51c47
movl %eax, %r14d
callq 0x51c47
movl %eax, %ebx
callq 0x51e6f
movsd %xmm0, -0x30(%rbp)
callq 0x51e6f
movsd %xmm0, -0x40(%rbp)
callq 0x51dc3
movss %xmm0, -0x38(%rbp)
callq 0x51c47
testb %r14b, %r14b
je 0x8a0fc
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
testb $0x1, %al
je 0x8a14c
movsd -0x30(%rbp), %xmm2
xorps %xmm0, %xmm0
testb $0x2, %al
je 0x8a158
movss -0x38(%rbp), %xmm0
testb $0x4, %al
je 0x8a161
movsd -0x40(%rbp), %xmm1
movzbl %r14b, %r14d
movzbl %al, %eax
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 %bl, %eax
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x20(%r12,%rcx)
movl %r14d, %edi
callq 0xca4da
leaq 0x26d18a(%rip), %rcx    # 0x2f734c
orl %eax, (%rcx)
movss -0x30(%rbp), %xmm0
ucomiss 0x6cf40(%rip), %xmm0    # 0xf7110
jne 0x8a1d4
jnp 0x8a1f4
cmpl $0x0, (%r13)
jne 0x8a1e8
leaq 0x178662(%rip), %rax    # 0x202844
movl $0x7e2, (%rax)          # imm = 0x7E2
movl %r14d, %edi
callq 0xca4da
orl %eax, (%r13)
movsd -0x38(%rbp), %xmm0
ucomisd 0x68f17(%rip), %xmm0    # 0xf3118
jne 0x8a205
jnp 0x8a216
movl %r14d, %edi
callq 0xca4da
leaq 0x26d134(%rip), %rcx    # 0x2f7348
orl %eax, (%rcx)
movsd -0x40(%rbp), %xmm0
ucomisd 0x68ef5(%rip), %xmm0    # 0xf3118
jne 0x8a22b
jnp 0x8a0fc
movl %r14d, %edi
callq 0xca4da
leaq 0x26d10a(%rip), %rcx    # 0x2f7344
orl %eax, (%rcx)
jmp 0x8a0fc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq