// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_venus_xnav()
void parse_venus_xnav()
{
int fix_mode;
int week;
double vtow;
double bias;
float drift;
double jd;

   log_packet_id("venus_xnav");
   saw_venus_raw |= 0x02;
   minor_alarms &= (~MINOR_NO_TRACK);

   tsip_byte();  // iod
   fix_mode = tsip_byte();
   week = tsip_word();
   vtow = tsip_double();
   ecef_x = tsip_double();
   ecef_y = tsip_double();
   ecef_z = tsip_double();
   tsip_single();  // velocity
   tsip_single();
   tsip_single();
   bias = tsip_double();   // meters
   drift = tsip_single();  // meters/sec
   gdop = tsip_single();
   pdop = tsip_single();
   hdop = tsip_single();
   vdop = tsip_single();
   tdop = tsip_single();
   have_dops |= (GDOP | PDOP | HDOP | VDOP | TDOP);

   if(1) ;
   else if(minor_alarms & MINOR_SURVEY) rcvr_mode = RCVR_MODE_SURVEY;
   else if(venus_hold_mode)             rcvr_mode = RCVR_MODE_HOLD;
   else if(fix_mode == 0)               rcvr_mode = RCVR_MODE_NO_SATS;
   else if(fix_mode == 1)               rcvr_mode = RCVR_MODE_ACQUIRE;
   else if(fix_mode == 2)               rcvr_mode = RCVR_MODE_2D;
   else if(fix_mode == 3)               rcvr_mode = RCVR_MODE_3D;
   else if(fix_mode == 4)               rcvr_mode = RCVR_MODE_DGPS;
   else                                 rcvr_mode = RCVR_MODE_UNKNOWN;

   pri_tow = this_tow = tow = survey_tow = (long) vtow; // tow

   ecef_to_lla(ecef_x,ecef_y,ecef_z);
   lat = elat;
   lon = elon;
   alt = ealt;

   if(week >= 0) {
      gps_week = week;
      faked_tow = 0;
      if(have_week == 0) need_redraw = 2007;
      have_week = 222;
   }

   pri_tow = tow = this_tow = (int) vtow;
   if(have_tow == 0) need_redraw = 2008;
   have_tow = 222;
   survey_tow = tow;

   jd = vtow;
   jd /= (24.0*60.0*60.0);
   jd += (week * 7.0);
   jd += GPS_EPOCH;

   set_gregorian_time(jd);

   if(timing_mode == TMODE_UTC) {  // we want UTC time - convert gps time to utc
      gps_to_utc();
   }

   if(TICC_USED == 0) {
      pps_offset = bias;
      have_pps_offset = 1;
      plot[PPS].plot_id = "Bias";
      plot[PPS].units = "m";
      if(user_set_pps_plot == 0) {
         user_set_pps_plot = 1;
         plot[PPS].show_plot = 1;
      }

      osc_offset = drift;
      have_osc_offset = 1;
      plot[OSC].plot_id = "Drift";
      plot[OSC].units = "m/s";
      plot[OSC].ref_scale = 1.0F;
      if(user_set_osc_plot == 0) {
         plot[OSC].show_plot = 1;
         user_set_osc_plot = 1;
      }
      if(plot[OSC].user_set_float == 0) plot[OSC].float_center = 1;

      if(user_set_lla_plots == 0) {
         if(plot[ONE].user_set_show == 0)   plot[ONE].show_plot = 0;
         if(plot[TWO].user_set_show == 0)   plot[TWO].show_plot = 0;
         if(plot[THREE].user_set_show == 0) plot[THREE].show_plot = 0;
         user_set_lla_plots = 1;
      }
   }

   update_gps_screen(1223); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x84d95(%rip), %rdi     # 0x10e9f4
callq 0x520bf
leaq 0x29e189(%rip), %rax    # 0x327df4
orb $0x2, (%rax)
leaq 0x26d563(%rip), %rax    # 0x2f71d8
andb $-0x9, (%rax)
callq 0x51c47
callq 0x51c47
callq 0x51c63
movl %eax, %ebx
callq 0x51e6f
movsd %xmm0, -0x38(%rbp)
callq 0x51e6f
leaq 0x26d349(%rip), %rax    # 0x2f6fe8
movsd %xmm0, (%rax)
callq 0x51e6f
leaq 0x26d341(%rip), %rax    # 0x2f6ff0
movsd %xmm0, (%rax)
callq 0x51e6f
leaq 0x26d339(%rip), %rax    # 0x2f6ff8
movsd %xmm0, (%rax)
callq 0x51dc3
callq 0x51dc3
callq 0x51dc3
callq 0x51e6f
movsd %xmm0, -0x40(%rbp)
callq 0x51dc3
movss %xmm0, -0x2c(%rbp)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x18380a(%rip), %rax    # 0x20d500
movsd %xmm0, (%rax)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x1837de(%rip), %rax    # 0x20d4e8
movsd %xmm0, (%rax)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x1837d2(%rip), %rax    # 0x20d4f0
movsd %xmm0, (%rax)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x1837c6(%rip), %rax    # 0x20d4f8
movsd %xmm0, (%rax)
callq 0x51dc3
leaq 0x1837a2(%rip), %rax    # 0x20d4e4
orb $0x1f, (%rax)
cvtss2sd %xmm0, %xmm0
leaq 0x1837b8(%rip), %rax    # 0x20d508
cvttsd2si -0x38(%rbp), %rcx
movsd %xmm0, (%rax)
leaq 0x26d9ef(%rip), %r13    # 0x2f7750
movq %rcx, (%r13)
leaq 0x26d9d0(%rip), %r14    # 0x2f773c
movl %ecx, (%r14)
leaq 0x26d9ca(%rip), %r15    # 0x2f7740
movl %ecx, (%r15)
leaq 0x26d9c4(%rip), %r12    # 0x2f7744
movl %ecx, (%r12)
leaq 0x26d25d(%rip), %rax    # 0x2f6fe8
movsd (%rax), %xmm0
leaq 0x26d25a(%rip), %rax    # 0x2f6ff0
movsd (%rax), %xmm1
leaq 0x26d257(%rip), %rax    # 0x2f6ff8
movsd (%rax), %xmm2
callq 0x5562d
movsd 0x2ccce6(%rip), %xmm0   # 0x356a98
leaq 0x26d217(%rip), %rax    # 0x2f6fd0
movsd %xmm0, (%rax)
movsd 0x2cccdb(%rip), %xmm0   # 0x356aa0
leaq 0x26d20c(%rip), %rax    # 0x2f6fd8
movsd %xmm0, (%rax)
movsd 0x2cccd0(%rip), %xmm0   # 0x356aa8
leaq 0x26d201(%rip), %rax    # 0x2f6fe0
movsd %xmm0, (%rax)
leaq 0x26d95e(%rip), %rax    # 0x2f7748
andl $0x0, (%rax)
leaq 0x26d944(%rip), %rax    # 0x2f7738
movw %bx, (%rax)
leaq 0x26d52e(%rip), %rax    # 0x2f732c
cmpl $0x0, (%rax)
jne 0x89e10
leaq 0x178a3a(%rip), %rcx    # 0x202844
movl $0x7d7, (%rcx)          # imm = 0x7D7
movl $0xde, (%rax)
movsd -0x38(%rbp), %xmm1
cvttsd2si %xmm1, %eax
movl %eax, (%r15)
movl %eax, (%r14)
movl %eax, (%r12)
leaq 0x26d4f8(%rip), %rcx    # 0x2f7328
cmpl $0x0, (%rcx)
jne 0x89e42
leaq 0x178a08(%rip), %rdx    # 0x202844
movl $0x7d8, (%rdx)          # imm = 0x7D8
movl $0xde, (%rcx)
movl %eax, %eax
divsd 0x691c6(%rip), %xmm1    # 0xf3018
movzwl %bx, %ecx
cvtsi2sd %ecx, %xmm0
mulsd 0x6bb1f(%rip), %xmm0    # 0xf5980
movq %rax, (%r13)
addsd %xmm1, %xmm0
addsd 0x6ba9f(%rip), %xmm0    # 0xf5910
callq 0x55392
leaq 0x26d640(%rip), %rax    # 0x2f74bd
cmpb $0x3, (%rax)
jne 0x89e87
callq 0x55500
leaq 0x178a42(%rip), %rax    # 0x2028d0
cmpq $0x10000, (%rax)        # imm = 0x10000
je 0x89faf
callq 0x66b41
testl %eax, %eax
jne 0x89faf
leaq 0x26c909(%rip), %rax    # 0x2f67b8
movsd -0x40(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq 0x26d379(%rip), %rax    # 0x2f7238
movl $0x1, (%rax)
leaq 0x7df58(%rip), %rcx     # 0x107e24
leaq 0xbde5d(%rip), %rax     # 0x147d30
movq %rcx, (%rax)
leaq 0x77738(%rip), %rcx     # 0x101615
movq %rcx, 0x8(%rax)
leaq 0x26df77(%rip), %rcx    # 0x2f7e5f
cmpb $0x0, (%rcx)
jne 0x89ef7
movb $0x1, (%rcx)
movl $0x1, 0x18(%rax)
cvtss2sd -0x2c(%rbp), %xmm0
leaq 0x26c8bd(%rip), %rcx    # 0x2f67c0
movsd %xmm0, (%rcx)
leaq 0x26d326(%rip), %rcx    # 0x2f7234
movl $0x1, (%rcx)
leaq 0x84ae4(%rip), %rcx     # 0x10e9ff
movq %rcx, 0xe8(%rax)
leaq 0x8a80a(%rip), %rcx     # 0x114733
movq %rcx, 0xf0(%rax)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0xf8(%rax)
leaq 0x26df18(%rip), %rcx    # 0x2f7e60
cmpb $0x0, (%rcx)
jne 0x89f5a
movl $0x1, 0x100(%rax)
movb $0x1, (%rcx)
cmpl $0x0, 0x1c4(%rax)
jne 0x89f6d
movl $0x1, 0x104(%rax)
leaq 0x26def4(%rip), %rcx    # 0x2f7e68
cmpl $0x0, (%rcx)
jne 0x89faf
cmpl $0x0, 0x480(%rax)
jne 0x89f89
andl $0x0, 0x3b8(%rax)
cmpl $0x0, 0x568(%rax)
jne 0x89f99
andl $0x0, 0x4a0(%rax)
cmpl $0x0, 0x650(%rax)
jne 0x89fa9
andl $0x0, 0x588(%rax)
movl $0x1, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x694f6