// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_sats()
void parse_tm4_sats()
{
int i;
int prn;
int w,x,y;
int z;
float sig;

   log_packet_id("sat info");
   reset_sat_tracking();

   for(i=0; i<12; i++) { 
      prn = w = x = y = 0;
      sig = 0.0F;
      if(get_msg_field()) {
         prn = atoi(msg_field);
         if((prn >= 1) && (prn < MAX_PRN)) ;
         else prn = 0;
      }

      if(get_msg_field()) {  // 0=included   1=not included
         w = atoi(msg_field);
         if(w == 0) sat[prn].tracking = (-1);
      }

      if(get_msg_field()) {  // tracking status A=acquiring S=searching  0..9=sig leve;
         if(isdigit(msg_field[0])) {  // sig level
            x = atoi(msg_field);
            if     (x == 9) sig = 45.0F;
            else if(x == 8) sig = 44.0F;
            else if(x == 7) sig = 43.0F;
            else if(x == 6) sig = 42.0F;
            else if(x == 5) sig = 41.0F;
            else if(x == 4) sig = 40.0F;
            else if(x == 3) sig = 39.0F;
            else if(x == 2) sig = 38.0F;
            else if(x == 1) sig = 37.0F;
            else if(x == 0) sig = 26.0F;
            sat[prn].tracking = 1;
            sat[prn].sig_level = sig;
            sat[prn].level_msg = 444;
         }
         else { // A=acquiring  S=searching
            x = msg_field[0];
         }
      }
      if(get_msg_field()) {  // ephemeris status
         y = atoi(msg_field);
      }
   }

   if(get_msg_field()) {  // receiver status
      // 2=sky search
      // 3=almanac collect
      // 4=ephemeris collect
      // 5=acquisition
      // 6=positioning
      z = atoi(msg_field);
   }

   level_type = "dBc";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0xa7fbc(%rip), %rdi     # 0x187fbb
callq 0x7add0
callq 0x81c10
movl $0x0, -0x4(%rbp)
cmpl $0xc, -0x4(%rbp)
jge 0xe0268
movl $0x0, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x8(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe0071
leaq 0x2babd1(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x8(%rbp)
cmpl $0x1, -0x8(%rbp)
jl 0xe0068
cmpl $0x3e7, -0x8(%rbp)      # imm = 0x3E7
jge 0xe0068
jmp 0xe006f
movl $0x0, -0x8(%rbp)
jmp 0xe0071
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe00b1
leaq 0x2bab9e(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0xe00af
movslq -0x8(%rbp), %rcx
leaq 0x1be0f5(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xffffffff, 0x218(%rax) # imm = 0xFFFFFFFF
jmp 0xe00b1
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe023f
leaq 0x2bab5a(%rip), %rax    # 0x39ac20
movsbl (%rax), %edi
callq 0x9330
cmpl $0x0, %eax
je 0xe0230
leaq 0x2bab42(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x10(%rbp)
cmpl $0x9, -0x10(%rbp)
jne 0xe00fe
movss 0xa32e8(%rip), %xmm0    # 0x1833dc
movss %xmm0, -0x1c(%rbp)
jmp 0xe01d4
cmpl $0x8, -0x10(%rbp)
jne 0xe0116
movss 0xa32cc(%rip), %xmm0    # 0x1833d8
movss %xmm0, -0x1c(%rbp)
jmp 0xe01d2
cmpl $0x7, -0x10(%rbp)
jne 0xe012e
movss 0xa32b0(%rip), %xmm0    # 0x1833d4
movss %xmm0, -0x1c(%rbp)
jmp 0xe01d0
cmpl $0x6, -0x10(%rbp)
jne 0xe0146
movss 0xa3294(%rip), %xmm0    # 0x1833d0
movss %xmm0, -0x1c(%rbp)
jmp 0xe01ce
cmpl $0x5, -0x10(%rbp)
jne 0xe015b
movss 0xa3278(%rip), %xmm0    # 0x1833cc
movss %xmm0, -0x1c(%rbp)
jmp 0xe01cc
cmpl $0x4, -0x10(%rbp)
jne 0xe0170
movss 0xa324b(%rip), %xmm0    # 0x1833b4
movss %xmm0, -0x1c(%rbp)
jmp 0xe01ca
cmpl $0x3, -0x10(%rbp)
jne 0xe0185
movss 0xa324a(%rip), %xmm0    # 0x1833c8
movss %xmm0, -0x1c(%rbp)
jmp 0xe01c8
cmpl $0x2, -0x10(%rbp)
jne 0xe019a
movss 0xa3231(%rip), %xmm0    # 0x1833c4
movss %xmm0, -0x1c(%rbp)
jmp 0xe01c6
cmpl $0x1, -0x10(%rbp)
jne 0xe01af
movss 0xa3218(%rip), %xmm0    # 0x1833c0
movss %xmm0, -0x1c(%rbp)
jmp 0xe01c4
cmpl $0x0, -0x10(%rbp)
jne 0xe01c2
movss 0xa31ff(%rip), %xmm0    # 0x1833bc
movss %xmm0, -0x1c(%rbp)
jmp 0xe01c4
jmp 0xe01c6
jmp 0xe01c8
jmp 0xe01ca
jmp 0xe01cc
jmp 0xe01ce
jmp 0xe01d0
jmp 0xe01d2
jmp 0xe01d4
movslq -0x8(%rbp), %rcx
leaq 0x1bdfb1(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x1, 0x218(%rax)
movss -0x1c(%rbp), %xmm0
movslq -0x8(%rbp), %rcx
leaq 0x1bdf8d(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x1bdf73(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x1bc, 0x1c(%rax)      # imm = 0x1BC
jmp 0xe023d
leaq 0x2ba9e9(%rip), %rax    # 0x39ac20
movsbl (%rax), %eax
movl %eax, -0x10(%rbp)
jmp 0xe023f
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe0258
leaq 0x2ba9d0(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x14(%rbp)
jmp 0xe025a
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xe0010
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe0281
leaq 0x2ba9a7(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, -0x18(%rbp)
leaq 0x1bde50(%rip), %rax    # 0x29e0d8
leaq 0xa4cdb(%rip), %rcx     # 0x184f6a
movq %rcx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)