// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: show_max_signals()
void show_max_signals()
{
int row,col;
int prn;
int first_prn, last_prn;
char c[32];
float min, max;
float sum;
float count;
int shown;

#define PRN_PER_LINE 5    // max number of PRNs to show per row

   if(all_adevs) return;
   if(rcvr_type == ACRON_RCVR) return;
   if(rcvr_type == NO_RCVR) return;
   if(rcvr_type == TIDE_RCVR) return;
   if(NO_SATS) return;
   if(zoom_screen) return;

   first_prn = 1;
   last_prn = MAX_PRN;

   for(first_prn=1; first_prn<MAX_PRN; first_prn++) {  // find first sat with signals
      if(max_sat_db[first_prn]) break;
   }

   row = DIS_ROW+0+eofs+5;
   col = DIS_COL;
   sun_moon_shown = col;
   sprintf(out, "Satellite max %s", level_type);
   vidstr(row, col, WHITE, out); 
   ++row;

   sum = count = 0.0F;
   max = 0.0F;
   min = 9999.0F;

   shown = 0;
   prn = first_prn;
   sprintf(out, " %3d: ", prn);
   while(prn <= last_prn) {
      if(shown == 0) {  // start of new row
         while(prn < MAX_PRN) {
            if(max_sat_db[prn]) break;
            ++prn;
         }
         sprintf(out, " %3d: ", prn);
      }
      if((prn >= MAX_PRN) && (max_sat_db[prn] == 0)) break;

      if(max_sat_db[prn]) {
         sprintf(c, "%2d ", (int) (max_sat_db[prn]+0.5F));
         sum += max_sat_db[prn];
         if(max_sat_db[prn] > max) max = max_sat_db[prn];
         if(max_sat_db[prn] < min) min = max_sat_db[prn];
         count += 1.0F;
      }
      else strcpy(c,".. ");
      strcat(out, c);

      ++shown;
      if(shown >= PRN_PER_LINE) {  // end-of-line, start a new row
         vidstr(row, col, WHITE, out); 
         sprintf(out, " %3d: ", prn+1);
         shown = 0;

         ++row;
         if(row >= (queue_row+4)) break;
      }
      prn++;
   }
   if(shown) vidstr(row, col, WHITE, out); 
   else --row;

   if(min >= 9999.0F) min = 0.0F;
   if(count) {
      sum = (sum / count) + 0.50F;
   }
   else sum = 0.0F;

   min += 0.50;
   max += 0.50;

   sprintf(out, " avg: %2d    max: %2d", (int) sum, (int) max);
   ++row;
   vidstr(row, col, WHITE, out); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x18839f(%rip), %rax    # 0x226d3e
cmpb $0x0, (%rax)
je 0x9e9b3
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x163f16(%rip), %rax    # 0x2028d0
movq (%rax), %rax
cmpq $0x400, %rax            # imm = 0x400
je 0x9e9a4
cmpq $0x4000, %rax           # imm = 0x4000
je 0x9e9a4
cmpq $0x800000, %rax         # imm = 0x800000
je 0x9e9a4
movabsq $0x105b8b0400, %rcx     # imm = 0x105B8B0400
testq %rcx, %rax
jne 0x9e9a4
leaq 0x1665e5(%rip), %rcx    # 0x204fd0
cmpl $0x0, (%rcx)
je 0x9e9fc
leaq 0x2589cd(%rip), %rcx    # 0x2f73c4
cmpl $0x0, (%rcx)
je 0x9e9a4
cmpq $0x400000, %rax         # imm = 0x400000
setne %al
leaq 0x258fa8(%rip), %rcx    # 0x2f79b4
cmpl $0x0, (%rcx)
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x9e9a4
leaq 0x257d88(%rip), %rax    # 0x2f67a8
cmpb $0x0, (%rax)
jne 0x9e9a4
pushq $0x1
popq %rbx
leaq 0xfe88d(%rip), %r14     # 0x19d2c0
xorps %xmm0, %xmm0
cmpq $0x3e7, %rbx            # imm = 0x3E7
je 0x9ea51
movss (%r14,%rbx,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0x9ea56
jp 0x9ea56
incq %rbx
jmp 0x9ea36
movl $0x3e7, %ebx            # imm = 0x3E7
leaq 0x18a4e3(%rip), %rax    # 0x228f40
movl (%rax), %r15d
leal 0xb(%r15), %r12d
leaq 0xbc201(%rip), %rax     # 0x15ac6c
movl $0x28, (%rax)
leaq 0x18a480(%rip), %rax    # 0x228ef8
movq (%rax), %rdx
leaq 0x28779e(%rip), %r13    # 0x326220
leaq 0x71c1a(%rip), %rsi     # 0x1106a3
movq %r13, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x28
popq %rsi
pushq $0xf
popq %rdx
movl %r12d, %edi
movq %r13, %rcx
callq 0xe2d2
addl $0xc, %r15d
movq %r15, -0x40(%rbp)
leaq 0x71c01(%rip), %rsi     # 0x1106b4
movq %r13, %rdi
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
xorps %xmm1, %xmm1
leaq -0x60(%rbp), %r12
xorps %xmm0, %xmm0
movss %xmm0, -0x34(%rbp)
movss %xmm0, -0x30(%rbp)
movss %xmm0, -0x2c(%rbp)
xorl %r13d, %r13d
cmpl $0x3e7, %ebx            # imm = 0x3E7
jg 0x9ec22
testl %r13d, %r13d
jne 0x9eb29
movslq %ebx, %rbx
cmpq $0x3e7, %rbx            # imm = 0x3E7
je 0x9eb0a
movss (%r14,%rbx,4), %xmm0
ucomiss %xmm1, %xmm0
jne 0x9eb0f
jp 0x9eb0f
incq %rbx
jmp 0x9eaef
movl $0x3e7, %ebx            # imm = 0x3E7
leaq 0x28770a(%rip), %rdi    # 0x326220
leaq 0x71b97(%rip), %rsi     # 0x1106b4
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
xorps %xmm1, %xmm1
cmpl $0x3e6, %ebx            # imm = 0x3E6
jle 0x9eb46
movl %ebx, %r15d
movss (%r14,%r15,4), %xmm0
ucomiss %xmm1, %xmm0
jne 0x9eb4f
jp 0x9eb4f
jmp 0x9ec22
movslq %ebx, %r15
movss (%r14,%r15,4), %xmm0
ucomiss %xmm1, %xmm0
jne 0x9eb56
jnp 0x9eba5
addss 0x5859a(%rip), %xmm0    # 0xf70f8
cvttss2si %xmm0, %edx
movq %r12, %rdi
leaq 0x71b4f(%rip), %rsi     # 0x1106bb
xorl %eax, %eax
callq 0x9060
movss (%r14,%r15,4), %xmm0
movss -0x30(%rbp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, -0x30(%rbp)
maxss -0x34(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
addss 0x58553(%rip), %xmm1    # 0xf70ec
movss %xmm1, -0x2c(%rbp)
movss %xmm0, -0x34(%rbp)
jmp 0x9ebac
movl $0x202e2e, -0x60(%rbp)  # imm = 0x202E2E
leaq 0x28766d(%rip), %rdi    # 0x326220
movq %r12, %rsi
callq 0x96c0
incl %ebx
cmpl $0x3, %r13d
ja 0x9ebce
incl %r13d
xorps %xmm1, %xmm1
jmp 0x9eadb
movq -0x40(%rbp), %r15
movl %r15d, %edi
pushq $0x28
popq %rsi
pushq $0xf
popq %rdx
leaq 0x28763e(%rip), %r13    # 0x326220
movq %r13, %rcx
callq 0xe2d2
movq %r13, %rdi
leaq 0x71ac0(%rip), %rsi     # 0x1106b4
movl %ebx, %edx
xorl %eax, %eax
callq 0x9060
leal 0x1(%r15), %r13d
leaq 0x163bc8(%rip), %rax    # 0x2027d0
movl (%rax), %eax
addl $0x3, %eax
cmpl %eax, %r15d
movl %r13d, %eax
movq %rax, -0x40(%rbp)
xorps %xmm1, %xmm1
jl 0x9ead8
jmp 0x9ec4d
testl %r13d, %r13d
je 0x9ec46
leaq 0x2875f2(%rip), %rcx    # 0x326220
pushq $0x28
popq %rsi
pushq $0xf
popq %rdx
movq -0x40(%rbp), %rbx
movl %ebx, %edi
callq 0xe2d2
incl %ebx
movl %ebx, %r13d
jmp 0x9ec4d
movq -0x40(%rbp), %rax
movl %eax, %r13d
xorps %xmm0, %xmm0
movss -0x2c(%rbp), %xmm2
ucomiss %xmm0, %xmm2
movss -0x30(%rbp), %xmm1
divss %xmm2, %xmm1
movss 0x5848f(%rip), %xmm0    # 0xf70f8
addss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl $0x0, %edx
cmovnel %eax, %edx
cmovpl %eax, %edx
movss -0x34(%rbp), %xmm1
addss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
leaq 0x287590(%rip), %rbx    # 0x326220
leaq 0x71a29(%rip), %rsi     # 0x1106c0
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
pushq $0x28
popq %rsi
pushq $0xf
popq %rdx
movl %r13d, %edi
movq %rbx, %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe2d2