// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: plot_3d_signals(int)
void plot_3d_signals(int el)
{
int color;
float elf;
int start_az, center_az, end_az;
int saz, eaz;
#define MIN_ARC 1   // minimum pixel expansion size
#define MAX_ARC 44  // maximum pixel exapansion in degrees azimuth
int max_arc;  
int last_max;

   // draw the signal level vs az/el map, filling in sparse data areas as
   // best we can.

   max_arc = last_max = MAX_ARC;
   start_az = 0;
   color = 0;
   while(start_az < 360) {
      center_az = next_az_point(start_az, el);
      end_az = next_az_point(center_az, el);

      // satellite sky coverage has holes towards the poles
      // we better define them by shrinking the max size of the arcs
      // when they are where the holes might be
      last_max = max_arc;
      max_arc = MAX_ARC;
      if((lat < 0.0) || ((lat*RAD_TO_DEG) >= HIGH_LATS)) {
         if     (start_az == 180)  max_arc = MIN_ARC;
         else if(center_az == 180) max_arc = MIN_ARC;
         else if(end_az == 180)    max_arc = MIN_ARC;
      }
      if((lat >= 0.0) || ((lat*RAD_TO_DEG) <= (-HIGH_LATS))) {
         if     (start_az == 0) max_arc = MIN_ARC;
         else if(end_az == 360) max_arc = MIN_ARC;
      }
      end_az = (center_az + end_az) / 2;

      if(db_3d_count[center_az][el] > 0.0F) {
         elf = db_3d_sum[center_az][el] / db_3d_count[center_az][el];
         elf -= min_sig_db;
         if(sig_level_step)            color = (int) (elf / (float) sig_level_step);
         if     (color > LEVEL_COLORS) color = LEVEL_COLORS;
         else if(color <= BLACK)       color = LOW_SIGNAL;
         else                          color = level_color[color];
      }
      else {
         color = BLACK;
      }

      if((start_az == 0) && (color != BLACK)) start_color = color;

      if((center_az - start_az) > max_arc)           saz = center_az - max_arc;
      else if((lat < 0.0F) && (last_max <= MIN_ARC)) saz = center_az - MIN_ARC; 
      else                                           saz = start_az;
      if((end_az - center_az) > max_arc)             eaz = center_az + max_arc;
      else if((lat < 0.0F) && (last_max <= MIN_ARC)) eaz = center_az + MIN_ARC;
      else                                           eaz = end_az;

      if(1 && (saz >= 359)) {
//if(debug_file) fprintf(debug_file, "saz:%d eaz:%d el:%d  color:%d\n", saz,eaz,el,color);
      }
      else if(color != BLACK) {
         db_arc(saz, eaz, el, color);
      }
      else if(end_az >= 360) {
         if(start_color != BLACK) db_arc(saz, eaz, el, start_color);
      }

      start_az = end_az;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, -0x2c(%rbp)
movslq %edi, %rax
movq %rax, -0x38(%rbp)
pushq $0x2c
popq %r8
xorl %r15d, %r15d
xorl %edx, %edx
cmpl $0x167, %r15d           # imm = 0x167
jg 0xe4769
movl %edx, -0x30(%rbp)
movl %r8d, %r12d
movl %r15d, %edi
movl -0x2c(%rbp), %ebx
movl %ebx, %esi
callq 0xe4469
movl %eax, %r14d
movl %eax, %edi
movl %ebx, %esi
callq 0xe4469
xorpd %xmm4, %xmm4
movl %eax, %esi
leaq 0x212a36(%rip), %rax    # 0x2f6fd0
movsd (%rax), %xmm0
ucomisd %xmm0, %xmm4
movapd %xmm0, %xmm1
mulsd 0xebb2(%rip), %xmm1     # 0xf3160
ja 0xe45bd
ucomisd 0x243c0(%rip), %xmm1    # 0x108978
pushq $0x2c
popq %rax
jb 0xe45e4
movl $0xb4, %ecx
cmpl %ecx, %r15d
sete %al
cmpl %ecx, %r14d
sete %cl
orb %al, %cl
pushq $0x1
popq %rax
jne 0xe45e4
cmpl $0xb4, %esi
pushq $0x2c
popq %rax
pushq $0x1
popq %rcx
cmovel %ecx, %eax
ucomisd %xmm4, %xmm0
jae 0xe4600
movsd 0x23d16(%rip), %xmm2    # 0x108308
ucomisd %xmm1, %xmm2
jae 0xe4600
movl %eax, %r13d
movl %r12d, %r8d
jmp 0xe461b
pushq $0x1
popq %r13
testl %r15d, %r15d
movl %r12d, %r8d
je 0xe461b
cmpl $0x168, %esi            # imm = 0x168
pushq $0x1
popq %rcx
cmovel %ecx, %eax
movl %eax, %r13d
addl %r14d, %esi
movl %esi, %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, %r12d
movslq %r14d, %rax
imulq $0x16c, %rax, %rcx      # imm = 0x16C
leaq 0x98b36(%rip), %rax     # 0x17d170
addq %rcx, %rax
movq -0x38(%rbp), %rdx
movss (%rax,%rdx,4), %xmm1
xorl %eax, %eax
ucomiss 0x12ac1(%rip), %xmm1    # 0xf7110
movl $0x0, %ebx
jbe 0xe46c6
leaq 0xb9c27(%rip), %rax     # 0x19e284
movl (%rax), %eax
testl %eax, %eax
movl -0x30(%rbp), %edx
je 0xe4695
addq 0x5598b(%rip), %rcx     # 0x139ff8
movq -0x38(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm2
leaq 0xb9c03(%rip), %rcx     # 0x19e280
cvtsi2ssl (%rcx), %xmm3
divss %xmm1, %xmm2
cvtsi2ss %eax, %xmm1
subss %xmm3, %xmm2
divss %xmm1, %xmm2
cvttss2si %xmm2, %edx
pushq $0xb
popq %rbx
cmpl $0xb, %edx
jg 0xe46b0
pushq $0x8
popq %rbx
testl %edx, %edx
jle 0xe46b0
movl %edx, %eax
leaq 0x6ffa3(%rip), %rcx     # 0x154650
movl (%rcx,%rax,4), %ebx
testl %ebx, %ebx
setne %al
testl %r15d, %r15d
jne 0xe46c6
testl %ebx, %ebx
je 0xe46c6
movl %ebx, 0x3581c0(%rip)    # 0x43c884
movb $0x1, %al
movl %r14d, %ecx
subl %r15d, %ecx
cmpl %r13d, %ecx
jle 0xe46d9
movl %r14d, %edi
subl %r13d, %edi
jmp 0xe46ed
ucomisd %xmm0, %xmm4
leal -0x1(%r14), %edi
cmovbel %r15d, %edi
cmpl $0x2, %r8d
cmovael %r15d, %edi
movl %r12d, %ecx
subl %r14d, %ecx
cmpl %r13d, %ecx
jle 0xe46fd
addl %r13d, %r14d
jmp 0xe4710
incl %r14d
ucomisd %xmm0, %xmm4
cmovbel %r12d, %r14d
cmpl $0x2, %r8d
cmovael %r12d, %r14d
movl %r12d, %r15d
movl %ebx, %edx
movl %r13d, %r8d
cmpl $0x166, %edi            # imm = 0x166
jg 0xe4561
movl %ebx, %ecx
testb %al, %al
jne 0xe4751
cmpl $0x2d0, %esi            # imm = 0x2D0
setge %al
movl 0x35814b(%rip), %ecx    # 0x43c884
testl %ecx, %ecx
setne %dl
andb %al, %dl
movl %r12d, %r15d
movl %r13d, %r8d
cmpb $0x1, %dl
movl %ebx, %edx
jne 0xe4561
movl %r14d, %esi
movl -0x2c(%rbp), %edx
callq 0xe4271
movl %r12d, %r15d
movl %ebx, %edx
movl %r13d, %r8d
jmp 0xe4561
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq