// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Ea(int)
void parse_moto_Ea(int num_chans)
{
int i;
int prn;
int mode;
int sig;
int s1;
int s2;
int dop;
S32 frac;

   if(num_chans == 6)      log_packet_id("6-chan sat info");
   else if(num_chans == 8) log_packet_id("8-chan sat info");
   else                    log_packet_id("unkn-chans sat info");

   if((num_chans == 6) && have_moto_Ea) return;

   if(num_chans != moto_chans) {
      moto_chans = num_chans;
      config_msg_ofs();
   }

   get_moto_time(1);   //+0
   frac = (S32) tsip_dword();    //+7 !!!! fractional time in nsec 
   pri_frac = raw_frac = ((double) frac) / 1.0E9;

   get_moto_lla();     //+11
   tsip_dword();       //+23 msl altitude

   speed = ((double) tsip_word()) / 100.0;   //+27 3d speed
   heading = ((double) tsip_word() / 10.0);  //+29 heading

   have_speed = 6;
   have_heading = 6;

   dop = tsip_word();  //+30
   i = tsip_byte();    //+32

   have_dops = 0;
   if(i) {
      hdop = ((float) dop) / 10.0F;
      have_dops |= HDOP;
   }
   else {
      pdop = ((float) dop) / 10.0F;
      have_dops |= PDOP;
   }

   sat_count = tsip_byte();    //+33 visible
   have_count = 5;
   track_count = tsip_byte();  //+34 tracked

   reset_sat_tracking();

   sat_count = 0;
   for(i=0; i<num_chans; i++) {  //+35
      prn = tsip_byte();
      mode = tsip_byte();
      sig = tsip_byte();
      s1 = tsip_byte();
      if((prn >= 1) && (prn <= MAX_PRN)) { 
         if(sig >= 2) sat[prn].sig_level = (float) (20.0*log10((double) sig)+6.00);
         else         sat[prn].sig_level = ((float) sig);
         sat[prn].level_msg = 12;
         sat[prn].sv_accuracy = 0.0F;
         sat[prn].state= mode;
         if(mode == 8) sat[prn].tracking = 1;
         else          sat[prn].tracking = (-1);

         have_snr |= rinex_gnss(prn);
         if(have_state == 0) need_redraw = 2043;
         have_state = MOTO_STATE;   // STATE

         record_sig_levels(prn);
         ++sat_count;
         have_count = 22;
      }
   }
   config_sat_count(sat_count);

   s2 = tsip_byte();

   level_type = "dBc";

   have_temperature = 0;
   plot[TEMP].show_plot = 0;

   request_moto_leap(0);
   update_gps_screen(1003);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
cmpl $0x8, %edi
leaq 0x89da1(%rip), %rax     # 0x124bf8
leaq 0x89daa(%rip), %rcx     # 0x124c08
cmoveq %rax, %rcx
cmpl $0x6, %edi
leaq 0x89d7c(%rip), %rdi     # 0x124be8
cmovneq %rcx, %rdi
callq 0x58e77
cmpl $0x6, %ebx
jne 0x9ae95
leaq 0x27237b(%rip), %rax    # 0x30d1fc
cmpl $0x0, (%rax)
je 0x9ae95
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x180188(%rip), %rax    # 0x21b024
cmpl %ebx, (%rax)
je 0x9aea7
movl %ebx, (%rax)
callq 0x47650
movl $0x1, %edi
callq 0x9a094
callq 0x589b0
cvtsi2sd %eax, %xmm0
divsd 0x6e166(%rip), %xmm0    # 0x109028
leaq 0x272617(%rip), %rax    # 0x30d4e0
movsd %xmm0, (%rax)
leaq 0x272644(%rip), %rax    # 0x30d518
movsd %xmm0, (%rax)
callq 0x99ffb
callq 0x589b0
callq 0x588f0
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6e167(%rip), %xmm0    # 0x109060
leaq 0x272120(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
callq 0x588f0
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6e18d(%rip), %xmm0    # 0x1090a8
leaq 0x272106(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
leaq 0x27240b(%rip), %rax    # 0x30d338
movl $0x6, %ecx
movl %ecx, (%rax)
leaq 0x2723f9(%rip), %rax    # 0x30d334
movl %ecx, (%rax)
callq 0x588f0
movl %eax, %r14d
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9af5b
leaq 0x1a4018(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
leaq 0x188582(%rip), %rcx    # 0x2234e4
movl $0x0, (%rcx)
movzwl %r14w, %edx
xorps %xmm0, %xmm0
cvtsi2ss %edx, %xmm0
divss 0x72065(%rip), %xmm0    # 0x10cfe0
cvtss2sd %xmm0, %xmm0
testb %al, %al
jne 0x9af8c
leaq 0x18855e(%rip), %rax    # 0x2234e8
jmp 0x9af93
leaq 0x18855d(%rip), %rax    # 0x2234f0
setne %dl
movzbl %dl, %edx
incl %edx
movsd %xmm0, (%rax)
movl %edx, (%rcx)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9afb7
leaq 0x1a3fbc(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x1a3f4b(%rip), %rcx    # 0x23ef0c
movl %eax, (%rcx)
leaq 0x27234e(%rip), %rax    # 0x30d318
movl $0x5, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9afe6
leaq 0x1a3f8d(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x1a3f10(%rip), %rcx    # 0x23ef00
movl %eax, (%rcx)
movl $0x218, %eax            # imm = 0x218
leaq 0x1a3fb2(%rip), %r13    # 0x23efb0
xorl %ecx, %ecx
movl %ecx, (%r13,%rax)
movl %ecx, -0x1fc(%r13,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd358, %rax          # imm = 0xCD358
jne 0x9b000
leaq 0x1a3eea(%rip), %rax    # 0x23ef0c
movl $0x0, (%rax)
testl %ebx, %ebx
jle 0x9b16f
callq 0x587d1
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b049
leaq 0x1a3f2a(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b062
leaq 0x1a3f11(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
movl %eax, %r12d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b07b
leaq 0x1a3ef8(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b091
leaq 0x1a3ee2(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
testb %r14b, %r14b
je 0x9b167
movzbl %r12b, %eax
cmpb $0x2, %r12b
jb 0x9b0c6
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x9160
mulsd 0x70a80(%rip), %xmm0    # 0x10bb38
addsd 0x83630(%rip), %xmm0    # 0x11e6f0
cvtsd2ss %xmm0, %xmm0
jmp 0x9b0cd
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movzbl %r14b, %r12d
movzbl %r15b, %eax
movzbl %r14b, %ecx
imulq $0x348, %rcx, %rcx      # imm = 0x348
movss %xmm0, 0x20(%r13,%rcx)
movl $0xc, 0x1c(%r13,%rcx)
movl $0x0, 0x1fc(%r13,%rcx)
movl %eax, 0x18(%r13,%rcx)
xorl %eax, %eax
cmpb $0x8, %r15b
sete %al
leal -0x1(,%rax,2), %eax
movl %eax, 0x218(%r13,%rcx)
movl %r12d, %edi
callq 0xdbb74
leaq 0x272224(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
leaq 0x27220b(%rip), %rax    # 0x30d33c
cmpl $0x0, (%rax)
jne 0x9b143
leaq 0x17d707(%rip), %rcx    # 0x218844
movl $0x7fb, (%rcx)          # imm = 0x7FB
movl $0x2, (%rax)
movl %r12d, %edi
callq 0x5ced3
leaq 0x1a3db4(%rip), %rax    # 0x23ef0c
incl (%rax)
leaq 0x2721b7(%rip), %rax    # 0x30d318
movl $0x16, (%rax)
decl %ebx
jne 0x9b030
leaq 0x1a3d96(%rip), %rax    # 0x23ef0c
movl (%rax), %edi
callq 0x5e411
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b193
leaq 0x1a3de0(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
leaq 0x86a60(%rip), %rax     # 0x121bfa
leaq 0x1a3d57(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
leaq 0x2720a1(%rip), %rax    # 0x30d24c
xorl %ecx, %ecx
movl %ecx, (%rax)
leaq 0xc2b7a(%rip), %rax     # 0x15dd30
movl %ecx, 0x2d0(%rax)
xorl %edi, %edi
callq 0x61330
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7327e