// File: /workspace/github_cpp_makefile_star2_O1/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 0x18e5a9(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
je 0xae7a9
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x16a120(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x400, %rax            # imm = 0x400
je 0xae79a
cmpq $0x4000, %rax           # imm = 0x4000
je 0xae79a
cmpq $0x800000, %rax         # imm = 0x800000
je 0xae79a
movabsq $0x105b8b0400, %rcx     # imm = 0x105B8B0400
testq %rcx, %rax
jne 0xae79a
leaq 0x16c7ef(%rip), %rcx    # 0x21afd0
cmpl $0x0, (%rcx)
je 0xae7f2
leaq 0x25ebd7(%rip), %rcx    # 0x30d3c4
cmpl $0x0, (%rcx)
je 0xae79a
cmpq $0x400000, %rax         # imm = 0x400000
setne %al
leaq 0x25f1b2(%rip), %rcx    # 0x30d9b4
cmpl $0x0, (%rcx)
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xae79a
leaq 0x25df92(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
jne 0xae79a
movl $0x1, %r14d
leaq 0x104a94(%rip), %r13    # 0x1b32c0
xorps %xmm0, %xmm0
movss (%r13,%r14,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0xae84f
jp 0xae84f
incq %r14
cmpq $0x3e7, %r14            # imm = 0x3E7
jne 0xae82f
movl $0x3e7, %r14d           # imm = 0x3E7
leaq 0x1906ea(%rip), %rax    # 0x23ef40
movl (%rax), %ebx
leal 0xb(%rbx), %r12d
leaq 0xc2409(%rip), %rax     # 0x170c6c
movl $0x28, (%rax)
leaq 0x190688(%rip), %rax    # 0x23eef8
movq (%rax), %rdx
leaq 0x28d9a6(%rip), %r15    # 0x33c220
leaq 0x77dfd(%rip), %rsi     # 0x12667e
movq %r15, %rdi
xorl %eax, %eax
callq 0x9060
movl %r12d, %edi
movl $0x28, %esi
movl $0xf, %edx
movq %r15, %rcx
callq 0xe7d0
addl $0xc, %ebx
leaq 0x77de5(%rip), %rsi     # 0x12668f
movq %r15, %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x9060
cmpl $0x3e7, %r14d           # imm = 0x3E7
jg 0xaea47
xorps %xmm1, %xmm1
xorl %r12d, %r12d
xorps %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
movss %xmm0, -0x30(%rbp)
movss %xmm0, -0x34(%rbp)
testl %r12d, %r12d
jne 0xae928
cmpl $0x3e6, %r14d           # imm = 0x3E6
jg 0xae90d
movslq %r14d, %r14
movss (%r13,%r14,4), %xmm0
ucomiss %xmm1, %xmm0
jne 0xae90d
jp 0xae90d
incq %r14
cmpq $0x3e7, %r14            # imm = 0x3E7
jne 0xae8ed
movl $0x3e7, %r14d           # imm = 0x3E7
leaq 0x28d90c(%rip), %rdi    # 0x33c220
leaq 0x77d74(%rip), %rsi     # 0x12668f
movl %r14d, %edx
xorl %eax, %eax
callq 0x9060
xorps %xmm1, %xmm1
cmpl $0x3e7, %r14d           # imm = 0x3E7
jl 0xae946
movl %r14d, %eax
movss (%r13,%rax,4), %xmm0
ucomiss %xmm1, %xmm0
jne 0xae946
jnp 0xaea5b
movslq %r14d, %r15
movss (%r13,%r15,4), %xmm0
ucomiss %xmm1, %xmm0
jne 0xae957
jnp 0xae9c2
addss 0x5e685(%rip), %xmm0    # 0x10cfe4
cvttss2si %xmm0, %edx
movl %r12d, -0x38(%rbp)
movq %rbx, %r12
movq %r13, %rbx
leaq -0x60(%rbp), %r13
movq %r13, %rdi
leaq 0x77d1b(%rip), %rsi     # 0x126696
xorl %eax, %eax
callq 0x9060
movq %r13, %rsi
movq %rbx, %r13
movq %r12, %rbx
movl -0x38(%rbp), %r12d
movss (%r13,%r15,4), %xmm0
movss -0x30(%rbp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, -0x30(%rbp)
maxss -0x34(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
addss 0x5e61e(%rip), %xmm1    # 0x10cfd4
movss %xmm1, -0x2c(%rbp)
movss %xmm0, -0x34(%rbp)
jmp 0xae9cd
movl $0x202e2e, -0x60(%rbp)  # imm = 0x202E2E
leaq -0x60(%rbp), %rsi
leaq 0x28d84c(%rip), %rdi    # 0x33c220
callq 0x96c0
cmpl $0x4, %r12d
jge 0xae9e6
incl %r12d
movl %ebx, %eax
jmp 0xaea2c
movl %ebx, %edi
movl $0x28, %esi
movl $0xf, %edx
leaq 0x28d827(%rip), %r15    # 0x33c220
movq %r15, %rcx
callq 0xe7d0
leal 0x1(%r14), %edx
xorl %r12d, %r12d
movq %r15, %rdi
leaq 0x77c7d(%rip), %rsi     # 0x12668f
xorl %eax, %eax
callq 0x9060
leal 0x1(%rbx), %eax
leaq 0x169dad(%rip), %rcx    # 0x2187d0
movl (%rcx), %ecx
addl $0x3, %ecx
cmpl %ecx, %ebx
jge 0xaea5d
leal 0x1(%r14), %ecx
movl %eax, %ebx
cmpl $0x3e7, %r14d           # imm = 0x3E7
movl %ecx, %r14d
xorps %xmm1, %xmm1
jl 0xae8dc
jmp 0xaea5d
movb $0x1, %cl
xorps %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
movss %xmm0, -0x2c(%rbp)
xorl %r15d, %r15d
jmp 0xaea77
movl %ebx, %eax
testl %r12d, %r12d
movss -0x34(%rbp), %xmm0
addss 0x5e577(%rip), %xmm0    # 0x10cfe4
sete %cl
cvttss2si %xmm0, %r15d
movl %eax, %ebx
testb %cl, %cl
jne 0xaea95
leaq 0x28d79e(%rip), %rcx    # 0x33c220
movl %ebx, %edi
movl $0x28, %esi
movl $0xf, %edx
callq 0xe7d0
incl %ebx
xorps %xmm0, %xmm0
movss -0x2c(%rbp), %xmm1
ucomiss %xmm0, %xmm1
movss -0x30(%rbp), %xmm0
divss %xmm1, %xmm0
addss 0x5e533(%rip), %xmm0    # 0x10cfe4
cvttss2si %xmm0, %eax
movl $0x0, %edx
cmovnel %eax, %edx
cmovpl %eax, %edx
leaq 0x28d759(%rip), %r14    # 0x33c220
leaq 0x77bcd(%rip), %rsi     # 0x12669b
movq %r14, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x9060
movl %ebx, %edi
movl $0x28, %esi
movl $0xf, %edx
movq %r14, %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe7d0