// File: jkingan[P]ladyheather/heathgps.cpp
// Function: get_sig_levels()
void get_sig_levels()
{
u08 count;
int i;
int prn;
float sig_level;

   log_packet_id("Packet 0x47 (Signal levels)");

   for(i=1; i<=MAX_PRN; i++) {  
      sat[i].level_msg = 0x00;
      if(ACU_GG || ACU_360) sat[i].tracking = 0x00;  // rnx
      if(1 || log_db) sat[i].sig_level = 0;
   }

   count = tsip_byte();
   for(i=0; i<count; i++) {
      prn = tsip_byte();
      sig_level = tsip_single();
      if(prn > MAX_PRN) prn = 0;  // put any bogus data in unused entry in array
      sat[prn].sig_level = sig_level;
      sat[prn].level_msg = 0x47;
      have_snr |= rinex_gnss(prn);

      if(ACU_GG || ACU_360) {  // rnx
         if(sat[prn].azimuth == 0.0F) sat[prn].tracking = (-1);
         else if(sat[prn].elevation == 0.0F) sat[prn].tracking = (-1);
         else if(sig_level < 0.0) sat[prn].tracking = (-1);
         else if(sig_level > 0.0) sat[prn].tracking = (1);
      }
      if(SV6_FAMILY) {
         if(amu_mode == 0) {
            sat[prn].sig_level = amu_to_dbc(sat[prn].sig_level);
         }
      }
   }
   check_tsip_end(1);
   if(tsip_error) return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xe8193(%rip), %rdi     # 0x184df2
callq 0x7add0
movl $0x1, -0x8(%rbp)
cmpl $0x3e7, -0x8(%rbp)      # imm = 0x3E7
jg 0x9cd34
movslq -0x8(%rbp), %rcx
leaq 0x20150d(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x0, 0x1c(%rax)
leaq 0x1dae15(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x9ccb9
leaq 0x1dd50c(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x9ccb9
leaq 0x1dae24(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
je 0x9ccea
leaq 0x1dadf0(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x9cd09
leaq 0x1dd4e7(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x9cd09
leaq 0x1dadff(%rip), %rax    # 0x277ad8
cmpl $0x33, (%rax)
je 0x9ccea
leaq 0x1dadf3(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
jne 0x9cd09
movslq -0x8(%rbp), %rcx
leaq 0x20149b(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x0, 0x218(%rax)
movslq -0x8(%rbp), %rcx
leaq 0x20147c(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x20(%rax)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x9cc6b
callq 0x7a510
movb %al, -0x1(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
movzbl -0x1(%rbp), %ecx
cmpl %ecx, %eax
jge 0x9cfc6
callq 0x7a510
movzbl %al, %eax
movl %eax, -0xc(%rbp)
callq 0x7a860
movss %xmm0, -0x10(%rbp)
cmpl $0x3e7, -0xc(%rbp)      # imm = 0x3E7
jle 0x9cd77
movl $0x0, -0xc(%rbp)
movss -0x10(%rbp), %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x201409(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20(%rax)
movslq -0xc(%rbp), %rcx
leaq 0x2013ef(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x47, 0x1c(%rax)
movl -0xc(%rbp), %edi
callq 0x12d280
movl %eax, %ecx
leaq 0x2cf769(%rip), %rax    # 0x36c52c
orl (%rax), %ecx
leaq 0x2cf760(%rip), %rax    # 0x36c52c
movl %ecx, (%rax)
leaq 0x1dacdb(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x9cdf3
leaq 0x1dd3d2(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x9cdf3
leaq 0x1dacea(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
je 0x9ce30
leaq 0x1dacb6(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x9cf2f
leaq 0x1dd3a9(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x9cf2f
leaq 0x1dacbd(%rip), %rax    # 0x277ad8
cmpl $0x33, (%rax)
je 0x9ce30
leaq 0x1dacb1(%rip), %rax    # 0x277ad8
cmpl $0x47, (%rax)
jne 0x9cf2f
movslq -0xc(%rbp), %rcx
leaq 0x201355(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss 0x208(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x9ce7b
jp 0x9ce7b
movslq -0xc(%rbp), %rcx
leaq 0x20132e(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xffffffff, 0x218(%rax) # imm = 0xFFFFFFFF
jmp 0x9cf2d
movslq -0xc(%rbp), %rcx
leaq 0x20130a(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss 0x20c(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x9cec3
jp 0x9cec3
movslq -0xc(%rbp), %rcx
leaq 0x2012e3(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xffffffff, 0x218(%rax) # imm = 0xFFFFFFFF
jmp 0x9cf2b
movss -0x10(%rbp), %xmm0
cvtss2sd %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x9cef6
movslq -0xc(%rbp), %rcx
leaq 0x2012b0(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0xffffffff, 0x218(%rax) # imm = 0xFFFFFFFF
jmp 0x9cf29
movss -0x10(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x9cf27
movslq -0xc(%rbp), %rcx
leaq 0x20127d(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movl $0x1, 0x218(%rax)
jmp 0x9cf29
jmp 0x9cf2b
jmp 0x9cf2d
jmp 0x9cf2f
leaq 0x1dab7a(%rip), %rax    # 0x277ab0
cmpq $0x1, (%rax)
jne 0x9cfb6
leaq 0x1dd271(%rip), %rax    # 0x27a1b4
cmpl $0x36, (%rax)
je 0x9cf6c
leaq 0x1dd265(%rip), %rax    # 0x27a1b4
cmpl $0x33, (%rax)
je 0x9cf6c
leaq 0x1dd259(%rip), %rax    # 0x27a1b4
cmpl $0x50, (%rax)
je 0x9cf6c
leaq 0x1dd24d(%rip), %rax    # 0x27a1b4
cmpl $0x41, (%rax)
jne 0x9cfb6
leaq 0x20115d(%rip), %rax    # 0x29e0d0
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x9cfb4
movslq -0xc(%rbp), %rcx
leaq 0x20120a(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss 0x20(%rax), %xmm0
callq 0x154b60
movslq -0xc(%rbp), %rcx
leaq 0x2011eb(%rip), %rax    # 0x29e190
imulq $0x348, %rcx, %rcx      # imm = 0x348
addq %rcx, %rax
movss %xmm0, 0x20(%rax)
jmp 0x9cfb6
jmp 0x9cfb8
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x9cd43
movl $0x1, %edi
callq 0x7aee0
leaq 0x201179(%rip), %rax    # 0x29e150
cmpl $0x0, (%rax)
je 0x9cfde
jmp 0x9cfde
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)