// File: /workspace/github_cpp_makefile_star2_O3/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 0x8ce99(%rip), %rdi     # 0x124aac
callq 0x58dc2
leaq 0x2a61d5(%rip), %rax    # 0x33ddf4
orb $0x2, (%rax)
leaq 0x2755af(%rip), %rax    # 0x30d1d8
andb $-0x9, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x97c42
leaq 0x1a7331(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x97c58
leaq 0x1a731b(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588d2
movl %eax, %ebx
callq 0x58b08
movsd %xmm0, -0x38(%rbp)
callq 0x58b08
leaq 0x275373(%rip), %rax    # 0x30cfe8
movsd %xmm0, (%rax)
callq 0x58b08
leaq 0x27536b(%rip), %rax    # 0x30cff0
movsd %xmm0, (%rax)
callq 0x58b08
leaq 0x275363(%rip), %rax    # 0x30cff8
movsd %xmm0, (%rax)
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58b08
movsd %xmm0, -0x40(%rbp)
callq 0x58a30
movss %xmm0, -0x2c(%rbp)
callq 0x58a30
cvtss2sd %xmm0, %xmm0
leaq 0x18b834(%rip), %rax    # 0x223500
movsd %xmm0, (%rax)
callq 0x58a30
cvtss2sd %xmm0, %xmm0
leaq 0x18b808(%rip), %rax    # 0x2234e8
movsd %xmm0, (%rax)
callq 0x58a30
cvtss2sd %xmm0, %xmm0
leaq 0x18b7fc(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
callq 0x58a30
cvtss2sd %xmm0, %xmm0
leaq 0x18b7f0(%rip), %rax    # 0x2234f8
movsd %xmm0, (%rax)
callq 0x58a30
leaq 0x18b7cc(%rip), %rax    # 0x2234e4
orb $0x1f, (%rax)
cvtss2sd %xmm0, %xmm0
leaq 0x18b7e2(%rip), %rax    # 0x223508
cvttsd2si -0x38(%rbp), %rcx
movsd %xmm0, (%rax)
leaq 0x275a19(%rip), %r13    # 0x30d750
movq %rcx, (%r13)
leaq 0x2759fa(%rip), %r14    # 0x30d73c
movl %ecx, (%r14)
leaq 0x2759f4(%rip), %r15    # 0x30d740
movl %ecx, (%r15)
leaq 0x2759ee(%rip), %r12    # 0x30d744
movl %ecx, (%r12)
leaq 0x275287(%rip), %rax    # 0x30cfe8
movsd (%rax), %xmm0
leaq 0x275284(%rip), %rax    # 0x30cff0
movsd (%rax), %xmm1
leaq 0x275281(%rip), %rax    # 0x30cff8
movsd (%rax), %xmm2
callq 0x5c9bb
movsd 0x2d4d10(%rip), %xmm0   # 0x36ca98
leaq 0x275241(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
movsd 0x2d4d05(%rip), %xmm0   # 0x36caa0
leaq 0x275236(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
movsd 0x2d4cfa(%rip), %xmm0   # 0x36caa8
leaq 0x27522b(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
leaq 0x275978(%rip), %rax    # 0x30d738
movw %bx, (%rax)
leaq 0x27597e(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
leaq 0x275555(%rip), %rax    # 0x30d32c
cmpl $0x0, (%rax)
jne 0x97de9
leaq 0x180a61(%rip), %rcx    # 0x218844
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 0x27551f(%rip), %rcx    # 0x30d328
cmpl $0x0, (%rcx)
jne 0x97e1b
leaq 0x180a2f(%rip), %rdx    # 0x218844
movl $0x7d8, (%rdx)          # imm = 0x7D8
movl $0xde, (%rcx)
movl %eax, %eax
divsd 0x711ed(%rip), %xmm1    # 0x109018
movzwl %bx, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x73acb(%rip), %xmm0    # 0x10b908
movq %rax, (%r13)
addsd %xmm1, %xmm0
addsd 0x73a4b(%rip), %xmm0    # 0x10b898
callq 0x5c71d
leaq 0x275664(%rip), %rax    # 0x30d4bd
cmpb $0x3, (%rax)
jne 0x97e90
leaq 0x2758c3(%rip), %rax    # 0x30d728
xorps %xmm1, %xmm1
cvtsi2sdl (%rax), %xmm1
xorpd %xmm0, %xmm0
subsd %xmm1, %xmm0
callq 0x5c7ed
leaq 0x275624(%rip), %rax    # 0x30d4a4
orb $0x1, (%rax)
leaq 0x275542(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
leaq 0x180a39(%rip), %rax    # 0x2188d0
cmpq $0x10000, (%rax)        # imm = 0x10000
je 0x97fe5
leaq 0x1a64ed(%rip), %rax    # 0x23e398
cmpq $0x0, (%rax)
jne 0x97fe5
leaq 0x276424(%rip), %rax    # 0x30e2e0
cmpl $0x0, 0x1e114(%rax)
je 0x97ed2
cmpl $0x0, 0x1e110(%rax)
jg 0x97fe5
leaq 0x2748df(%rip), %rax    # 0x30c7b8
movsd -0x40(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq 0x27534f(%rip), %rax    # 0x30d238
movl $0x1, (%rax)
leaq 0x85eae(%rip), %rcx     # 0x11dda4
leaq 0xc5e33(%rip), %rax     # 0x15dd30
movq %rcx, (%rax)
leaq 0x7f68e(%rip), %rcx     # 0x117595
movq %rcx, 0x8(%rax)
leaq 0x275f4d(%rip), %rcx    # 0x30de5f
cmpb $0x0, (%rcx)
jne 0x97f21
movb $0x1, (%rcx)
movl $0x1, 0x18(%rax)
xorps %xmm0, %xmm0
cvtss2sd -0x2c(%rbp), %xmm0
leaq 0x274890(%rip), %rcx    # 0x30c7c0
movsd %xmm0, (%rcx)
leaq 0x2752f9(%rip), %rcx    # 0x30d234
movl $0x1, (%rcx)
leaq 0x8cb6f(%rip), %rcx     # 0x124ab7
movq %rcx, 0xe8(%rax)
leaq 0x92898(%rip), %rcx     # 0x12a7ee
movq %rcx, 0xf0(%rax)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0xf8(%rax)
leaq 0x275eeb(%rip), %rcx    # 0x30de60
cmpb $0x0, (%rcx)
jne 0x97f87
movl $0x1, 0x100(%rax)
movb $0x1, (%rcx)
cmpl $0x0, 0x1c4(%rax)
jne 0x97f9a
movl $0x1, 0x104(%rax)
leaq 0x275ec7(%rip), %rcx    # 0x30de68
cmpl $0x0, (%rcx)
jne 0x97fe5
cmpl $0x0, 0x480(%rax)
jne 0x97fb9
movl $0x0, 0x3b8(%rax)
cmpl $0x0, 0x568(%rax)
jne 0x97fcc
movl $0x0, 0x4a0(%rax)
cmpl $0x0, 0x650(%rax)
jne 0x97fdf
movl $0x0, 0x588(%rax)
movl $0x1, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x730e8