// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Ek(int)
void parse_moto_Ek(int num_chans)
{
u16 dop;
int i;
int bias;
int osc;

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

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

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

   have_dops = 0;
   dop = tsip_word();
   gdop = ((float) dop) / 10.0F;
   dop = tsip_word();
   pdop = ((float) dop) / 10.0F;
   dop = tsip_word();
   hdop = ((float) dop) / 10.0F;
   dop = tsip_word();
   vdop = ((float) dop) / 10.0F;
   dop = tsip_word();
   tdop = ((float) dop) / 10.0F;
   have_dops |= (GDOP | PDOP | HDOP | VDOP | TDOP);

   tsip_word();  // mag variation
   tsip_word();  // north velocity
   tsip_word();  // east velocity
   tsip_word();  // up velocity

   tsip_word();  // differential age
   tsip_dword(); // ecef coords
   tsip_dword();
   tsip_dword();   

   for(i=0; i<num_chans; i++) {
      tsip_byte();  // r
   }

   for(i=0; i<10; i++) {
      tsip_word();  // a1 elements
   }

   bias = (int) (s16) tsip_word();  // clock bias
   osc_offset = bias;  // !!!! zzzzz
   have_osc_offset = 5;
   have_rcvr_osc = 5;
//adadad   if(jitter_adev == 0) do_osc_adev(osc_offset);
   osc = tsip_word();  // osc offset
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x6, -0x4(%rbp)
jne 0xd33df
leaq 0xb4cad(%rip), %rdi     # 0x188085
callq 0x7add0
jmp 0xd3401
cmpl $0x8, -0x4(%rbp)
jne 0xd33f3
leaq 0xb4cae(%rip), %rdi     # 0x18809a
callq 0x7add0
jmp 0xd33ff
leaq 0xb4cb5(%rip), %rdi     # 0x1880af
callq 0x7add0
jmp 0xd3401
cmpl $0x6, -0x4(%rbp)
jne 0xd3418
leaq 0x298fde(%rip), %rax    # 0x36c3ec
cmpl $0x0, (%rax)
je 0xd3418
jmp 0xd35d3
movl -0x4(%rbp), %eax
leaq 0x1a6de2(%rip), %rcx    # 0x27a204
cmpl (%rcx), %eax
je 0xd3437
movl -0x4(%rbp), %ecx
leaq 0x1a6dd4(%rip), %rax    # 0x27a204
movl %ecx, (%rax)
callq 0x63c20
leaq 0x1af286(%rip), %rax    # 0x2826c4
movl $0x0, (%rax)
callq 0x7a560
movw %ax, -0x6(%rbp)
movzwl -0x6(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0xafec3(%rip), %xmm1    # 0x183320
movss %xmm1, -0x18(%rbp)
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1af26f(%rip), %rax    # 0x2826e0
movsd %xmm0, (%rax)
callq 0x7a560
movss -0x18(%rbp), %xmm1
movw %ax, -0x6(%rbp)
movzwl -0x6(%rbp), %eax
cvtsi2ss %eax, %xmm0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1af22e(%rip), %rax    # 0x2826c8
movsd %xmm0, (%rax)
callq 0x7a560
movss -0x18(%rbp), %xmm1
movw %ax, -0x6(%rbp)
movzwl -0x6(%rbp), %eax
cvtsi2ss %eax, %xmm0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1af20d(%rip), %rax    # 0x2826d0
movsd %xmm0, (%rax)
callq 0x7a560
movss -0x18(%rbp), %xmm1
movw %ax, -0x6(%rbp)
movzwl -0x6(%rbp), %eax
cvtsi2ss %eax, %xmm0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1af1ec(%rip), %rax    # 0x2826d8
movsd %xmm0, (%rax)
callq 0x7a560
movw %ax, -0x6(%rbp)
movzwl -0x6(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0xafe17(%rip), %xmm1    # 0x183320
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x1af1d0(%rip), %rax    # 0x2826e8
movsd %xmm0, (%rax)
leaq 0x1af1a1(%rip), %rax    # 0x2826c4
movl (%rax), %ecx
orl $0x1f, %ecx
leaq 0x1af195(%rip), %rax    # 0x2826c4
movl %ecx, (%rax)
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a560
callq 0x7a680
callq 0x7a680
callq 0x7a680
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0xd3578
callq 0x7a510
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xd3560
movl $0x0, -0xc(%rbp)
cmpl $0xa, -0xc(%rbp)
jge 0xd3595
callq 0x7a560
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xd357f
callq 0x7a560
cwtl
movl %eax, -0x10(%rbp)
cvtsi2sdl -0x10(%rbp), %xmm0
leaq 0x2983f6(%rip), %rax    # 0x36b9a0
movsd %xmm0, (%rax)
leaq 0x298e5f(%rip), %rax    # 0x36c414
movl $0x5, (%rax)
leaq 0x298e66(%rip), %rax    # 0x36c428
movl $0x5, (%rax)
callq 0x7a560
movzwl %ax, %eax
movl %eax, -0x14(%rbp)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)