// File: /workspace/github_cpp_makefile_star2_O2/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 0x8c80c
cmpl $0x8, %ebx
jne 0x8c833
leaq 0x82416(%rip), %rdi     # 0x10ec20
jmp 0x8c83a
leaq 0x823fd(%rip), %rdi     # 0x10ec10
callq 0x520bf
leaq 0x26a9dd(%rip), %rax    # 0x2f71fc
cmpl $0x0, (%rax)
je 0x8c83f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x823f6(%rip), %rdi     # 0x10ec30
callq 0x520bf
leaq 0x1787de(%rip), %rax    # 0x205024
cmpl %ebx, (%rax)
je 0x8c851
movl %ebx, (%rax)
callq 0x43898
pushq $0x1
popq %rdi
callq 0x8bdf5
callq 0x51cf3
cvtsi2sd %eax, %xmm0
divsd 0x667be(%rip), %xmm0    # 0xf3028
leaq 0x26ac6f(%rip), %rax    # 0x2f74e0
movsd %xmm0, (%rax)
leaq 0x26ac9c(%rip), %rax    # 0x2f7518
movsd %xmm0, (%rax)
callq 0x8bd62
callq 0x51cf3
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x667c2(%rip), %xmm0    # 0xf3060
leaq 0x26a77b(%rip), %rax    # 0x2f7020
movsd %xmm0, (%rax)
callq 0x51c63
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
divsd 0x667eb(%rip), %xmm0    # 0xf30a8
leaq 0x26a764(%rip), %rax    # 0x2f7028
movsd %xmm0, (%rax)
leaq 0x26aa69(%rip), %rax    # 0x2f7338
pushq $0x6
popq %rcx
movl %ecx, (%rax)
leaq 0x26aa59(%rip), %rax    # 0x2f7334
movl %ecx, (%rax)
callq 0x51c63
movl %eax, %r14d
callq 0x51c47
movzwl %r14w, %ecx
cvtsi2ss %ecx, %xmm0
divss 0x6a7d6(%rip), %xmm0    # 0xf70d0
cvtss2sd %xmm0, %xmm0
testb %al, %al
jne 0x8c90b
leaq 0x180bdf(%rip), %rax    # 0x20d4e8
jmp 0x8c912
leaq 0x180bde(%rip), %rax    # 0x20d4f0
setne %cl
movzbl %cl, %ecx
incl %ecx
movsd %xmm0, (%rax)
leaq 0x180bbf(%rip), %rax    # 0x20d4e4
movl %ecx, (%rax)
callq 0x51c47
movzbl %al, %eax
leaq 0x19c5d6(%rip), %r14    # 0x228f0c
movl %eax, (%r14)
leaq 0x26a9d8(%rip), %rax    # 0x2f7318
movl $0x5, (%rax)
callq 0x51c47
movzbl %al, %eax
leaq 0x19c5ab(%rip), %rcx    # 0x228f00
movl %eax, (%rcx)
callq 0x56b1c
andl $0x0, (%r14)
xorl %r13d, %r13d
testl %ebx, %ebx
cmovgl %ebx, %r13d
leaq 0x19c640(%rip), %r12    # 0x228fb0
subl $0x1, %r13d
jb 0x8ca65
callq 0x51c47
movl %eax, %r14d
callq 0x51c47
movl %eax, %ebx
callq 0x51c47
movl %eax, %r15d
callq 0x51c47
testb %r14b, %r14b
je 0x8c970
cmpb $0x2, %r15b
jb 0x8c9c4
movzbl %r15b, %eax
cvtsi2sd %eax, %xmm0
callq 0x9160
mulsd 0x69202(%rip), %xmm0    # 0xf5bb8
addsd 0x7bd5a(%rip), %xmm0    # 0x108718
cvtsd2ss %xmm0, %xmm0
jmp 0x8c9cc
movsbl %r15b, %eax
cvtsi2ss %eax, %xmm0
movzbl %r14b, %r14d
movl %r14d, %eax
imulq $0x348, %rax, %rax      # imm = 0x348
movss %xmm0, 0x20(%r12,%rax)
movl $0xc, 0x1c(%r12,%rax)
andl $0x0, 0x1fc(%r12,%rax)
movzbl %bl, %ecx
movl %ecx, 0x18(%r12,%rax)
xorl %edx, %edx
cmpl $0x8, %ecx
sete %dl
leal -0x1(,%rdx,2), %ecx
movl %ecx, 0x218(%r12,%rax)
movl %r14d, %edi
callq 0xca4da
leaq 0x26a92b(%rip), %rcx    # 0x2f734c
orl %eax, (%rcx)
leaq 0x26a912(%rip), %rax    # 0x2f733c
cmpl $0x0, (%rax)
jne 0x8ca3c
leaq 0x175e0e(%rip), %rcx    # 0x202844
movl $0x7fb, (%rcx)          # imm = 0x7FB
movl $0x2, (%rax)
movl %r14d, %edi
callq 0x559ba
leaq 0x19c4bb(%rip), %rax    # 0x228f0c
incl (%rax)
leaq 0x26a8be(%rip), %rax    # 0x2f7318
movl $0x16, (%rax)
jmp 0x8c970
leaq 0x19c4a0(%rip), %rax    # 0x228f0c
movl (%rax), %edi
callq 0x56d93
callq 0x51c47
leaq 0x7f1a3(%rip), %rax     # 0x10bc22
leaq 0x19c472(%rip), %rcx    # 0x228ef8
movq %rax, (%rcx)
leaq 0x26a7bc(%rip), %rax    # 0x2f724c
andl $0x0, (%rax)
leaq 0xbb296(%rip), %rax     # 0x147d30
andl $0x0, 0x2d0(%rax)
xorl %edi, %edi
callq 0x59704
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x694f6