// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7fd89(%rip), %rdi     # 0x124bef
callq 0x58e77
movl $0x218, %eax            # imm = 0x218
leaq 0x19a139(%rip), %r14    # 0x23efb0
xorl %ecx, %ecx
movl %ecx, (%r14,%rax)
movl %ecx, -0x1fc(%r14,%rax)
addq $0x348, %rax            # imm = 0x348
cmpq $0xcd358, %rax          # imm = 0xCD358
jne 0xa4e79
movl $0xc, %r15d
xorl %r12d, %r12d
leaq 0x296b9d(%rip), %rbx    # 0x33ba40
callq 0x811da
testl %eax, %eax
je 0xa4ec6
movq %rbx, %rdi
callq 0x95e0
leal -0x1(%rax), %ecx
cmpl $0x3e6, %ecx            # imm = 0x3E6
cmovael %r12d, %eax
movslq %eax, %r13
jmp 0xa4ec9
xorl %r13d, %r13d
callq 0x811da
testl %eax, %eax
je 0xa4ef1
movq %rbx, %rdi
callq 0x95e0
testl %eax, %eax
jne 0xa4ef1
imulq $0x348, %r13, %rax      # imm = 0x348
movl $0xffffffff, 0x218(%r14,%rax) # imm = 0xFFFFFFFF
callq 0x811da
testl %eax, %eax
je 0xa4f46
movsbl (%rbx), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0xa4f46
movq %rbx, %rdi
callq 0x95e0
xorps %xmm0, %xmm0
cmpl $0x9, %eax
ja 0xa4f23
movl %eax, %eax
leaq 0x7b142(%rip), %rcx     # 0x120060
movss (%rcx,%rax,4), %xmm0
imulq $0x348, %r13, %rax      # imm = 0x348
movl $0x1, 0x218(%r14,%rax)
movss %xmm0, 0x20(%r14,%rax)
movl $0x1bc, 0x1c(%r14,%rax) # imm = 0x1BC
callq 0x811da
decl %r15d
jne 0xa4ea3
callq 0x811da
leaq 0x7cc9a(%rip), %rax     # 0x121bfa
leaq 0x199f91(%rip), %rcx    # 0x23eef8
movq %rax, (%rcx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq