// File: /workspace/github_cpp_makefile_star2_O1/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 0x9c1bf(%rip), %rdi     # 0x123259
callq 0x58e77
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x870b5
leaq 0x1b7ebe(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
andl $0x1f, %eax
leaq 0x286411(%rip), %rcx    # 0x30d4d0
movl %eax, (%rcx)
leaq 0x286440(%rip), %rcx    # 0x30d508
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x870e0
leaq 0x1b7e93(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x2863e2(%rip), %rcx    # 0x30d4cc
movl %eax, (%rcx)
leaq 0x286411(%rip), %rcx    # 0x30d504
movl %eax, (%rcx)
callq 0x58b86
cvttsd2si %xmm0, %eax
leaq 0x2863c3(%rip), %rcx    # 0x30d4c8
movl %eax, (%rcx)
leaq 0x2863f2(%rip), %rcx    # 0x30d500
cvttpd2dq %xmm0, %xmm1
movl %eax, (%rcx)
cvtdq2pd %xmm1, %xmm1
subsd %xmm1, %xmm0
leaq 0x2863bd(%rip), %rax    # 0x30d4e0
movsd %xmm0, (%rax)
leaq 0x2863ea(%rip), %rax    # 0x30d518
movsd %xmm0, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87148
leaq 0x1b7e2b(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x286382(%rip), %rcx    # 0x30d4d4
movl %eax, (%rcx)
leaq 0x2863b1(%rip), %rcx    # 0x30d50c
movl %eax, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x87173
leaq 0x1b7e00(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x28635b(%rip), %rcx    # 0x30d4d8
movl %eax, (%rcx)
leaq 0x28638a(%rip), %rcx    # 0x30d510
movl %eax, (%rcx)
callq 0x588f0
movzwl %ax, %eax
leaq 0x286345(%rip), %rcx    # 0x30d4dc
movl %eax, (%rcx)
leaq 0x286374(%rip), %rcx    # 0x30d514
movl %eax, (%rcx)
callq 0x58b86
leaq 0x285e22(%rip), %rax    # 0x30cfd0
movsd %xmm0, (%rax)
callq 0x58b86
leaq 0x285e1a(%rip), %rax    # 0x30cfd8
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x285e0e(%rip), %rax    # 0x30cfe0
movsd %xmm0, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
leaq 0x285e3a(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
leaq 0x286147(%rip), %rax    # 0x30d338
movl $0x1, %ebx
movl %ebx, (%rax)
callq 0x58aae
cvtss2sd %xmm0, %xmm0
mulsd 0x84617(%rip), %xmm0    # 0x10b820
divsd 0x84607(%rip), %xmm0    # 0x10b818
leaq 0x285e10(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
leaq 0x286111(%rip), %rax    # 0x30d334
movl %ebx, (%rax)
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x58aae
callq 0x588f0
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x81e53(%rip), %xmm0    # 0x1090a8
leaq 0x19c294(%rip), %rax    # 0x2234f0
movsd %xmm0, (%rax)
callq 0x588f0
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x81e31(%rip), %xmm0    # 0x1090a8
leaq 0x19c27a(%rip), %rax    # 0x2234f8
movsd %xmm0, (%rax)
leaq 0x19c25b(%rip), %rax    # 0x2234e4
orb $0x6, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x872a2
leaq 0x1b7cd1(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x872ba
leaq 0x1b7cb9(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x872d3
leaq 0x1b7ca0(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x872e9
leaq 0x1b7c8a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x872ff
leaq 0x1b7c74(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
andl $0xf, %ebx
leaq 0x1b7c03(%rip), %rax    # 0x23ef0c
movl %ebx, (%rax)
movl %r14d, %eax
andl $0x30, %eax
shrl %r14d
andl $0x40, %r14d
orl %eax, %r14d
orl %ebx, %r14d
leaq 0x286acb(%rip), %rax    # 0x30ddf0
movl %r14d, (%rax)
leaq 0x286ac5(%rip), %rax    # 0x30ddf4
movl $0x1, (%rax)
popq %rbx
popq %r14
popq %rbp
jmp 0x7327e