// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_nvs_pvt()
void parse_nvs_pvt()
{
u08 status;
double msecs;
int week;
double lat_speed;
double lon_speed;
double alt_speed;
double gen_dev;
double jd;

   // 0x88 packet
   log_packet_id("nvs_pvt");

   lat = tsip_double();
   lon = tsip_double();
   alt = tsip_double();

   tsip_single(); // RMS posn err
   msecs = tsip_fp80();       // time stamp msecs
   week = tsip_word();        // gps week
   lat_speed = tsip_double(); // lat speed
   lon_speed = tsip_double(); // lon speed
   alt_speed = tsip_double(); // alt speed
   gen_dev = (double) tsip_single(); // ref gen deviation (msecs/sec)
   status = tsip_byte();  // !!!! has 2D flag qqqqqq

   pps_offset = gen_dev * 1.0E6; 
   have_pps_offset = 2;
   have_rcvr_pps = 2;
   faked_tow = 0;
//adadad   if(jitter_adev == 0) do_pps_adev(pps_offset);

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

   pri_tow = tow = this_tow = (int) (msecs / 1000.0);
   if(have_tow == 0) need_redraw = 2008;
   have_tow = 222;
   survey_tow = tow;


   jd = msecs / 1000.0;
   
   jd /= (24.0*60.0*60.0);
   jd += jdate(1999,8,22);
   jd += (week * 7.0);

   set_gregorian_time(jd);

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

   update_gps_screen(1222); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq 0x76d62(%rip), %rdi     # 0x10ff33
callq 0x520bf
callq 0x51e6f
leaq 0x25ddee(%rip), %rax    # 0x2f6fd0
movsd %xmm0, (%rax)
callq 0x51e6f
leaq 0x25dde6(%rip), %rax    # 0x2f6fd8
movsd %xmm0, (%rax)
callq 0x51e6f
leaq 0x25ddde(%rip), %rax    # 0x2f6fe0
movsd %xmm0, (%rax)
callq 0x51dc3
callq 0x51ed6
movsd %xmm0, -0x10(%rbp)
callq 0x51c63
movl %eax, %ebx
callq 0x51e6f
callq 0x51e6f
callq 0x51e6f
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
callq 0x51c47
movsd -0x18(%rbp), %xmm0
mulsd 0x59e05(%rip), %xmm0    # 0xf3050
leaq 0x25d566(%rip), %rax    # 0x2f67b8
movsd %xmm0, (%rax)
leaq 0x25dfdb(%rip), %rax    # 0x2f7238
pushq $0x2
popq %rcx
movl %ecx, (%rax)
leaq 0x25dfdb(%rip), %rax    # 0x2f7244
movl %ecx, (%rax)
leaq 0x25e4d6(%rip), %rax    # 0x2f7748
andl $0x0, (%rax)
movzwl %bx, %ebx
movl %ebx, %edi
callq 0x99169
leaq 0x25e4b2(%rip), %rcx    # 0x2f7738
movw %ax, (%rcx)
leaq 0x25e09c(%rip), %rax    # 0x2f732c
cmpl $0x0, (%rax)
jne 0x992a2
leaq 0x1695a8(%rip), %rcx    # 0x202844
movl $0x7d7, (%rcx)          # imm = 0x7D7
movsd -0x10(%rbp), %xmm0
divsd 0x59d89(%rip), %xmm0    # 0xf3038
movl $0xde, (%rax)
cvttsd2si %xmm0, %eax
leaq 0x25e480(%rip), %rcx    # 0x2f7740
movl %eax, (%rcx)
leaq 0x25e473(%rip), %rcx    # 0x2f773c
movl %eax, (%rcx)
leaq 0x25e472(%rip), %rcx    # 0x2f7744
movl %eax, (%rcx)
leaq 0x25e04d(%rip), %rcx    # 0x2f7328
cmpl $0x0, (%rcx)
jne 0x992ed
leaq 0x16955d(%rip), %rdx    # 0x202844
movl $0x7d8, (%rdx)          # imm = 0x7D8
movl $0xde, (%rcx)
movl %eax, %eax
leaq 0x25e454(%rip), %rcx    # 0x2f7750
movq %rax, (%rcx)
divsd 0x59d11(%rip), %xmm0    # 0xf3018
movsd %xmm0, -0x10(%rbp)
pushq $0x8
popq %rsi
pushq $0x16
popq %rdx
movl $0x7cf, %edi            # imm = 0x7CF
callq 0xc2f07
cvtsi2sd %ebx, %xmm1
addsd -0x10(%rbp), %xmm0
mulsd 0x5c653(%rip), %xmm1    # 0xf5980
addsd %xmm1, %xmm0
callq 0x55392
leaq 0x25e180(%rip), %rax    # 0x2f74bd
cmpb $0x0, (%rax)
jne 0x99347
callq 0x554d3
addq $0x18, %rsp
popq %rbx
popq %rbp
jmp 0x694f6