// File: 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
subq $0x30, %rsp
leaq 0xb8f36(%rip), %rdi     # 0x187db5
callq 0x7add0
leaq 0x2ce149(%rip), %rax    # 0x39cfd4
movl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0xcee9a
jmp 0xcf145
leaq 0x2ce133(%rip), %rax    # 0x39cfd4
movl (%rax), %ecx
orl $0x8, %ecx
leaq 0x2ce127(%rip), %rax    # 0x39cfd4
movl %ecx, (%rax)
leaq 0x29d502(%rip), %rax    # 0x36c3b8
movl (%rax), %ecx
andl $-0x9, %ecx
leaq 0x29d4f6(%rip), %rax    # 0x36c3b8
movl %ecx, (%rax)
callq 0x7a510
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x4(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0xcf145
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0xc(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x10(%rbp)
callq 0x7a9d0
movsd %xmm0, -0x18(%rbp)
callq 0x7a9d0
movsd %xmm0, -0x20(%rbp)
callq 0x7a860
movss %xmm0, -0x24(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x28(%rbp)
cmpl $0x1, -0xc(%rbp)
jl 0xcf135
cmpl $0x3e7, -0xc(%rbp)      # imm = 0x3E7
jg 0xcf135
movl -0x28(%rbp), %eax
andl $0x1, %eax
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xcef80
jp 0xcef80
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x28(%rbp), %eax
andl $0x2, %eax
cvtsi2sd %eax, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xcef9d
jp 0xcef9d
xorps %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movl -0x28(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0xcefb0
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movss -0x24(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x1cf1cc(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x30(%rax)
movsd -0x18(%rbp), %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x1cf1ad(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x38(%rax)
movsd -0x20(%rbp), %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x1cf18e(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movsd %xmm0, 0x28(%rax)
movl -0x28(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xcf03a
movslq -0xc(%rbp), %rcx
leaq 0x1cf169(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x80, 0x68(%rax)
jmp 0xcf056
movslq -0xc(%rbp), %rcx
leaq 0x1cf14b(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x0, 0x68(%rax)
cvtsi2ssl -0x10(%rbp), %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x1cf12a(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20(%rax)
movl -0xc(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x29d4a6(%rip), %rax    # 0x36c52c
orl (%rax), %ecx
leaq 0x29d49d(%rip), %rax    # 0x36c52c
movl %ecx, (%rax)
movss -0x24(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xcf0a2
jp 0xcf0a2
jmp 0xcf0d7
leaq 0x29d477(%rip), %rax    # 0x36c520
cmpl $0x0, (%rax)
jne 0xcf0bb
leaq 0x1a896f(%rip), %rax    # 0x277a24
movl $0x7e2, (%rax)          # imm = 0x7E2
movl -0xc(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x29d454(%rip), %rax    # 0x36c520
orl (%rax), %ecx
leaq 0x29d44b(%rip), %rax    # 0x36c520
movl %ecx, (%rax)
movsd -0x18(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xcf0e9
jp 0xcf0e9
jmp 0xcf105
movl -0xc(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x29d42e(%rip), %rax    # 0x36c528
orl (%rax), %ecx
leaq 0x29d425(%rip), %rax    # 0x36c528
movl %ecx, (%rax)
movsd -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xcf117
jp 0xcf117
jmp 0xcf133
movl -0xc(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x29d3fc(%rip), %rax    # 0x36c524
orl (%rax), %ecx
leaq 0x29d3f3(%rip), %rax    # 0x36c524
movl %ecx, (%rax)
jmp 0xcf135
jmp 0xcf137
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xceedb
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)