// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
leaq 0x9c32b(%rip), %rdi     # 0x123339
callq 0x58dc2
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87029
leaq 0x1b7f4a(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
andl $0x1f, %eax
leaq 0x28649d(%rip), %rcx    # 0x30d4d0
movl %eax, (%rcx)
leaq 0x2864cc(%rip), %rcx    # 0x30d508
movl %eax, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87054
leaq 0x1b7f1f(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x28646e(%rip), %rcx    # 0x30d4cc
movl %eax, (%rcx)
leaq 0x28649d(%rip), %rcx    # 0x30d504
movl %eax, (%rcx)
callq 0x58b08
cvttsd2si %xmm0, %eax
leaq 0x28644f(%rip), %rcx    # 0x30d4c8
movl %eax, (%rcx)
leaq 0x28647e(%rip), %rcx    # 0x30d500
cvttpd2dq %xmm0, %xmm1
movl %eax, (%rcx)
cvtdq2pd %xmm1, %xmm1
subsd %xmm1, %xmm0
leaq 0x286449(%rip), %rax    # 0x30d4e0
movsd %xmm0, (%rax)
leaq 0x286476(%rip), %rax    # 0x30d518
movsd %xmm0, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x870bc
leaq 0x1b7eb7(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x28640e(%rip), %rcx    # 0x30d4d4
movl %eax, (%rcx)
leaq 0x28643d(%rip), %rcx    # 0x30d50c
movl %eax, (%rcx)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x870e7
leaq 0x1b7e8c(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x2863e7(%rip), %rcx    # 0x30d4d8
movl %eax, (%rcx)
leaq 0x286416(%rip), %rcx    # 0x30d510
movl %eax, (%rcx)
callq 0x588d2
movzwl %ax, %eax
leaq 0x2863d1(%rip), %rcx    # 0x30d4dc
movl %eax, (%rcx)
leaq 0x286400(%rip), %rcx    # 0x30d514
movl %eax, (%rcx)
callq 0x58b08
leaq 0x285eae(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
callq 0x58b08
leaq 0x285ea6(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
callq 0x58a30
cvtss2sd %xmm0, %xmm0
leaq 0x285e9a(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
callq 0x58a30
cvtss2sd %xmm0, %xmm0
leaq 0x285ec6(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
leaq 0x2861d3(%rip), %rax    # 0x30d338
movl $0x1, %ebx
movl %ebx, (%rax)
callq 0x58a30
cvtss2sd %xmm0, %xmm0
mulsd 0x846b3(%rip), %xmm0    # 0x10b830
divsd 0x846a3(%rip), %xmm0    # 0x10b828
leaq 0x285e9c(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
leaq 0x28619d(%rip), %rax    # 0x30d334
movl %ebx, (%rax)
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x58a30
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x81edf(%rip), %xmm0    # 0x1090a8
leaq 0x19c320(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x81ebd(%rip), %xmm0    # 0x1090a8
leaq 0x19c306(%rip), %rax    # 0x2234f8
movsd %xmm0, (%rax)
leaq 0x19c2e7(%rip), %rax    # 0x2234e4
orb $0x6, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87216
leaq 0x1b7d5d(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x8722e
leaq 0x1b7d45(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x87247
leaq 0x1b7d2c(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x8725d
leaq 0x1b7d16(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x87273
leaq 0x1b7d00(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
andl $0xf, %ebx
leaq 0x1b7c8f(%rip), %rax    # 0x23ef0c
movl %ebx, (%rax)
movl %r14d, %eax
andl $0x30, %eax
shrl %r14d
andl $0x40, %r14d
orl %eax, %r14d
orl %ebx, %r14d
leaq 0x286b57(%rip), %rax    # 0x30ddf0
movl %r14d, (%rax)
leaq 0x286b51(%rip), %rax    # 0x30ddf4
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
jmp 0x730e8