// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: db_arc(int, int, int, int)
void db_arc(int start, int end, int el, int arc_color)
{
int x1, y1;
int x2, y2;
float elf;
int az;
int color;
int thickness;

   // color in an arc of azimuth at the given elevation.

   thickness = 1;
   if(el) {
      thickness = (AZEL_SIZE+99) / 100;
      if(thickness <= 0) thickness = 1;
   }

   if(start < 0) start += 360;
   elf = ((float)(90 - el)) / 90.0F;
   az = start + 90;
   x1 = AZEL_X - (int) (elf * cos360(az) * AZEL_RADIUS) - (thickness/2)-1;
   y1 = AZEL_Y - (int) (elf * sin360(az) * AZEL_RADIUS) - (thickness/2)-0;

   while(start <= end) {
      az = start + 90;

      if     (el < min_el[start]) color = BLACK;
      else if(el > max_el[start]) color = BLACK;
      else                        color = arc_color;

//    if     (el < min_az_clip[start]) color = BLACK;
//    else if(el > max_az_clip[start]) color = BLACK;
//    else                             color = arc_color;

      if(1) {  // use large dots to draw the arc
         x2 = AZEL_X - (int) (elf * cos360(az) * AZEL_RADIUS); 
         y2 = AZEL_Y - (int) (elf * sin360(az) * AZEL_RADIUS); 
         if(color != BLACK) draw_circle(x2,y2, thickness, color, 1);
      }
      else {   // use thick lines to draw the arc
         x2 = AZEL_X - (int) (elf * cos360(az) * AZEL_RADIUS) - (thickness/2)-1; 
         y2 = AZEL_Y - (int) (elf * sin360(az) * AZEL_RADIUS) - (thickness/2)-0; 
         thick_line(x1,y1, x2,y2, color, thickness);
      }

      x1 = x2;
      y1 = y2;
      ++start;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, -0x3c(%rbp)
movl %esi, %r12d
movl %edx, -0x2c(%rbp)
testl %edx, %edx
je 0xe42af
leaq 0x2410f6(%rip), %rax    # 0x32538c
movl (%rax), %eax
addl $0x63, %eax
pushq $0x64
popq %rcx
cltd
idivl %ecx
cmpl $0x2, %eax
pushq $0x1
popq %rcx
cmovgel %eax, %ecx
movl %ecx, -0x30(%rbp)
jmp 0xe42b5
pushq $0x1
popq %rax
movl %eax, -0x30(%rbp)
leal 0x168(%rdi), %ebx
testl %edi, %edi
cmovnsl %edi, %ebx
pushq $0x5a
popq %rax
subl -0x2c(%rbp), %eax
cvtsi2ss %eax, %xmm0
divss 0x12e32(%rip), %xmm0    # 0xf7104
movss %xmm0, -0x40(%rbp)
leal 0x5a(%rbx), %r15d
cvtsi2sd %r15d, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x23ec3(%rip), %xmm1    # 0x1081b0
callq 0x94d0
divsd 0xee66(%rip), %xmm0     # 0xf3160
callq 0x9710
movsd -0x38(%rbp), %xmm0
movsd 0x23ea4(%rip), %xmm1    # 0x1081b0
callq 0x94d0
divsd 0xee47(%rip), %xmm0     # 0xf3160
callq 0x9080
movslq %ebx, %r14
movslq %r12d, %rax
movq %rax, -0x50(%rbp)
leaq 0x24105d(%rip), %rbx    # 0x32538c
leaq 0x241062(%rip), %r12    # 0x325398
cmpq -0x50(%rbp), %r14
jg 0xe445a
xorl %r13d, %r13d
movl -0x2c(%rbp), %eax
leaq 0x76d83(%rip), %rcx     # 0x15b0d0
cmpl %eax, (%rcx,%r14,4)
jg 0xe436e
movl -0x2c(%rbp), %eax
leaq 0x77323(%rip), %rcx     # 0x15b680
cmpl %eax, (%rcx,%r14,4)
movl -0x3c(%rbp), %r13d
movl $0x0, %eax
cmovll %eax, %r13d
leaq 0x24102b(%rip), %rax    # 0x3253a0
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movl %r15d, -0x38(%rbp)
cvtsi2sd %r15d, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0x23e20(%rip), %xmm1    # 0x1081b0
callq 0x94d0
movsd 0xedc3(%rip), %xmm1     # 0xf3160
divsd %xmm1, %xmm0
callq 0x9710
movsd %xmm0, -0x58(%rbp)
movl (%rbx), %r15d
movl (%r12), %eax
movl %eax, -0x44(%rbp)
leaq 0x240fe8(%rip), %rax    # 0x3253a4
movl (%rax), %ebx
movsd -0x60(%rbp), %xmm0
movsd 0x23de5(%rip), %xmm1    # 0x1081b0
callq 0x94d0
divsd 0xed88(%rip), %xmm0     # 0xf3160
callq 0x9080
testl %r13d, %r13d
je 0xe4444
cvtsd2ss %xmm0, %xmm0
leaq 0x240f9f(%rip), %rax    # 0x32538c
movl (%rax), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
subl (%r12), %eax
cvtsi2ss %eax, %xmm1
movss -0x40(%rbp), %xmm2
mulss %xmm2, %xmm0
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
subl %eax, %ebx
cvtsd2ss -0x58(%rbp), %xmm0
mulss %xmm2, %xmm0
movl %r15d, %eax
cltd
idivl %ecx
subl -0x44(%rbp), %eax
cvtsi2ss %eax, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl -0x48(%rbp), %edi
subl %eax, %edi
movl %ebx, %esi
movl -0x30(%rbp), %edx
movl %r13d, %ecx
pushq $0x1
popq %r8
callq 0xec2f
incq %r14
movl -0x38(%rbp), %r15d
incl %r15d
leaq 0x240f37(%rip), %rbx    # 0x32538c
jmp 0xe4336
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq