// File: /workspace/github_cpp_makefile_star2_O3/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 $0x48, %rsp
movl %ecx, -0x3c(%rbp)
movl %esi, %r14d
movl %edx, -0x2c(%rbp)
testl %edx, %edx
je 0xf9bf3
leaq 0x2417c4(%rip), %rax    # 0x33b38c
movl (%rax), %eax
addl $0x63, %eax
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movl %ecx, -0x30(%rbp)
jmp 0xf9bfa
movl $0x1, -0x30(%rbp)
leal 0x168(%rdi), %ebx
testl %edi, %edi
cmovnsl %edi, %ebx
leal 0x5a(%rbx), %eax
movq %rax, -0x68(%rbp)
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x2451b(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xf536(%rip), %xmm0     # 0x109160
callq 0x9710
movsd -0x38(%rbp), %xmm0
movsd 0x244fc(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xf517(%rip), %xmm0     # 0x109160
callq 0x9080
cmpl %r14d, %ebx
jg 0xf9ddc
movl $0x5a, %eax
subl -0x2c(%rbp), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x13416(%rip), %xmm0    # 0x10d084
movss %xmm0, -0x40(%rbp)
movslq %ebx, %rax
shlq $0x2, %rax
leaq 0x7744f(%rip), %rcx     # 0x1710d0
addq %rax, %rcx
movq %rcx, -0x58(%rbp)
addq 0x562d1(%rip), %rax     # 0x14ff60
movq %rax, -0x50(%rbp)
subl %ebx, %r14d
incl %r14d
movq %r14, -0x60(%rbp)
leaq 0x2416e8(%rip), %rbx    # 0x33b38c
leaq 0x2416ed(%rip), %r12    # 0x33b398
xorl %r15d, %r15d
movl $0x0, %r13d
movl -0x2c(%rbp), %eax
movq -0x58(%rbp), %rcx
cmpl %eax, (%rcx,%r15,4)
jg 0xf9cd9
movl -0x2c(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl %eax, (%rcx,%r15,4)
movl -0x3c(%rbp), %r13d
movl $0x0, %eax
cmovll %eax, %r13d
leaq 0x2416c0(%rip), %rax    # 0x33b3a0
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x68(%rbp), %rax
addl %r15d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd 0x24438(%rip), %xmm1    # 0x11e138
callq 0x94d0
movsd 0xf453(%rip), %xmm1     # 0x109160
divsd %xmm1, %xmm0
callq 0x9710
movsd %xmm0, -0x70(%rbp)
movl (%rbx), %r14d
movl (%r12), %eax
movl %eax, -0x44(%rbp)
leaq 0x241678(%rip), %rax    # 0x33b3a4
movl (%rax), %r12d
movsd -0x38(%rbp), %xmm0
movsd 0x243fc(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0xf417(%rip), %xmm0     # 0x109160
callq 0x9080
testl %r13d, %r13d
je 0xf9dc8
cvtsd2ss %xmm0, %xmm0
movl (%rbx), %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
leaq 0x24162f(%rip), %rax    # 0x33b398
subl (%rax), %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movss -0x40(%rbp), %xmm2
mulss %xmm2, %xmm0
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
subl %eax, %r12d
xorps %xmm0, %xmm0
cvtsd2ss -0x70(%rbp), %xmm0
mulss %xmm2, %xmm0
movl %r14d, %eax
shrl $0x1f, %eax
addl %r14d, %eax
sarl %eax
subl -0x44(%rbp), %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl -0x48(%rbp), %edi
subl %eax, %edi
movl %r12d, %esi
movl -0x30(%rbp), %edx
movl %r13d, %ecx
movl $0x1, %r8d
callq 0xf17c
incq %r15
cmpl %r15d, -0x60(%rbp)
leaq 0x2415c2(%rip), %r12    # 0x33b398
jne 0xf9cae
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq