// File: /workspace/github_cpp_makefile_star2_O1/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 0x8c9f7(%rip), %rdi     # 0x1249e9
callq 0x58e77
leaq 0x2a5df6(%rip), %rax    # 0x33ddf4
movl (%rax), %ecx
testb $0x10, %cl
jne 0x981d2
orl $0x8, %ecx
movl %ecx, (%rax)
leaq 0x2751c3(%rip), %rax    # 0x30d1d8
andb $-0x9, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9802e
leaq 0x1a6f45(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x98046
leaq 0x1a6f2d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
andl $0xff, %ebx
je 0x981d2
leaq 0x1a6f57(%rip), %r13    # 0x23efb0
callq 0x587d1
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jb 0x98072
leaq 0x1a6f01(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9808b
leaq 0x1a6ee8(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x58b86
movsd %xmm0, -0x30(%rbp)
callq 0x58b86
movsd %xmm0, -0x40(%rbp)
callq 0x58aae
movss %xmm0, -0x38(%rbp)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x980bf
leaq 0x1a6eb4(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
testb %r15b, %r15b
je 0x981ca
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
testb $0x1, %al
je 0x980d7
movsd -0x30(%rbp), %xmm2
xorps %xmm0, %xmm0
testb $0x2, %al
je 0x980e3
movss -0x38(%rbp), %xmm0
testb $0x4, %al
je 0x980ec
movsd -0x40(%rbp), %xmm1
movzbl %r15b, %r12d
movss %xmm0, -0x30(%rbp)
cvtss2sd %xmm0, %xmm0
movzbl %r15b, %ecx
imulq $0x348, %rcx, %rcx      # imm = 0x348
movsd %xmm0, 0x30(%r13,%rcx)
movsd %xmm2, -0x38(%rbp)
movsd %xmm2, 0x38(%r13,%rcx)
movsd %xmm1, -0x40(%rbp)
movsd %xmm1, 0x28(%r13,%rcx)
andl $0x8, %eax
shll $0x4, %eax
movl %eax, 0x68(%r13,%rcx)
movzbl %r14b, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x20(%r13,%rcx)
movl %r12d, %edi
callq 0xdbb74
leaq 0x2751fd(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
movss -0x30(%rbp), %xmm0
ucomiss 0x74e9f(%rip), %xmm0    # 0x10cffc
leaq 0x2751dc(%rip), %r14    # 0x30d340
jne 0x98168
jnp 0x98186
cmpl $0x0, (%r14)
jne 0x9817b
leaq 0x1806cf(%rip), %rax    # 0x218844
movl $0x7e2, (%rax)          # imm = 0x7E2
movl %r12d, %edi
callq 0xdbb74
orl %eax, (%r14)
movsd -0x38(%rbp), %xmm0
ucomisd 0x70f85(%rip), %xmm0    # 0x109118
jne 0x98197
jnp 0x981a8
movl %r12d, %edi
callq 0xdbb74
leaq 0x2751a2(%rip), %rcx    # 0x30d348
orl %eax, (%rcx)
movsd -0x40(%rbp), %xmm0
ucomisd 0x70f63(%rip), %xmm0    # 0x109118
jne 0x981b9
jnp 0x981ca
movl %r12d, %edi
callq 0xdbb74
leaq 0x27517c(%rip), %rcx    # 0x30d344
orl %eax, (%rcx)
decl %ebx
jne 0x98059
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq