// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathmsc.cpp
// Function: draw_el_levels()
void draw_el_levels()
{
int first_el;
int el;
int x1, y1;
int x2, y2;
float max_db;
float len;
float r;
int color;

   // show signal level versus elevation
   for(first_el=0; first_el<=90; first_el++) {
      if(db_el_count[first_el] != 0.0F) break;
   }
   if(first_el > 89) return;   // no data recorded

   max_db = 0.0F;
   for(el=0; el<=90; el++) {  // find max db value
      if(db_el_count[el]) {
         r = db_el_sum[el] / db_el_count[el];
         if(r > max_db) max_db = r;
      }
   }
   if(max_db == 0.0F) return;

   r = (db_el_sum[first_el] / db_el_count[first_el]) / max_db;
   if(r > 1.0F) r = 1.0F;

   len = (float) (AZEL_RADIUS*2);
   x1 = AZEL_X-AZEL_RADIUS + (int) (r * cos360(0+90) * len);
   y1 = AZEL_Y+AZEL_RADIUS - (int) (r * sin360(0+90) * len);

   for(el=0; el<=90; el++) {
      if(db_el_count[el] && db_el_sum[el]) {
         r = (db_el_sum[el] / db_el_count[el]) / max_db;
         if(r > 1.0F) r = 1.0F;
         color = GREEN;
      }
      else color = BLUE;

      x2 = AZEL_X-AZEL_RADIUS + (int) (r * cos360(el) * len);
      y2 = AZEL_Y+AZEL_RADIUS - (int) (r * sin360(el) * len);

      if(el != 0) line(x1,y1, x2,y2, color);
      x1 = x2;
      y1 = y2;
   }

   el = good_el_level();
   x1 = AZEL_X-AZEL_RADIUS + (int) (0.99F * cos360(el) * len);
   y1 = AZEL_Y+AZEL_RADIUS - (int) (0.99F * sin360(el) * len);
   x2 = AZEL_X-AZEL_RADIUS + (int) (1.03F * cos360(el) * len);
   y2 = AZEL_Y+AZEL_RADIUS - (int) (1.03F * sin360(el) * len);
   thick_line(x1,y1, x2,y2, YELLOW, 3);

   if(have_el_mask) {
      el = (int) el_mask;
      x1 = AZEL_X-AZEL_RADIUS + (int) (0.99F * cos360(el) * len);
      y1 = AZEL_Y+AZEL_RADIUS - (int) (0.99F * sin360(el) * len);
      x2 = AZEL_X-AZEL_RADIUS + (int) (1.03F * cos360(el) * len);
      y2 = AZEL_Y+AZEL_RADIUS - (int) (1.03F * sin360(el) * len);
      thick_line(x1,y1, x2,y2, BLUE, 3);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
xorl %eax, %eax
leaq 0x79163(%rip), %rdx     # 0x172eb0
xorps %xmm0, %xmm0
movss (%rdx,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0xf9d6a
jp 0xf9d6a
incq %rax
cmpq $0x5b, %rax
jne 0xf9d50
movl $0x5b, %eax
cmpl $0x59, %eax
ja 0xf9dae
xorps %xmm0, %xmm0
xorl %ecx, %ecx
leaq 0x78fc5(%rip), %rsi     # 0x172d40
xorps %xmm3, %xmm3
movss (%rdx,%rcx,4), %xmm2
ucomiss %xmm0, %xmm2
jne 0xf9d8a
jnp 0xf9d9b
movss (%rsi,%rcx,4), %xmm1
divss %xmm2, %xmm1
ucomiss %xmm3, %xmm1
jbe 0xf9d9b
movaps %xmm1, %xmm3
incq %rcx
cmpq $0x5b, %rcx
jne 0xf9d7e
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm3
jne 0xf9dbd
jp 0xf9dbd
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %eax
movss (%rsi,%rax,4), %xmm0
divss (%rdx,%rax,4), %xmm0
divss %xmm3, %xmm0
movss 0x131ff(%rip), %xmm4    # 0x10cfd4
minss %xmm0, %xmm4
leaq 0x2415ac(%rip), %rbx    # 0x33b38c
movl (%rbx), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
leaq 0x2415a6(%rip), %r14    # 0x33b398
subl (%r14), %ecx
leal (%rcx,%rcx), %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
leaq 0x24159a(%rip), %r15    # 0x33b3a0
movl (%r15), %eax
subl %ecx, %eax
movss 0x32905(%rip), %xmm0    # 0x12c718
mulss %xmm4, %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %esi
addl %eax, %esi
leaq 0x24157c(%rip), %rax    # 0x33b3a4
addl (%rax), %ecx
movss %xmm4, -0x40(%rbp)
movaps %xmm4, %xmm0
movss %xmm1, -0x2c(%rbp)
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
subl %eax, %ecx
xorl %r13d, %r13d
movss %xmm3, -0x44(%rbp)
movss (%rdx,%r13,4), %xmm0
movb $0x9, %dl
ucomiss %xmm2, %xmm0
movq %rcx, -0x50(%rbp)
movl %esi, -0x48(%rbp)
jne 0xf9e5f
jnp 0xf9e8e
leaq 0x78eda(%rip), %rax     # 0x172d40
movss (%rax,%r13,4), %xmm1
ucomiss %xmm2, %xmm1
jne 0xf9e73
jnp 0xf9e8e
divss %xmm0, %xmm1
divss %xmm3, %xmm1
movss 0x13151(%rip), %xmm0    # 0x10cfd4
minss %xmm1, %xmm0
movss %xmm0, -0x40(%rbp)
movb $0xa, %dl
movb %dl, -0x2d(%rbp)
movl (%rbx), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, -0x58(%rbp)
movl (%r14), %r12d
addl (%r15), %r12d
subl %ecx, %r12d
movsd 0x241d6(%rip), %xmm1    # 0x11e090
callq 0x94d0
movsd 0xf291(%rip), %xmm1     # 0x109158
divsd %xmm1, %xmm0
callq 0x9710
cvtsd2ss %xmm0, %xmm0
mulss -0x40(%rbp), %xmm0
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %r15d
addl %r12d, %r15d
movl (%rbx), %eax
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
movl (%r14), %ebx
leaq 0x2414a5(%rip), %rax    # 0x33b3a4
addl (%rax), %r12d
movsd -0x58(%rbp), %xmm0
movsd 0x24181(%rip), %xmm1    # 0x11e090
callq 0x94d0
divsd 0xf23c(%rip), %xmm0     # 0x109158
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss -0x40(%rbp), %xmm0
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %eax
addl %ebx, %eax
subl %eax, %r12d
testq %r13, %r13
je 0xf9f54
movzbl -0x2d(%rbp), %r8d
movl -0x48(%rbp), %edi
movq -0x50(%rbp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
callq 0xe3c3
incq %r13
movl %r12d, %ecx
movl %r15d, %esi
cmpq $0x5b, %r13
leaq 0x241424(%rip), %rbx    # 0x33b38c
leaq 0x241435(%rip), %r12    # 0x33b3a4
leaq 0x24142a(%rip), %r15    # 0x33b3a0
leaq 0x78f33(%rip), %rdx     # 0x172eb0
movss -0x44(%rbp), %xmm3
xorps %xmm2, %xmm2
jne 0xf9e49
callq 0xfa2de
movl (%rbx), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x40(%rbp)
movq %r14, %r13
movl (%r14), %r14d
addl (%r15), %r14d
subl %edx, %r14d
movsd 0x240d5(%rip), %xmm1    # 0x11e090
callq 0x94d0
movsd 0xf190(%rip), %xmm1     # 0x109158
divsd %xmm1, %xmm0
callq 0x9710
cvtsd2ss %xmm0, %xmm0
mulss 0x3271b(%rip), %xmm0    # 0x12c6f8
mulss -0x2c(%rbp), %xmm0
movq %rbx, %rax
cvttss2si %xmm0, %ebx
addl %r14d, %ebx
movl (%rax), %eax
movl %eax, %r14d
shrl $0x1f, %r14d
addl %eax, %r14d
sarl %r14d
movl (%r13), %r15d
addl (%r12), %r14d
movsd -0x40(%rbp), %xmm0
movsd 0x24080(%rip), %xmm1    # 0x11e090
callq 0x94d0
divsd 0xf13b(%rip), %xmm0     # 0x109158
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss 0x326ca(%rip), %xmm0    # 0x12c6f8
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %eax
addl %r15d, %eax
subl %eax, %r14d
leaq 0x241348(%rip), %rax    # 0x33b38c
movl (%rax), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl (%r13), %r12d
leaq 0x241346(%rip), %rax    # 0x33b3a0
addl (%rax), %r12d
subl %ecx, %r12d
movsd -0x40(%rbp), %xmm0
movsd 0x24023(%rip), %xmm1    # 0x11e090
callq 0x94d0
divsd 0xf0de(%rip), %xmm0     # 0x109158
callq 0x9710
cvtsd2ss %xmm0, %xmm0
mulss 0x32669(%rip), %xmm0    # 0x12c6f4
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %r15d
addl %r12d, %r15d
leaq 0x2412ed(%rip), %rax    # 0x33b38c
movl (%rax), %eax
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
movl (%r13), %r13d
leaq 0x2412eb(%rip), %rax    # 0x33b3a4
addl (%rax), %r12d
movsd -0x40(%rbp), %xmm0
movsd 0x23fc7(%rip), %xmm1    # 0x11e090
callq 0x94d0
divsd 0xf082(%rip), %xmm0     # 0x109158
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss 0x3260d(%rip), %xmm0    # 0x12c6f4
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %eax
addl %r13d, %eax
subl %eax, %r12d
movl %ebx, %edi
movl %r14d, %esi
movl %r15d, %edx
movl %r12d, %ecx
movl $0xe, %r8d
movl $0x3, %r9d
callq 0xed0e
leaq 0x2132e3(%rip), %rax    # 0x30d3fc
cmpl $0x0, (%rax)
je 0xf9dae
leaq 0x212f8b(%rip), %rax    # 0x30d0b4
leaq 0x24125c(%rip), %rdx    # 0x33b38c
movl (%rdx), %ecx
movq %rdx, %r15
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
movss (%rax), %xmm0
cvttps2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
movapd %xmm0, -0x40(%rbp)
leaq 0x241242(%rip), %r13    # 0x33b398
movl (%r13), %r14d
leaq 0x24123f(%rip), %rax    # 0x33b3a0
addl (%rax), %r14d
subl %edx, %r14d
movsd 0x23f21(%rip), %xmm1    # 0x11e090
callq 0x94d0
movsd 0xefdc(%rip), %xmm1     # 0x109158
divsd %xmm1, %xmm0
callq 0x9710
cvtsd2ss %xmm0, %xmm0
movss 0x32567(%rip), %xmm1    # 0x12c6f8
mulss %xmm1, %xmm0
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %ebx
addl %r14d, %ebx
movl (%r15), %eax
movq %r15, %r12
movl %eax, %r14d
shrl $0x1f, %r14d
addl %eax, %r14d
sarl %r14d
movl (%r13), %r15d
leaq 0x2411e5(%rip), %rax    # 0x33b3a4
addl (%rax), %r14d
movapd -0x40(%rbp), %xmm0
movsd 0x23ec1(%rip), %xmm1    # 0x11e090
callq 0x94d0
divsd 0xef7c(%rip), %xmm0     # 0x109158
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss 0x3250b(%rip), %xmm0    # 0x12c6f8
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %eax
addl %r15d, %eax
subl %eax, %r14d
movl (%r12), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl (%r13), %r12d
leaq 0x24118c(%rip), %rax    # 0x33b3a0
addl (%rax), %r12d
subl %ecx, %r12d
movapd -0x40(%rbp), %xmm0
movsd 0x23e69(%rip), %xmm1    # 0x11e090
callq 0x94d0
divsd 0xef24(%rip), %xmm0     # 0x109158
callq 0x9710
cvtsd2ss %xmm0, %xmm0
movss 0x324af(%rip), %xmm1    # 0x12c6f4
mulss %xmm1, %xmm0
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %r15d
addl %r12d, %r15d
leaq 0x24112f(%rip), %rax    # 0x33b38c
movl (%rax), %eax
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
movl (%r13), %r13d
leaq 0x24112d(%rip), %rax    # 0x33b3a4
addl (%rax), %r12d
movapd -0x40(%rbp), %xmm0
movsd 0x23e09(%rip), %xmm1    # 0x11e090
callq 0x94d0
divsd 0xeec4(%rip), %xmm0     # 0x109158
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss 0x3244f(%rip), %xmm0    # 0x12c6f4
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %eax
addl %r13d, %eax
subl %eax, %r12d
movl %ebx, %edi
movl %r14d, %esi
movl %r15d, %edx
movl %r12d, %ecx
movl $0x9, %r8d
movl $0x3, %r9d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xed0e