// File: 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
subq $0x60, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl $0x1, -0x30(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x157fc7
leaq 0x2425c4(%rip), %rax    # 0x39a56c
movl (%rax), %eax
addl $0x63, %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jg 0x157fc5
movl $0x1, -0x30(%rbp)
jmp 0x157fc7
cmpl $0x0, -0x4(%rbp)
jge 0x157fd8
movl -0x4(%rbp), %eax
addl $0x168, %eax            # imm = 0x168
movl %eax, -0x4(%rbp)
movl $0x5a, %eax
subl -0xc(%rbp), %eax
cvtsi2ss %eax, %xmm0
movss 0x19964(%rip), %xmm1    # 0x171950
divss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
movl -0x4(%rbp), %eax
addl $0x5a, %eax
movl %eax, -0x28(%rbp)
leaq 0x24257b(%rip), %rax    # 0x39a580
movl (%rax), %eax
movl %eax, -0x44(%rbp)
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
cvtsi2sdl -0x28(%rbp), %xmm0
movsd 0x2ab0f(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x17152(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movss -0x48(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
leaq 0x24251e(%rip), %rax    # 0x39a56c
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x44(%rbp), %eax
leaq 0x242514(%rip), %rdx    # 0x39a578
subl (%rdx), %ecx
cvtsi2ss %ecx, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
subl %ecx, %eax
movl %eax, -0x40(%rbp)
movl -0x30(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x40(%rbp), %eax
subl %ecx, %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
leaq 0x2424ee(%rip), %rax    # 0x39a584
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
cvtsi2sdl -0x28(%rbp), %xmm0
movsd 0x2aa7e(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x170c1(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x9080
movaps %xmm0, %xmm1
movss -0x3c(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
leaq 0x24248d(%rip), %rax    # 0x39a56c
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x38(%rbp), %eax
leaq 0x242483(%rip), %rdx    # 0x39a578
subl (%rdx), %ecx
cvtsi2ss %ecx, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
subl %ecx, %eax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x34(%rbp), %eax
subl %ecx, %eax
subl $0x0, %eax
movl %eax, -0x18(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jg 0x15829e
movl -0x4(%rbp), %eax
addl $0x5a, %eax
movl %eax, -0x28(%rbp)
movl -0xc(%rbp), %eax
movslq -0x4(%rbp), %rdx
leaq 0x7816d(%rip), %rcx     # 0x1d02b0
cmpl (%rcx,%rdx,4), %eax
jge 0x158151
movl $0x0, -0x2c(%rbp)
jmp 0x158175
movl -0xc(%rbp), %eax
movslq -0x4(%rbp), %rdx
leaq 0x78701(%rip), %rcx     # 0x1d0860
cmpl (%rcx,%rdx,4), %eax
jle 0x15816d
movl $0x0, -0x2c(%rbp)
jmp 0x158173
movl -0x10(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x158175
leaq 0x242404(%rip), %rax    # 0x39a580
movl (%rax), %eax
movl %eax, -0x54(%rbp)
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x58(%rbp)
cvtsi2sdl -0x28(%rbp), %xmm0
movsd 0x2a998(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x16fdb(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x96f0
movaps %xmm0, %xmm1
movss -0x58(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
leaq 0x2423a7(%rip), %rax    # 0x39a56c
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x54(%rbp), %eax
leaq 0x24239d(%rip), %rdx    # 0x39a578
subl (%rdx), %ecx
cvtsi2ss %ecx, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
leaq 0x24238f(%rip), %rax    # 0x39a584
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
cvtsi2sdl -0x28(%rbp), %xmm0
movsd 0x2a91f(%rip), %xmm1    # 0x182b30
callq 0x94d0
movsd 0x16f62(%rip), %xmm1    # 0x16f180
divsd %xmm1, %xmm0
callq 0x9080
movaps %xmm0, %xmm1
movss -0x50(%rbp), %xmm0
cvtsd2ss %xmm1, %xmm1
mulss %xmm1, %xmm0
leaq 0x24232e(%rip), %rax    # 0x39a56c
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x4c(%rbp), %eax
leaq 0x242324(%rip), %rdx    # 0x39a578
subl (%rdx), %ecx
cvtsi2ss %ecx, %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
subl %ecx, %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x158284
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x2c(%rbp), %ecx
movl $0x1, %r8d
callq 0x11f00
movl -0x1c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x158120
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)