// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xaef16(%rip), %rdi     # 0x121a82
callq 0x58e77
leaq 0x1a5d58(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
sete %cl
leaq 0x1a844e(%rip), %rax    # 0x21afd4
cmpl $0x41, (%rax)
sete %al
andb %cl, %al
leaq 0x1a5d63(%rip), %rcx    # 0x2188f8
movl (%rcx), %ecx
cmpl $0x47, %ecx
sete %dl
andb %al, %dl
xorl %esi, %esi
leaq 0x1cc408(%rip), %r15    # 0x23efb0
movl $0x0, 0x364(%r15,%rsi)
testb %dl, %dl
je 0x72bc6
movl $0x0, 0x560(%r15,%rsi)
jmp 0x72bd4
testb %al, %al
je 0x72bd4
cmpl $0x47, %ecx
je 0x72bb8
cmpl $0x33, %ecx
je 0x72bb8
movl $0x0, 0x368(%r15,%rsi)
addq $0x348, %rsi            # imm = 0x348
cmpq $0xccdf8, %rsi          # imm = 0xCCDF8
jne 0x72ba8
callq 0x587d1
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x72c08
leaq 0x1cc36b(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
andl $0xff, %ebx
je 0x72d44
leaq 0x29a731(%rip), %r12    # 0x30d34c
callq 0x587d1
cmpl $0x100, %eax            # imm = 0x100
jb 0x72c31
leaq 0x1cc342(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %r14d
callq 0x58aae
imulq $0x348, %r14, %rax      # imm = 0x348
leaq (%r15,%rax), %r13
movss %xmm0, -0x2c(%rbp)
movss %xmm0, 0x20(%r15,%rax)
movl $0x47, 0x1c(%r15,%rax)
movl %r14d, %edi
callq 0xdbb74
orl %eax, (%r12)
leaq 0x1a5c63(%rip), %rax    # 0x2188d0
movq (%rax), %rcx
cmpq $0x1, %rcx
sete %dl
leaq 0x1a8356(%rip), %rax    # 0x21afd4
movl (%rax), %eax
cmpl $0x41, %eax
sete %sil
andb %dl, %sil
leaq 0x1a5c67(%rip), %rdx    # 0x2188f8
movl (%rdx), %edx
cmpl $0x47, %edx
sete %dil
testb %dil, %sil
xorps %xmm1, %xmm1
je 0x72cc0
movss 0x208(%r13), %xmm0
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
ucomiss %xmm1, %xmm0
jne 0x72cd1
jp 0x72cd1
movl %edx, 0x218(%r13)
jmp 0x72cf6
testb %sil, %sil
je 0x72cf6
cmpl $0x47, %edx
je 0x72ca2
cmpl $0x33, %edx
je 0x72ca2
jmp 0x72cf6
movss 0x20c(%r13), %xmm0
ucomiss %xmm1, %xmm0
jne 0x72ce1
jnp 0x72cb7
ucomiss -0x2c(%rbp), %xmm1
ja 0x72cb7
movl $0x1, %edx
movss -0x2c(%rbp), %xmm0
ucomiss %xmm1, %xmm0
ja 0x72cb7
cmpq $0x1, %rcx
jne 0x72d3c
cmpl $0x41, %eax
setne %cl
cmpl $0x36, %eax
setne %dl
cmpl $0x33, %eax
setne %sil
andb %dl, %sil
cmpl $0x50, %eax
setne %al
andb %sil, %al
testb %al, %cl
jne 0x72d3c
leaq 0x1cc1ca(%rip), %rax    # 0x23eef0
cmpb $0x0, (%rax)
jne 0x72d3c
movss 0x20(%r13), %xmm0
callq 0xf72a0
movss %xmm0, 0x20(%r13)
decl %ebx
jne 0x72c1b
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x58f50