// File: /workspace/github_cpp_makefile_star2_O3/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 0x78a0b(%rip), %rdx     # 0x172eb0
xorps %xmm0, %xmm0
movss (%rdx,%rax,4), %xmm1
ucomiss %xmm0, %xmm1
jne 0xfa4bf
jp 0xfa4bf
incq %rax
cmpq $0x5b, %rax
jne 0xfa4a8
jmp 0xfa504
cmpq $0x5a, %rax
je 0xfa504
xorps %xmm0, %xmm0
xorl %ecx, %ecx
leaq 0x7886f(%rip), %rsi     # 0x172d40
xorps %xmm3, %xmm3
movss (%rdx,%rcx,4), %xmm2
ucomiss %xmm0, %xmm2
jne 0xfa4e0
jnp 0xfa4f1
movss (%rsi,%rcx,4), %xmm1
divss %xmm2, %xmm1
ucomiss %xmm3, %xmm1
jbe 0xfa4f1
movaps %xmm1, %xmm3
incq %rcx
cmpq $0x5b, %rcx
jne 0xfa4d4
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm3
jne 0xfa513
jp 0xfa513
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movss (%rsi,%rax,4), %xmm0
divss (%rdx,%rax,4), %xmm0
divss %xmm3, %xmm0
movss 0x12b43(%rip), %xmm4    # 0x10d06c
minss %xmm0, %xmm4
leaq 0x240e58(%rip), %rbx    # 0x33b38c
movl (%rbx), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
leaq 0x240e52(%rip), %r14    # 0x33b398
subl (%r14), %ecx
leal (%rcx,%rcx), %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
leaq 0x240e46(%rip), %r15    # 0x33b3a0
movl (%r15), %eax
subl %ecx, %eax
movss 0x32299(%rip), %xmm0    # 0x12c800
mulss %xmm4, %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %esi
addl %eax, %esi
leaq 0x240e28(%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 0xfa5b3
jnp 0xfa5e2
leaq 0x78786(%rip), %rax     # 0x172d40
movss (%rax,%r13,4), %xmm1
ucomiss %xmm2, %xmm1
jne 0xfa5c7
jnp 0xfa5e2
divss %xmm0, %xmm1
divss %xmm3, %xmm1
movss 0x12a95(%rip), %xmm0    # 0x10d06c
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 0x23b2a(%rip), %xmm1    # 0x11e138
callq 0x94d0
movsd 0xeb45(%rip), %xmm1     # 0x109160
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 0x240d51(%rip), %rax    # 0x33b3a4
addl (%rax), %r12d
movsd -0x58(%rbp), %xmm0
movsd 0x23ad5(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xeaf0(%rip), %xmm0     # 0x109160
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 0xfa6a8
movzbl -0x2d(%rbp), %r8d
movl -0x48(%rbp), %edi
movq -0x50(%rbp), %rsi
movl %r15d, %edx
movl %r12d, %ecx
callq 0xe38a
incq %r13
movl %r12d, %ecx
movl %r15d, %esi
cmpq $0x5b, %r13
leaq 0x240cd0(%rip), %rbx    # 0x33b38c
leaq 0x240ce1(%rip), %r12    # 0x33b3a4
leaq 0x240cd6(%rip), %r15    # 0x33b3a0
leaq 0x787df(%rip), %rdx     # 0x172eb0
movss -0x44(%rbp), %xmm3
xorps %xmm2, %xmm2
jne 0xfa59d
callq 0xfaa32
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 0x23a29(%rip), %xmm1    # 0x11e138
callq 0x94d0
movsd 0xea44(%rip), %xmm1     # 0x109160
divsd %xmm1, %xmm0
callq 0x9710
cvtsd2ss %xmm0, %xmm0
mulss 0x320af(%rip), %xmm0    # 0x12c7e0
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 0x239d4(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xe9ef(%rip), %xmm0     # 0x109160
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss 0x3205e(%rip), %xmm0    # 0x12c7e0
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %eax
addl %r15d, %eax
subl %eax, %r14d
leaq 0x240bf4(%rip), %rax    # 0x33b38c
movl (%rax), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl (%r13), %r12d
leaq 0x240bf2(%rip), %rax    # 0x33b3a0
addl (%rax), %r12d
subl %ecx, %r12d
movsd -0x40(%rbp), %xmm0
movsd 0x23977(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xe992(%rip), %xmm0     # 0x109160
callq 0x9710
cvtsd2ss %xmm0, %xmm0
mulss 0x31ffd(%rip), %xmm0    # 0x12c7dc
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %r15d
addl %r12d, %r15d
leaq 0x240b99(%rip), %rax    # 0x33b38c
movl (%rax), %eax
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
movl (%r13), %r13d
leaq 0x240b97(%rip), %rax    # 0x33b3a4
addl (%rax), %r12d
movsd -0x40(%rbp), %xmm0
movsd 0x2391b(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xe936(%rip), %xmm0     # 0x109160
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss 0x31fa1(%rip), %xmm0    # 0x12c7dc
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 0xec9b
leaq 0x212b8f(%rip), %rax    # 0x30d3fc
cmpl $0x0, (%rax)
je 0xfa504
leaq 0x212837(%rip), %rax    # 0x30d0b4
leaq 0x240b08(%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 0x240aee(%rip), %r13    # 0x33b398
movl (%r13), %r14d
leaq 0x240aeb(%rip), %rax    # 0x33b3a0
addl (%rax), %r14d
subl %edx, %r14d
movsd 0x23875(%rip), %xmm1    # 0x11e138
callq 0x94d0
movsd 0xe890(%rip), %xmm1     # 0x109160
divsd %xmm1, %xmm0
callq 0x9710
cvtsd2ss %xmm0, %xmm0
movss 0x31efb(%rip), %xmm1    # 0x12c7e0
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 0x240a91(%rip), %rax    # 0x33b3a4
addl (%rax), %r14d
movapd -0x40(%rbp), %xmm0
movsd 0x23815(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xe830(%rip), %xmm0     # 0x109160
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss 0x31e9f(%rip), %xmm0    # 0x12c7e0
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 0x240a38(%rip), %rax    # 0x33b3a0
addl (%rax), %r12d
subl %ecx, %r12d
movapd -0x40(%rbp), %xmm0
movsd 0x237bd(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xe7d8(%rip), %xmm0     # 0x109160
callq 0x9710
cvtsd2ss %xmm0, %xmm0
movss 0x31e43(%rip), %xmm1    # 0x12c7dc
mulss %xmm1, %xmm0
mulss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %r15d
addl %r12d, %r15d
leaq 0x2409db(%rip), %rax    # 0x33b38c
movl (%rax), %eax
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
movl (%r13), %r13d
leaq 0x2409d9(%rip), %rax    # 0x33b3a4
addl (%rax), %r12d
movapd -0x40(%rbp), %xmm0
movsd 0x2375d(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xe778(%rip), %xmm0     # 0x109160
callq 0x9080
cvtsd2ss %xmm0, %xmm0
mulss 0x31de3(%rip), %xmm0    # 0x12c7dc
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 0xec9b