// File: /workspace/github_cpp_makefile_star2_O3/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 $0x6, %edi
je 0x9b01b
cmpl $0x8, %ebx
jne 0x9b042
leaq 0x89cbf(%rip), %rdi     # 0x124cd8
jmp 0x9b049
leaq 0x89ca6(%rip), %rdi     # 0x124cc8
callq 0x58dc2
leaq 0x2721ce(%rip), %rax    # 0x30d1fc
cmpl $0x0, (%rax)
je 0x9b04e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x89c9f(%rip), %rdi     # 0x124ce8
callq 0x58dc2
leaq 0x17ffcf(%rip), %rax    # 0x21b024
cmpl %ebx, (%rax)
je 0x9b060
movl %ebx, (%rax)
callq 0x4771f
movl $0x1, %edi
callq 0x9a242
callq 0x58964
cvtsi2sd %eax, %xmm0
divsd 0x6dfad(%rip), %xmm0    # 0x109028
leaq 0x27245e(%rip), %rax    # 0x30d4e0
movsd %xmm0, (%rax)
leaq 0x27248b(%rip), %rax    # 0x30d518
movsd %xmm0, (%rax)
callq 0x9a1a9
callq 0x58964
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6dfae(%rip), %xmm0    # 0x109060
leaq 0x271f67(%rip), %rax    # 0x30d020
movsd %xmm0, (%rax)
callq 0x588d2
movzwl %ax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd 0x6dfd4(%rip), %xmm0    # 0x1090a8
leaq 0x271f4d(%rip), %rax    # 0x30d028
movsd %xmm0, (%rax)
leaq 0x272252(%rip), %rax    # 0x30d338
movl $0x6, %ecx
movl %ecx, (%rax)
leaq 0x272240(%rip), %rax    # 0x30d334
movl %ecx, (%rax)
callq 0x588d2
movl %eax, %r14d
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b114
leaq 0x1a3e5f(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzwl %r14w, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
divss 0x71f29(%rip), %xmm0    # 0x10d050
cvtss2sd %xmm0, %xmm0
testb %al, %al
jne 0x9b138
leaq 0x1883b2(%rip), %rax    # 0x2234e8
jmp 0x9b13f
leaq 0x1883b1(%rip), %rax    # 0x2234f0
setne %cl
movzbl %cl, %ecx
incl %ecx
movsd %xmm0, (%rax)
leaq 0x188392(%rip), %rax    # 0x2234e4
movl %ecx, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b16a
leaq 0x1a3e09(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x1a3d98(%rip), %rcx    # 0x23ef0c
movl %eax, (%rcx)
leaq 0x27219b(%rip), %rax    # 0x30d318
movl $0x5, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b199
leaq 0x1a3dda(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %eax
leaq 0x1a3d5d(%rip), %rcx    # 0x23ef00
movl %eax, (%rcx)
movl $0x218, %eax            # imm = 0x218
leaq 0x1a3dff(%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 0x9b1b3
leaq 0x1a3d37(%rip), %rax    # 0x23ef0c
movl $0x0, (%rax)
testl %ebx, %ebx
jle 0x9b32f
callq 0x587be
movl %eax, %r14d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b1fc
leaq 0x1a3d77(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %r15d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b215
leaq 0x1a3d5e(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
movl %eax, %r12d
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b22e
leaq 0x1a3d45(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b244
leaq 0x1a3d2f(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
movzbl %r14b, %r14d
testl %r14d, %r14d
je 0x9b31c
cmpb $0x2, %r12b
jb 0x9b27d
movzbl %r12b, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
callq 0x9160
mulsd 0x708d1(%rip), %xmm0    # 0x10bb40
addsd 0x83529(%rip), %xmm0    # 0x11e7a0
cvtsd2ss %xmm0, %xmm0
jmp 0x9b288
movsbl %r12b, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movzbl %r15b, %eax
movl %r14d, %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 %edx, %edx
cmpl $0x8, %eax
sete %dl
leal -0x1(,%rdx,2), %eax
movl %eax, 0x218(%r13,%rcx)
movl %r14d, %edi
callq 0xdc1dd
leaq 0x27206f(%rip), %rcx    # 0x30d34c
orl %eax, (%rcx)
leaq 0x272056(%rip), %rax    # 0x30d33c
cmpl $0x0, (%rax)
jne 0x9b2f8
leaq 0x17d552(%rip), %rcx    # 0x218844
movl $0x7fb, (%rcx)          # imm = 0x7FB
movl $0x2, (%rax)
movl %r14d, %edi
callq 0x5cdab
leaq 0x1a3bff(%rip), %rax    # 0x23ef0c
incl (%rax)
leaq 0x272002(%rip), %rax    # 0x30d318
movl $0x16, (%rax)
decl %ebx
jne 0x9b1e3
leaq 0x1a3be1(%rip), %rax    # 0x23ef0c
movl (%rax), %edi
jmp 0x9b331
xorl %edi, %edi
callq 0x5e390
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x9b34c
leaq 0x1a3c27(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
leaq 0x86987(%rip), %rax     # 0x121cda
leaq 0x1a3b9e(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
leaq 0x271ee8(%rip), %rax    # 0x30d24c
xorl %ecx, %ecx
movl %ecx, (%rax)
leaq 0xc29c1(%rip), %rax     # 0x15dd30
movl %ecx, 0x2d0(%rax)
xorl %edi, %edi
callq 0x612dc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x730e8