// File: 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
subq $0x60, %rsp
leaq 0x1aee0f(%rip), %rax    # 0x29bf1e
cmpb $0x0, (%rax)
je 0xed119
jmp 0xed597
leaq 0x18a990(%rip), %rax    # 0x277ab0
cmpq $0x4000, (%rax)         # imm = 0x4000
jne 0xed12e
jmp 0xed597
leaq 0x18a97b(%rip), %rax    # 0x277ab0
cmpq $0x400, (%rax)          # imm = 0x400
jne 0xed143
jmp 0xed597
leaq 0x18a966(%rip), %rax    # 0x277ab0
cmpq $0x800000, (%rax)       # imm = 0x800000
jne 0xed158
jmp 0xed597
leaq 0x18a951(%rip), %rcx    # 0x277ab0
movabsq $0x105b8b0400, %rax     # imm = 0x105B8B0400
andq (%rcx), %rax
cmpq $0x0, %rax
jne 0xed1a6
leaq 0x18d037(%rip), %rax    # 0x27a1b0
cmpl $0x0, (%rax)
je 0xed18a
leaq 0x27f41f(%rip), %rax    # 0x36c5a4
cmpl $0x0, (%rax)
je 0xed1a6
leaq 0x18a91f(%rip), %rax    # 0x277ab0
cmpq $0x400000, (%rax)       # imm = 0x400000
jne 0xed1ab
leaq 0x27f9f3(%rip), %rax    # 0x36cb94
cmpl $0x0, (%rax)
jne 0xed1ab
jmp 0xed597
leaq 0x27e7d6(%rip), %rax    # 0x36b988
cmpb $0x0, (%rax)
je 0xed1bc
jmp 0xed597
movl $0x1, -0x10(%rbp)
movl $0x3e7, -0x14(%rbp)     # imm = 0x3E7
movl $0x1, -0x10(%rbp)
cmpl $0x3e7, -0x10(%rbp)     # imm = 0x3E7
jge 0xed205
movslq -0x10(%rbp), %rcx
leaq 0x1252bb(%rip), %rax    # 0x2124a0
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xed1f6
jp 0xed1f6
jmp 0xed1f8
jmp 0xed205
jmp 0xed1fa
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xed1d1
leaq 0x1b0f14(%rip), %rax    # 0x29e120
movl (%rax), %eax
addl $0x6, %eax
addl $0x5, %eax
movl %eax, -0x4(%rbp)
movl $0x28, -0x8(%rbp)
movl -0x8(%rbp), %ecx
leaq 0xe2c24(%rip), %rax     # 0x1cfe4c
movl %ecx, (%rax)
leaq 0x1b0ea7(%rip), %rax    # 0x29e0d8
movq (%rax), %rdx
leaq 0x2ae1c5(%rip), %rdi    # 0x39b400
leaq 0x9c8b5(%rip), %rsi     # 0x189af7
movb $0x0, %al
callq 0x9060
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl $0xf, %edx
leaq 0x2ae1a5(%rip), %rcx    # 0x39b400
callq 0x10ee0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x4c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x48(%rbp)
movss 0x96157(%rip), %xmm0    # 0x1833e0
movss %xmm0, -0x44(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %edx
leaq 0x2ae15b(%rip), %rdi    # 0x39b400
leaq 0x9c85c(%rip), %rsi     # 0x189b08
movb $0x0, %al
callq 0x9060
movl -0xc(%rbp), %eax
cmpl -0x14(%rbp), %eax
jg 0xed4a4
cmpl $0x0, -0x54(%rbp)
jne 0xed311
jmp 0xed2c7
cmpl $0x3e7, -0xc(%rbp)      # imm = 0x3E7
jge 0xed2f9
movslq -0xc(%rbp), %rcx
leaq 0x1251c5(%rip), %rax    # 0x2124a0
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xed2ec
jp 0xed2ec
jmp 0xed2ee
jmp 0xed2f9
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xed2c7
movl -0xc(%rbp), %edx
leaq 0x2ae0fd(%rip), %rdi    # 0x39b400
leaq 0x9c7fe(%rip), %rsi     # 0x189b08
movb $0x0, %al
callq 0x9060
cmpl $0x3e7, -0xc(%rbp)      # imm = 0x3E7
jl 0xed339
movslq -0xc(%rbp), %rcx
leaq 0x12517b(%rip), %rax    # 0x2124a0
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xed339
jp 0xed339
jmp 0xed4a4
movslq -0xc(%rbp), %rcx
leaq 0x12515c(%rip), %rax    # 0x2124a0
movss (%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xed358
jp 0xed358
jmp 0xed40e
leaq -0x40(%rbp), %rdi
movslq -0xc(%rbp), %rcx
movss 0x845d8(%rip), %xmm0    # 0x171940
leaq 0x125131(%rip), %rax    # 0x2124a0
addss (%rax,%rcx,4), %xmm0
cvttss2si %xmm0, %edx
leaq 0x9c790(%rip), %rsi     # 0x189b0f
movb $0x0, %al
callq 0x9060
movslq -0xc(%rbp), %rcx
leaq 0x12510f(%rip), %rax    # 0x2124a0
movss (%rax,%rcx,4), %xmm0
addss -0x4c(%rbp), %xmm0
movss %xmm0, -0x4c(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x1250f5(%rip), %rax    # 0x2124a0
movss (%rax,%rcx,4), %xmm0
ucomiss -0x48(%rbp), %xmm0
jbe 0xed3cb
movslq -0xc(%rbp), %rcx
leaq 0x1250df(%rip), %rax    # 0x2124a0
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x48(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x1250ca(%rip), %rax    # 0x2124a0
movss (%rax,%rcx,4), %xmm1
movss -0x44(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xed3fa
movslq -0xc(%rbp), %rcx
leaq 0x1250b0(%rip), %rax    # 0x2124a0
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x44(%rbp)
movss 0x8453a(%rip), %xmm0    # 0x17193c
addss -0x50(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
jmp 0xed41e
leaq -0x40(%rbp), %rdi
leaq 0x9c6fb(%rip), %rsi     # 0x189b14
callq 0x9350
leaq -0x40(%rbp), %rsi
leaq 0x2adfd7(%rip), %rdi    # 0x39b400
callq 0x96a0
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
cmpl $0x5, -0x54(%rbp)
jl 0xed496
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl $0xf, %edx
leaq 0x2adfb1(%rip), %rcx    # 0x39b400
callq 0x10ee0
movl -0xc(%rbp), %edx
addl $0x1, %edx
leaq 0x2adf9f(%rip), %rdi    # 0x39b400
leaq 0x9c6a0(%rip), %rsi     # 0x189b08
movb $0x0, %al
callq 0x9060
movl $0x0, -0x54(%rbp)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
leaq 0x18a527(%rip), %rcx    # 0x2779b0
movl (%rcx), %ecx
addl $0x4, %ecx
cmpl %ecx, %eax
jl 0xed494
jmp 0xed4a4
jmp 0xed496
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xed2b3
cmpl $0x0, -0x54(%rbp)
je 0xed4c3
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl $0xf, %edx
leaq 0x2adf44(%rip), %rcx    # 0x39b400
callq 0x10ee0
jmp 0xed4cc
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
movss -0x44(%rbp), %xmm0
movss 0x95f07(%rip), %xmm1    # 0x1833e0
ucomiss %xmm1, %xmm0
jb 0xed4e6
xorps %xmm0, %xmm0
movss %xmm0, -0x44(%rbp)
movss -0x50(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xed4f7
jp 0xed4f7
jmp 0xed514
movss -0x4c(%rbp), %xmm0
divss -0x50(%rbp), %xmm0
movss 0x84437(%rip), %xmm1    # 0x171940
addss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
jmp 0xed51c
xorps %xmm0, %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x44(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x81b63(%rip), %xmm1    # 0x16f090
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x44(%rbp)
movss -0x48(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x81b45(%rip), %xmm1    # 0x16f090
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x48(%rbp)
cvttss2si -0x4c(%rbp), %edx
cvttss2si -0x48(%rbp), %ecx
leaq 0x2ade97(%rip), %rdi    # 0x39b400
leaq 0x9c5a8(%rip), %rsi     # 0x189b18
movb $0x0, %al
callq 0x9060
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
movl $0xf, %edx
leaq 0x2ade6e(%rip), %rcx    # 0x39b400
callq 0x10ee0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)