// File: /workspace/github_cpp_makefile_star2_O3/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 0x18e2f5(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
je 0xaea5d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x169e6c(%rip), %rax    # 0x2188d0
movq (%rax), %rax
cmpq $0x400, %rax            # imm = 0x400
je 0xaea4e
cmpq $0x4000, %rax           # imm = 0x4000
je 0xaea4e
cmpq $0x800000, %rax         # imm = 0x800000
je 0xaea4e
movabsq $0x105b8b0400, %rcx     # imm = 0x105B8B0400
testq %rcx, %rax
jne 0xaea4e
leaq 0x16c53b(%rip), %rcx    # 0x21afd0
cmpl $0x0, (%rcx)
je 0xaeaa6
leaq 0x25e923(%rip), %rcx    # 0x30d3c4
cmpl $0x0, (%rcx)
je 0xaea4e
cmpq $0x400000, %rax         # imm = 0x400000
setne %al
leaq 0x25eefe(%rip), %rcx    # 0x30d9b4
cmpl $0x0, (%rcx)
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0xaea4e
leaq 0x25dcde(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
jne 0xaea4e
movl $0x1, %r12d
leaq 0x1047e0(%rip), %rax    # 0x1b32c0
xorps %xmm0, %xmm0
movss (%rax,%r12,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0xaeb02
jp 0xaeb02
incq %r12
cmpq $0x3e7, %r12            # imm = 0x3E7
jne 0xaeae3
movl $0x3e7, %r12d           # imm = 0x3E7
leaq 0x190437(%rip), %rax    # 0x23ef40
movl (%rax), %ebx
leal 0xb(%rbx), %r14d
leaq 0xc2156(%rip), %rax     # 0x170c6c
movl $0x28, (%rax)
leaq 0x1903d5(%rip), %rax    # 0x23eef8
movq (%rax), %rdx
leaq 0x28d6f3(%rip), %r15    # 0x33c220
leaq 0x77c2a(%rip), %rsi     # 0x12675e
movq %r15, %rdi
xorl %eax, %eax
callq 0x9060
movl %r14d, %edi
movl $0x28, %esi
movl $0xf, %edx
movq %r15, %rcx
callq 0xe787
addl $0xc, %ebx
leaq 0x77c12(%rip), %rsi     # 0x12676f
movq %r15, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x9060
cmpl $0x3e7, %r12d           # imm = 0x3E7
jg 0xaed26
xorps %xmm4, %xmm4
xorl %r14d, %r14d
xorps %xmm3, %xmm3
xorps %xmm2, %xmm2
xorps %xmm1, %xmm1
testl %r14d, %r14d
movss %xmm1, -0x34(%rbp)
movss %xmm2, -0x30(%rbp)
movss %xmm3, -0x2c(%rbp)
je 0xaeba6
movl %r12d, %r13d
leaq 0x10471c(%rip), %rax    # 0x1b32c0
jmp 0xaec0c
cmpl $0x3e6, %r12d           # imm = 0x3E6
leaq 0x10470c(%rip), %rax    # 0x1b32c0
jg 0xaebd8
movslq %r12d, %r12
movss (%rax,%r12,4), %xmm0
ucomiss %xmm4, %xmm0
jne 0xaebd8
jp 0xaebd8
incq %r12
cmpq $0x3e7, %r12            # imm = 0x3E7
jne 0xaebb9
movl $0x3e7, %r12d           # imm = 0x3E7
leaq 0x28d641(%rip), %rdi    # 0x33c220
leaq 0x77b89(%rip), %rsi     # 0x12676f
movl %r12d, %edx
xorl %eax, %eax
callq 0x9060
movl %r12d, %r13d
leaq 0x1046c6(%rip), %rax    # 0x1b32c0
movss -0x34(%rbp), %xmm1
movss -0x30(%rbp), %xmm2
movss -0x2c(%rbp), %xmm3
xorps %xmm4, %xmm4
cmpl $0x3e6, %r13d           # imm = 0x3E6
leaq -0x60(%rbp), %r12
jle 0xaec2e
movl %r13d, %r15d
movss (%rax,%r15,4), %xmm0
ucomiss %xmm4, %xmm0
jne 0xaec37
jp 0xaec37
jmp 0xaed34
movslq %r13d, %r15
movss (%rax,%r15,4), %xmm0
ucomiss %xmm4, %xmm0
jne 0xaec3e
jnp 0xaec94
addss 0x5e432(%rip), %xmm0    # 0x10d078
cvttss2si %xmm0, %edx
movq %r12, %rdi
leaq 0x77b22(%rip), %rsi     # 0x126776
xorl %eax, %eax
callq 0x9060
leaq 0x10465e(%rip), %rax    # 0x1b32c0
movss (%rax,%r15,4), %xmm0
movss -0x30(%rbp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, -0x30(%rbp)
maxss -0x34(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
addss 0x5e3e4(%rip), %xmm1    # 0x10d06c
movss %xmm1, -0x2c(%rbp)
movss %xmm0, -0x34(%rbp)
jmp 0xaec9b
movl $0x202e2e, -0x60(%rbp)  # imm = 0x202E2E
leaq 0x28d57e(%rip), %rdi    # 0x33c220
movq %r12, %rsi
callq 0x96c0
leal 0x1(%r13), %r12d
cmpl $0x3, %r14d
jg 0xaecbc
incl %r14d
movl %ebx, %r15d
jmp 0xaed02
movl %ebx, %edi
movl $0x28, %esi
movl $0xf, %edx
leaq 0x28d551(%rip), %r15    # 0x33c220
movq %r15, %rcx
callq 0xe787
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x77a8b(%rip), %rsi     # 0x12676f
movl %r12d, %edx
xorl %eax, %eax
callq 0x9060
leal 0x1(%rbx), %r15d
leaq 0x169ad7(%rip), %rax    # 0x2187d0
movl (%rax), %eax
addl $0x3, %eax
cmpl %eax, %ebx
jge 0xaed78
movl %r15d, %ebx
cmpl $0x3e7, %r13d           # imm = 0x3E7
movss -0x34(%rbp), %xmm1
movss -0x30(%rbp), %xmm2
movss -0x2c(%rbp), %xmm3
xorps %xmm4, %xmm4
jl 0xaeb86
jmp 0xaed37
xorps %xmm3, %xmm3
xorps %xmm2, %xmm2
xorps %xmm1, %xmm1
movl %ebx, %r15d
jmp 0xaed87
movl %ebx, %r15d
testl %r14d, %r14d
je 0xaed87
leaq 0x28d4dd(%rip), %rcx    # 0x33c220
movl %r15d, %edi
movl $0x28, %esi
movl $0xf, %edx
movss %xmm1, -0x34(%rbp)
movss %xmm2, -0x30(%rbp)
movss %xmm3, -0x2c(%rbp)
callq 0xe787
movss -0x2c(%rbp), %xmm3
movss -0x30(%rbp), %xmm2
movss -0x34(%rbp), %xmm1
incl %r15d
jmp 0xaed87
movss -0x34(%rbp), %xmm1
movss -0x30(%rbp), %xmm2
movss -0x2c(%rbp), %xmm3
ucomiss 0x5e302(%rip), %xmm3    # 0x10d090
divss %xmm3, %xmm2
movss 0x5e2de(%rip), %xmm0    # 0x10d078
addss %xmm0, %xmm2
cvttss2si %xmm2, %eax
movl $0x0, %edx
cmovnel %eax, %edx
cmovpl %eax, %edx
addss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
leaq 0x28d464(%rip), %rbx    # 0x33c220
leaq 0x779b8(%rip), %rsi     # 0x12677b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movl %r15d, %edi
movl $0x28, %esi
movl $0xf, %edx
movq %rbx, %rcx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe787