// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x91e2b(%rip), %rdi     # 0x10d281
callq 0x520bf
callq 0x51c47
andb $0x1f, %al
movzbl %al, %eax
leaq 0x27c064(%rip), %rcx    # 0x2f74d0
movl %eax, (%rcx)
leaq 0x27c093(%rip), %rcx    # 0x2f7508
movl %eax, (%rcx)
callq 0x51c47
movzbl %al, %eax
leaq 0x27c046(%rip), %rcx    # 0x2f74cc
movl %eax, (%rcx)
leaq 0x27c075(%rip), %rcx    # 0x2f7504
movl %eax, (%rcx)
callq 0x51e6f
cvttsd2si %xmm0, %eax
leaq 0x27c027(%rip), %rcx    # 0x2f74c8
movl %eax, (%rcx)
leaq 0x27c056(%rip), %rcx    # 0x2f7500
cvttpd2dq %xmm0, %xmm1
movl %eax, (%rcx)
cvtdq2pd %xmm1, %xmm1
subsd %xmm1, %xmm0
leaq 0x27c021(%rip), %rax    # 0x2f74e0
movsd %xmm0, (%rax)
leaq 0x27c04e(%rip), %rax    # 0x2f7518
movsd %xmm0, (%rax)
callq 0x51c47
movzbl %al, %eax
leaq 0x27bff7(%rip), %rcx    # 0x2f74d4
movl %eax, (%rcx)
leaq 0x27c026(%rip), %rcx    # 0x2f750c
movl %eax, (%rcx)
callq 0x51c47
movzbl %al, %eax
leaq 0x27bfe1(%rip), %rcx    # 0x2f74d8
movl %eax, (%rcx)
leaq 0x27c010(%rip), %rcx    # 0x2f7510
movl %eax, (%rcx)
callq 0x51c63
movzwl %ax, %eax
leaq 0x27bfcb(%rip), %rcx    # 0x2f74dc
movl %eax, (%rcx)
leaq 0x27bffa(%rip), %rcx    # 0x2f7514
movl %eax, (%rcx)
callq 0x51e6f
leaq 0x27baa8(%rip), %rax    # 0x2f6fd0
movsd %xmm0, (%rax)
callq 0x51e6f
leaq 0x27baa0(%rip), %rax    # 0x2f6fd8
movsd %xmm0, (%rax)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x27ba94(%rip), %rax    # 0x2f6fe0
movsd %xmm0, (%rax)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
leaq 0x27bac0(%rip), %rax    # 0x2f7020
movsd %xmm0, (%rax)
leaq 0x27bdcd(%rip), %rax    # 0x2f7338
pushq $0x1
popq %r14
movl %r14d, (%rax)
callq 0x51dc3
cvtss2sd %xmm0, %xmm0
mulsd 0x7a325(%rip), %xmm0    # 0xf58a8
divsd 0x7a315(%rip), %xmm0    # 0xf58a0
leaq 0x27ba96(%rip), %rax    # 0x2f7028
movsd %xmm0, (%rax)
leaq 0x27bd97(%rip), %rax    # 0x2f7334
movl %r14d, (%rax)
callq 0x51dc3
callq 0x51dc3
callq 0x51dc3
callq 0x51dc3
callq 0x51dc3
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x77adb(%rip), %xmm0    # 0xf30a8
leaq 0x191f1c(%rip), %rax    # 0x20d4f0
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x77abc(%rip), %xmm0    # 0xf30a8
leaq 0x191f05(%rip), %rax    # 0x20d4f8
movsd %xmm0, (%rax)
leaq 0x191ee6(%rip), %rax    # 0x20d4e4
orb $0x6, (%rax)
callq 0x51c47
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
movzbl %al, %r15d
callq 0x51c47
callq 0x51c47
andb $0xf, %bl
movzbl %bl, %eax
leaq 0x1ad8df(%rip), %rcx    # 0x228f0c
movl %eax, (%rcx)
movl %r15d, %ecx
andl $0x30, %ecx
shrl %r15d
andl $-0x40, %r15d
orl %ecx, %r15d
orl %eax, %r15d
leaq 0x27c7a7(%rip), %rax    # 0x2f7df0
movl %r15d, (%rax)
leaq 0x27c7a1(%rip), %rax    # 0x2f7df4
movl %r14d, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x694f6