// File: 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
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x6, -0x4(%rbp)
jne 0xd2b9f
leaq 0xb541c(%rip), %rdi     # 0x187fb4
callq 0x7add0
jmp 0xd2bc1
cmpl $0x8, -0x4(%rbp)
jne 0xd2bb3
leaq 0xb5418(%rip), %rdi     # 0x187fc4
callq 0x7add0
jmp 0xd2bbf
leaq 0xb541a(%rip), %rdi     # 0x187fd4
callq 0x7add0
jmp 0xd2bc1
cmpl $0x6, -0x4(%rbp)
jne 0xd2bd8
leaq 0x29980e(%rip), %rax    # 0x36c3dc
cmpl $0x0, (%rax)
je 0xd2bd8
jmp 0xd2f9f
movl -0x4(%rbp), %eax
leaq 0x1a7622(%rip), %rcx    # 0x27a204
cmpl (%rcx), %eax
je 0xd2bf7
movl -0x4(%rbp), %ecx
leaq 0x1a7614(%rip), %rax    # 0x27a204
movl %ecx, (%rax)
callq 0x63c20
movl $0x1, %edi
callq 0xd1ba0
callq 0x7a680
movl %eax, -0x24(%rbp)
cvtsi2sdl -0x24(%rbp), %xmm0
movsd 0x9c412(%rip), %xmm1    # 0x16f028
divsd %xmm1, %xmm0
leaq 0x299a9f(%rip), %rax    # 0x36c6c0
movsd %xmm0, (%rax)
leaq 0x299acc(%rip), %rax    # 0x36c6f8
movsd %xmm0, (%rax)
callq 0xd1ac0
callq 0x7a680
callq 0x7a560
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
movsd 0x9c402(%rip), %xmm1    # 0x16f050
divsd %xmm1, %xmm0
leaq 0x2995a7(%rip), %rax    # 0x36c200
movsd %xmm0, (%rax)
callq 0x7a560
movzwl %ax, %eax
cvtsi2sd %eax, %xmm0
movsd 0x9c44f(%rip), %xmm1    # 0x16f0c0
divsd %xmm1, %xmm0
leaq 0x29958c(%rip), %rax    # 0x36c208
movsd %xmm0, (%rax)
leaq 0x299891(%rip), %rax    # 0x36c518
movl $0x6, (%rax)
leaq 0x299880(%rip), %rax    # 0x36c514
movl $0x6, (%rax)
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x20(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x8(%rbp)
leaq 0x1afa0d(%rip), %rax    # 0x2826c4
movl $0x0, (%rax)
cmpl $0x0, -0x8(%rbp)
je 0xd2cfa
cvtsi2ssl -0x20(%rbp), %xmm0
movss 0xb0650(%rip), %xmm1    # 0x183320
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1af9f1(%rip), %rax    # 0x2826d0
movsd %xmm0, (%rax)
leaq 0x1af9da(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x2, %ecx
leaq 0x1af9ce(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
jmp 0xd2d2f
cvtsi2ssl -0x20(%rbp), %xmm0
movss 0xb0619(%rip), %xmm1    # 0x183320
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1af9b2(%rip), %rax    # 0x2826c8
movsd %xmm0, (%rax)
leaq 0x1af9a3(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x1, %ecx
leaq 0x1af997(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
callq 0x7a510
movzbl %al, %ecx
leaq 0x1cb3ae(%rip), %rax    # 0x29e0ec
movl %ecx, (%rax)
leaq 0x2997b1(%rip), %rax    # 0x36c4f8
movl $0x5, (%rax)
callq 0x7a510
movzbl %al, %ecx
leaq 0x1cb384(%rip), %rax    # 0x29e0e0
movl %ecx, (%rax)
callq 0x81c10
leaq 0x1cb382(%rip), %rax    # 0x29e0ec
movl $0x0, (%rax)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0xd2f46
callq 0x7a510
movzbl %al, %eax
movl %eax, -0xc(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x10(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x14(%rbp)
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x18(%rbp)
cmpl $0x1, -0xc(%rbp)
jl 0xd2f36
cmpl $0x3e7, -0xc(%rbp)      # imm = 0x3E7
jg 0xd2f36
cmpl $0x2, -0x14(%rbp)
jl 0xd2e0e
cvtsi2sdl -0x14(%rbp), %xmm0
callq 0x9160
movsd 0x9c2ea(%rip), %xmm1    # 0x16f0c8
mulsd %xmm1, %xmm0
movsd 0xb0286(%rip), %xmm1    # 0x183070
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x1cb393(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20(%rax)
jmp 0xd2e2d
cvtsi2ssl -0x14(%rbp), %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x1cb372(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20(%rax)
movslq -0xc(%rbp), %rcx
leaq 0x1cb358(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xc, 0x1c(%rax)
movslq -0xc(%rbp), %rcx
leaq 0x1cb33c(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1fc(%rax)
movl -0x10(%rbp), %ecx
movslq -0xc(%rbp), %rdx
leaq 0x1cb319(%rip), %rax    # 0x29e190
imulq $0x348, %rdx, %rdx      # imm = 0x348
addq %rdx, %rax
movl %ecx, 0x18(%rax)
cmpl $0x8, -0x10(%rbp)
jne 0xd2eab
movslq -0xc(%rbp), %rcx
leaq 0x1cb2fb(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x1, 0x218(%rax)
jmp 0xd2eca
movslq -0xc(%rbp), %rcx
leaq 0x1cb2da(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xffffffff, 0x218(%rax) # imm = 0xFFFFFFFF
movl -0xc(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x299651(%rip), %rax    # 0x36c52c
orl (%rax), %ecx
leaq 0x299648(%rip), %rax    # 0x36c52c
movl %ecx, (%rax)
leaq 0x29962f(%rip), %rax    # 0x36c51c
cmpl $0x0, (%rax)
jne 0xd2eff
leaq 0x1a4b2b(%rip), %rax    # 0x277a24
movl $0x7fb, (%rax)          # imm = 0x7FB
leaq 0x299616(%rip), %rax    # 0x36c51c
movl $0x2, (%rax)
movl -0xc(%rbp), %edi
callq 0x80340
leaq 0x1cb1d1(%rip), %rax    # 0x29e0ec
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x1cb1c5(%rip), %rax    # 0x29e0ec
movl %ecx, (%rax)
leaq 0x2995c8(%rip), %rax    # 0x36c4f8
movl $0x16, (%rax)
jmp 0xd2f38
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xd2d77
leaq 0x1cb19f(%rip), %rax    # 0x29e0ec
movl (%rax), %edi
callq 0x82080
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x1c(%rbp)
leaq 0x1cb172(%rip), %rax    # 0x29e0d8
leaq 0xb1ffd(%rip), %rcx     # 0x184f6a
movq %rcx, (%rax)
leaq 0x2994b5(%rip), %rax    # 0x36c42c
movl $0x0, (%rax)
leaq 0xe9d9c(%rip), %rax     # 0x1bcd20
movl $0x0, 0x2d0(%rax)
xorl %edi, %edi
callq 0x85cb0
movl $0x3eb, %edi            # imm = 0x3EB
callq 0x9d790
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)