// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_ss_nav()
void parse_ss_nav()
{
double secs;
int nav_mode;
int sv_count;
int sys_mode;
int et;       // power on hours
int rsvd;     // reserverd
int hrs;

   log_packet_id("Nav data");

   hrs = tsip_byte();
   pri_hours = hours = hrs & 0x1F;
   pri_minutes = minutes = tsip_byte();
   secs = tsip_double();
   pri_seconds = seconds = (int) secs;
   pri_frac = raw_frac = (secs - (double) pri_seconds);

   pri_day = day = tsip_byte();
   pri_month = month = tsip_byte();
   pri_year = year = tsip_word();

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

   speed = tsip_single();
   have_speed = 1;
   heading = tsip_single() * 180.0 / PI;
   have_heading = 1;

   tsip_single();  // north vel
   tsip_single();  // east vel
   tsip_single();  // vertical vel
   tsip_single();  // hfom
   tsip_single();  // vfom

   hdop = ((DATA_SIZE) tsip_word()) / (DATA_SIZE) 10.0;
   vdop = ((DATA_SIZE) tsip_word()) / (DATA_SIZE) 10.0;
   have_dops |= (HDOP | VDOP);

   nav_mode = tsip_byte();
   sv_count = tsip_byte();
   sys_mode = tsip_byte();
   et = tsip_byte();       // power on hours
   rsvd = tsip_byte();     // reserverd

   sat_count = sv_count & 0x0F;

   datum = sv_count & 0x0F;
   datum |= (sys_mode & 0x30);
   datum |= ((sys_mode & 0x80) >> 1);
   have_datum = 1;

   update_gps_screen(8589);  // update screen 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xcd271(%rip), %rdi     # 0x186620
callq 0x7add0
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %ecx
andl $0x1f, %ecx
leaq 0x2b32e4(%rip), %rax    # 0x36c6b0
movl %ecx, (%rax)
leaq 0x2b3313(%rip), %rax    # 0x36c6e8
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %ecx
leaq 0x2b32c6(%rip), %rax    # 0x36c6ac
movl %ecx, (%rax)
leaq 0x2b32f5(%rip), %rax    # 0x36c6e4
movl %ecx, (%rax)
callq 0x7a9d0
movsd %xmm0, -0x8(%rbp)
cvttsd2si -0x8(%rbp), %ecx
leaq 0x2b32a1(%rip), %rax    # 0x36c6a8
movl %ecx, (%rax)
leaq 0x2b32d0(%rip), %rax    # 0x36c6e0
movl %ecx, (%rax)
movsd -0x8(%rbp), %xmm0
cvtsi2sdl (%rax), %xmm1
subsd %xmm1, %xmm0
leaq 0x2b329a(%rip), %rax    # 0x36c6c0
movsd %xmm0, (%rax)
leaq 0x2b32c7(%rip), %rax    # 0x36c6f8
movsd %xmm0, (%rax)
callq 0x7a510
movzbl %al, %ecx
leaq 0x2b3270(%rip), %rax    # 0x36c6b4
movl %ecx, (%rax)
leaq 0x2b329f(%rip), %rax    # 0x36c6ec
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %ecx
leaq 0x2b325a(%rip), %rax    # 0x36c6b8
movl %ecx, (%rax)
leaq 0x2b3289(%rip), %rax    # 0x36c6f0
movl %ecx, (%rax)
callq 0x7a560
movzwl %ax, %ecx
leaq 0x2b3244(%rip), %rax    # 0x36c6bc
movl %ecx, (%rax)
leaq 0x2b3273(%rip), %rax    # 0x36c6f4
movl %ecx, (%rax)
callq 0x7a9d0
leaq 0x2b2d21(%rip), %rax    # 0x36c1b0
movsd %xmm0, (%rax)
callq 0x7a9d0
leaq 0x2b2d19(%rip), %rax    # 0x36c1b8
movsd %xmm0, (%rax)
callq 0x7a860
cvtss2sd %xmm0, %xmm0
leaq 0x2b2d0d(%rip), %rax    # 0x36c1c0
movsd %xmm0, (%rax)
callq 0x7a860
cvtss2sd %xmm0, %xmm0
leaq 0x2b2d39(%rip), %rax    # 0x36c200
movsd %xmm0, (%rax)
leaq 0x2b3046(%rip), %rax    # 0x36c518
movl $0x1, (%rax)
callq 0x7a860
cvtss2sd %xmm0, %xmm0
movsd 0xb5b8f(%rip), %xmm1    # 0x16f078
mulsd %xmm1, %xmm0
movsd 0xb80d3(%rip), %xmm1    # 0x1715c8
divsd %xmm1, %xmm0
leaq 0x2b2d08(%rip), %rax    # 0x36c208
movsd %xmm0, (%rax)
leaq 0x2b3009(%rip), %rax    # 0x36c514
movl $0x1, (%rax)
callq 0x7a860
callq 0x7a860
callq 0x7a860
callq 0x7a860
callq 0x7a860
callq 0x7a560
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xb5b82(%rip), %xmm1    # 0x16f0c0
divsd %xmm1, %xmm0
leaq 0x1c9187(%rip), %rax    # 0x2826d0
movsd %xmm0, (%rax)
callq 0x7a560
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xb5b5f(%rip), %xmm1    # 0x16f0c0
divsd %xmm1, %xmm0
leaq 0x1c916c(%rip), %rax    # 0x2826d8
movsd %xmm0, (%rax)
leaq 0x1c914d(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x6, %ecx
leaq 0x1c9141(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0xc(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x10(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x18(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %ecx
andl $0xf, %ecx
leaq 0x1e4b23(%rip), %rax    # 0x29e0ec
movl %ecx, (%rax)
movl -0x10(%rbp), %ecx
andl $0xf, %ecx
leaq 0x2b39f8(%rip), %rax    # 0x36cfd0
movl %ecx, (%rax)
movl -0x14(%rbp), %ecx
andl $0x30, %ecx
leaq 0x2b39e9(%rip), %rax    # 0x36cfd0
orl (%rax), %ecx
leaq 0x2b39e0(%rip), %rax    # 0x36cfd0
movl %ecx, (%rax)
movl -0x14(%rbp), %ecx
andl $0x80, %ecx
sarl %ecx
leaq 0x2b39cc(%rip), %rax    # 0x36cfd0
orl (%rax), %ecx
leaq 0x2b39c3(%rip), %rax    # 0x36cfd0
movl %ecx, (%rax)
leaq 0x2b39be(%rip), %rax    # 0x36cfd4
movl $0x1, (%rax)
movl $0x218d, %edi           # imm = 0x218D
callq 0x9d790
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)