// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathmsc.cpp
// Function: draw_watch_sun()
void draw_watch_sun()
{
double az, el;
int x0,y0;
int r;
int x, y;

   if(have_sun_el == 0) return;
   if(zoom_screen == 'B') return;   // use the sun from the sat map
   if(zoom_screen == 'W') ;
   else if(zoom_screen == 'V') ;
   else if(map_and_watch) return;   // sun was part of the satellite map display
   if(SUN_PRN == 0) return;
   if(no_sun_moon & 0x01) return;

   x0 = aclock_x;
   y0 = aclock_y;
   r = ACLOCK_R;

   el = sun_el;
   if(el < 0.0) el = 0.0 - el;
   if((el < 0.0F) || (el > 90.0F)) return;
   el = (el - 90.0F) / 90.0F;

   az = sun_az;
   if((az < 0.0F) || (az >= 360.0F)) return;
   az += 90.0F;
   if(az > 360.0) az -= 360.0;

   x = x0 + (int) (el * cos360(az) * r);
   if(x > x0) x -= 1;   // clipping tweak
   else       x += 1;
   y = y0 + (int) (el * sin360(az) * r);

   if(sun_el >= 0.0) draw_circle(x,y, r/16, YELLOW, 1);
   else              draw_circle(x,y, r/16, YELLOW, 0);

   draw_sun_rays(x,y, r/16, 1);
// draw_sun_rays(x,y, set_marker_size(SUN_PRN), 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x2195c1(%rip), %rax    # 0x2f77c8
cmpl $0x0, (%rax)
je 0xde3f4
leaq 0x218591(%rip), %rax    # 0x2f67a8
movb (%rax), %al
cmpb $0x42, %al
je 0xde3f4
andb $-0x2, %al
cmpb $0x56, %al
je 0xde237
leaq 0x1271e2(%rip), %rax    # 0x205410
cmpb $0x0, (%rax)
jne 0xde3f4
leaq 0x7ca2a(%rip), %rax     # 0x15ac68
testb $0x1, (%rax)
jne 0xde3f4
leaq 0x247122(%rip), %rax    # 0x325370
movl (%rax), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
leaq 0x21955b(%rip), %r12    # 0x2f77b8
movsd (%r12), %xmm0
xorpd %xmm1, %xmm1
xorpd %xmm2, %xmm2
subsd %xmm0, %xmm2
movapd %xmm0, %xmm3
cmpltsd %xmm1, %xmm3
andpd %xmm3, %xmm2
andnpd %xmm0, %xmm3
orpd %xmm2, %xmm3
ucomisd %xmm3, %xmm1
ja 0xde3f4
ucomisd 0x176fa(%rip), %xmm3    # 0xf5990
ja 0xde3f4
movl %eax, %ebx
leaq 0x21952b(%rip), %rax    # 0x2f77d0
movsd (%rax), %xmm4
ucomisd %xmm4, %xmm1
ja 0xde3f4
ucomisd 0x29ef5(%rip), %xmm4    # 0x1081b0
jae 0xde3f4
leaq 0x2470ac(%rip), %rax    # 0x325374
movl (%rax), %r14d
leaq 0x2470a6(%rip), %rax    # 0x325378
leaq 0x124537(%rip), %rcx    # 0x202810
subl (%rcx), %ebx
addsd 0x3837d(%rip), %xmm3    # 0x116660
movl (%rax), %r13d
movsd 0x176a2(%rip), %xmm1    # 0xf5990
divsd %xmm1, %xmm3
movapd %xmm3, -0x40(%rbp)
addsd %xmm1, %xmm4
movsd 0x37705(%rip), %xmm1    # 0x115a08
addsd %xmm4, %xmm1
movsd 0x29ea1(%rip), %xmm2    # 0x1081b0
movapd %xmm2, %xmm0
cmpltsd %xmm4, %xmm0
andpd %xmm0, %xmm1
andnpd %xmm4, %xmm0
orpd %xmm1, %xmm0
movapd %xmm0, -0x50(%rbp)
movapd %xmm2, %xmm1
callq 0x94d0
divsd 0x14e26(%rip), %xmm0    # 0xf3160
callq 0x9710
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd -0x40(%rbp), %xmm0
cvtsi2sd %ebx, %xmm1
movsd %xmm1, -0x30(%rbp)
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
addl %eax, %r14d
xorl %ecx, %ecx
testl %eax, %eax
setle %cl
leal (%r14,%rcx,2), %r14d
decl %r14d
movapd -0x50(%rbp), %xmm0
movsd 0x29e35(%rip), %xmm1    # 0x1081b0
callq 0x94d0
divsd 0x14dd8(%rip), %xmm0    # 0xf3160
callq 0x9080
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd -0x40(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
cvttsd2si %xmm0, %r15d
addl %r13d, %r15d
movsd (%r12), %xmm0
xorpd %xmm1, %xmm1
xorl %r8d, %r8d
ucomisd %xmm1, %xmm0
setae %r8b
pushq $0x10
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
movl %eax, %ebx
pushq $0xe
popq %rcx
movl %r14d, %edi
movl %r15d, %esi
movl %eax, %edx
callq 0xec2f
pushq $0x1
popq %rcx
movl %r14d, %edi
movl %r15d, %esi
movl %ebx, %edx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xdde34
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq