// File: /workspace/github_cpp_makefile_star2_O1/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 0x8cece(%rip), %rdi     # 0x1249cc
callq 0x58e77
leaq 0x2a62ea(%rip), %rax    # 0x33ddf4
orb $0x2, (%rax)
leaq 0x2756c4(%rip), %rax    # 0x30d1d8
andb $-0x9, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97b2d
leaq 0x1a7446(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x97b43
leaq 0x1a7430(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x588f0
movl %eax, %ebx
callq 0x58b86
movsd %xmm0, -0x38(%rbp)
callq 0x58b86
leaq 0x275488(%rip), %rax    # 0x30cfe8
movsd %xmm0, (%rax)
callq 0x58b86
leaq 0x275480(%rip), %rax    # 0x30cff0
movsd %xmm0, (%rax)
callq 0x58b86
leaq 0x275478(%rip), %rax    # 0x30cff8
movsd %xmm0, (%rax)
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58b86
movsd %xmm0, -0x40(%rbp)
callq 0x58aae
movss %xmm0, -0x2c(%rbp)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x18b949(%rip), %rax    # 0x223500
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x18b91d(%rip), %rax    # 0x2234e8
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x18b911(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x18b905(%rip), %rax    # 0x2234f8
movsd %xmm0, (%rax)
callq 0x58aae
leaq 0x18b8e1(%rip), %rax    # 0x2234e4
orb $0x1f, (%rax)
cvtss2sd %xmm0, %xmm0
leaq 0x18b8f7(%rip), %rax    # 0x223508
cvttsd2si -0x38(%rbp), %rcx
movsd %xmm0, (%rax)
leaq 0x275b2e(%rip), %r13    # 0x30d750
movq %rcx, (%r13)
leaq 0x275b0f(%rip), %r14    # 0x30d73c
movl %ecx, (%r14)
leaq 0x275b09(%rip), %r15    # 0x30d740
movl %ecx, (%r15)
leaq 0x275b03(%rip), %r12    # 0x30d744
movl %ecx, (%r12)
leaq 0x27539c(%rip), %rax    # 0x30cfe8
movsd (%rax), %xmm0
leaq 0x275399(%rip), %rax    # 0x30cff0
movsd (%rax), %xmm1
leaq 0x275396(%rip), %rax    # 0x30cff8
movsd (%rax), %xmm2
callq 0x5cad5
movsd 0x2d4e25(%rip), %xmm0   # 0x36ca98
leaq 0x275356(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
movsd 0x2d4e1a(%rip), %xmm0   # 0x36caa0
leaq 0x27534b(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
movsd 0x2d4e0f(%rip), %xmm0   # 0x36caa8
leaq 0x275340(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
leaq 0x275a8d(%rip), %rax    # 0x30d738
movw %bx, (%rax)
leaq 0x275a93(%rip), %rax    # 0x30d748
movl $0x0, (%rax)
leaq 0x27566a(%rip), %rax    # 0x30d32c
cmpl $0x0, (%rax)
jne 0x97cd4
leaq 0x180b76(%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 0x275634(%rip), %rcx    # 0x30d328
cmpl $0x0, (%rcx)
jne 0x97d06
leaq 0x180b44(%rip), %rdx    # 0x218844
movl $0x7d8, (%rdx)          # imm = 0x7D8
movl $0xde, (%rcx)
movl %eax, %eax
divsd 0x71302(%rip), %xmm1    # 0x109018
movzwl %bx, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd 0x73bd8(%rip), %xmm0    # 0x10b900
movq %rax, (%r13)
addsd %xmm1, %xmm0
addsd 0x73b50(%rip), %xmm0    # 0x10b888
callq 0x5c837
leaq 0x275779(%rip), %rax    # 0x30d4bd
cmpb $0x3, (%rax)
jne 0x97d7b
leaq 0x2759d8(%rip), %rax    # 0x30d728
xorps %xmm1, %xmm1
cvtsi2sdl (%rax), %xmm1
xorpd %xmm0, %xmm0
subsd %xmm1, %xmm0
callq 0x5c907
leaq 0x275739(%rip), %rax    # 0x30d4a4
orb $0x1, (%rax)
leaq 0x275657(%rip), %rax    # 0x30d3cc
movl $0x1, (%rax)
leaq 0x180b4e(%rip), %rax    # 0x2188d0
cmpq $0x10000, (%rax)        # imm = 0x10000
je 0x97ed0
leaq 0x1a6602(%rip), %rax    # 0x23e398
cmpq $0x0, (%rax)
jne 0x97ed0
leaq 0x276539(%rip), %rax    # 0x30e2e0
cmpl $0x0, 0x1e114(%rax)
je 0x97dbd
cmpl $0x0, 0x1e110(%rax)
jg 0x97ed0
leaq 0x2749f4(%rip), %rax    # 0x30c7b8
movsd -0x40(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq 0x275464(%rip), %rax    # 0x30d238
movl $0x1, (%rax)
leaq 0x85f2f(%rip), %rcx     # 0x11dd10
leaq 0xc5f48(%rip), %rax     # 0x15dd30
movq %rcx, (%rax)
leaq 0x7f70f(%rip), %rcx     # 0x117501
movq %rcx, 0x8(%rax)
leaq 0x276062(%rip), %rcx    # 0x30de5f
cmpb $0x0, (%rcx)
jne 0x97e0c
movb $0x1, (%rcx)
movl $0x1, 0x18(%rax)
xorps %xmm0, %xmm0
cvtss2sd -0x2c(%rbp), %xmm0
leaq 0x2749a5(%rip), %rcx    # 0x30c7c0
movsd %xmm0, (%rcx)
leaq 0x27540e(%rip), %rcx    # 0x30d234
movl $0x1, (%rcx)
leaq 0x8cba4(%rip), %rcx     # 0x1249d7
movq %rcx, 0xe8(%rax)
leaq 0x928e2(%rip), %rcx     # 0x12a723
movq %rcx, 0xf0(%rax)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0xf8(%rax)
leaq 0x276000(%rip), %rcx    # 0x30de60
cmpb $0x0, (%rcx)
jne 0x97e72
movl $0x1, 0x100(%rax)
movb $0x1, (%rcx)
cmpl $0x0, 0x1c4(%rax)
jne 0x97e85
movl $0x1, 0x104(%rax)
leaq 0x275fdc(%rip), %rcx    # 0x30de68
cmpl $0x0, (%rcx)
jne 0x97ed0
cmpl $0x0, 0x480(%rax)
jne 0x97ea4
movl $0x0, 0x3b8(%rax)
cmpl $0x0, 0x568(%rax)
jne 0x97eb7
movl $0x0, 0x4a0(%rax)
cmpl $0x0, 0x650(%rax)
jne 0x97eca
movl $0x0, 0x588(%rax)
movl $0x1, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7327e