// File: /workspace/github_cpp_makefile_star2_O2/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 0xa2bd1(%rip), %rdi     # 0x10baaa
callq 0x520bf
leaq 0x1999eb(%rip), %rax    # 0x2028d0
cmpq $0x1, (%rax)
sete %cl
leaq 0x19c0e1(%rip), %rax    # 0x204fd4
cmpl $0x41, (%rax)
sete %al
andb %cl, %al
leaq 0x1999f6(%rip), %rcx    # 0x2028f8
movl (%rcx), %ecx
cmpl $0x47, %ecx
sete %dl
andb %al, %dl
xorl %esi, %esi
leaq 0x1c009b(%rip), %r13    # 0x228fb0
cmpq $0xccdf8, %rsi          # imm = 0xCCDF8
je 0x68f56
andl $0x0, 0x364(%r13,%rsi)
testb %dl, %dl
je 0x68f36
andl $0x0, 0x560(%r13,%rsi)
jmp 0x68f44
testb %al, %al
je 0x68f44
cmpl $0x47, %ecx
je 0x68f2b
cmpl $0x33, %ecx
je 0x68f2b
andl $0x0, 0x368(%r13,%rsi)
addq $0x348, %rsi            # imm = 0x348
jmp 0x68f15
callq 0x51c47
movzbl %al, %r14d
pushq $-0x1
popq %r12
subl $0x1, %r14d
jb 0x690af
callq 0x51c47
movzbl %al, %ebx
callq 0x51dc3
imulq $0x348, %rbx, %rax      # imm = 0x348
leaq (%rax,%r13), %r15
movss %xmm0, -0x2c(%rbp)
movss %xmm0, 0x20(%r13,%rax)
movl $0x47, 0x1c(%r13,%rax)
movl %ebx, %edi
callq 0xca4da
leaq 0x28e3a4(%rip), %rcx    # 0x2f734c
orl %eax, (%rcx)
leaq 0x19991f(%rip), %rax    # 0x2028d0
movq (%rax), %rcx
cmpq $0x1, %rcx
sete %dl
leaq 0x19c012(%rip), %rax    # 0x204fd4
movl (%rax), %eax
cmpl $0x41, %eax
sete %sil
andb %dl, %sil
leaq 0x199923(%rip), %rdx    # 0x2028f8
movl (%rdx), %edx
cmpl $0x47, %edx
sete %dil
testb %dil, %sil
je 0x6904e
movss 0x208(%r15), %xmm0
ucomiss 0x8e11d(%rip), %xmm0    # 0xf7110
movl %r12d, %ecx
jne 0x6905f
jp 0x6905f
movl %ecx, 0x218(%r15)
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 0x68f63
leaq 0x1bfec1(%rip), %rax    # 0x228ef0
cmpb $0x0, (%rax)
jne 0x68f63
movss 0x20(%r15), %xmm0
callq 0xe21de
movss %xmm0, 0x20(%r15)
jmp 0x68f63
testb %sil, %sil
je 0x690a0
cmpl $0x47, %edx
je 0x68fe3
cmpl $0x33, %edx
je 0x68fe3
jmp 0x69001
movss 0x20c(%r15), %xmm0
ucomiss 0x8e0a1(%rip), %xmm0    # 0xf7110
movl %r12d, %ecx
jne 0x69076
jnp 0x68ffa
xorps %xmm0, %xmm0
ucomiss -0x2c(%rbp), %xmm0
movl %r12d, %ecx
ja 0x68ffa
movss -0x2c(%rbp), %xmm0
ucomiss 0x8e07e(%rip), %xmm0    # 0xf7110
pushq $0x1
popq %rcx
ja 0x68ffa
jmp 0x69001
cmpq $0x1, %rcx
jne 0x68f63
jmp 0x69001
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x52194