// File: /workspace/github_cpp_makefile_star2_O3/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 0xaf136(%rip), %rdi     # 0x121b62
callq 0x58dc2
leaq 0x1a5e98(%rip), %rax    # 0x2188d0
cmpq $0x1, (%rax)
sete %cl
leaq 0x1a858e(%rip), %rax    # 0x21afd4
cmpl $0x41, (%rax)
sete %al
andb %cl, %al
leaq 0x1a5ea3(%rip), %rcx    # 0x2188f8
movl (%rcx), %ecx
cmpl $0x47, %ecx
sete %dl
andb %al, %dl
xorl %esi, %esi
leaq 0x1cc548(%rip), %r15    # 0x23efb0
movl $0x0, 0x364(%r15,%rsi)
testb %dl, %dl
je 0x72a86
movl $0x0, 0x560(%r15,%rsi)
jmp 0x72a94
testb %al, %al
je 0x72a94
cmpl $0x47, %ecx
je 0x72a78
cmpl $0x33, %ecx
je 0x72a78
movl $0x0, 0x368(%r15,%rsi)
addq $0x348, %rsi            # imm = 0x348
cmpq $0xccdf8, %rsi          # imm = 0xCCDF8
jne 0x72a68
callq 0x587be
movl %eax, %ebx
cmpl $0x100, %eax            # imm = 0x100
jb 0x72ac8
leaq 0x1cc4ab(%rip), %rax    # 0x23ef70
orb $0x8, (%rax)
andl $0xff, %ebx
je 0x72c06
leaq 0x29a871(%rip), %r12    # 0x30d34c
callq 0x587be
cmpl $0x100, %eax            # imm = 0x100
jb 0x72af1
leaq 0x1cc482(%rip), %rcx    # 0x23ef70
orb $0x8, (%rcx)
movzbl %al, %r14d
callq 0x58a30
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 0xdc1dd
orl %eax, (%r12)
leaq 0x1a5da3(%rip), %rax    # 0x2188d0
movq (%rax), %rcx
cmpq $0x1, %rcx
sete %dl
leaq 0x1a8496(%rip), %rax    # 0x21afd4
movl (%rax), %eax
cmpl $0x41, %eax
sete %sil
andb %dl, %sil
leaq 0x1a5da7(%rip), %rdx    # 0x2188f8
movl (%rdx), %edx
cmpl $0x47, %edx
sete %dil
testb %dil, %sil
xorps %xmm1, %xmm1
je 0x72bc0
movss 0x208(%r13), %xmm0
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomiss %xmm1, %xmm0
jne 0x72bd1
jp 0x72bd1
movl %ecx, 0x218(%r13)
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 0x72bfe
leaq 0x1cc348(%rip), %rax    # 0x23eef0
cmpb $0x0, (%rax)
jne 0x72bfe
movss 0x20(%r13), %xmm0
callq 0xf7984
movss %xmm0, 0x20(%r13)
jmp 0x72bfe
testb %sil, %sil
je 0x72bf8
cmpl $0x47, %edx
je 0x72b62
cmpl $0x33, %edx
je 0x72b62
jmp 0x72b7e
movss 0x20c(%r13), %xmm0
ucomiss %xmm1, %xmm0
jne 0x72be1
jnp 0x72b77
ucomiss -0x2c(%rbp), %xmm1
ja 0x72b77
movl $0x1, %ecx
movss -0x2c(%rbp), %xmm0
ucomiss %xmm1, %xmm0
ja 0x72b77
jmp 0x72b7e
cmpq $0x1, %rcx
je 0x72b7e
decl %ebx
jne 0x72adb
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x58e9b