// File: /workspace/github_cpp_makefile_star2_O3/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 0x21a222(%rip), %rax    # 0x30d7c8
cmpl $0x0, (%rax)
je 0xf37a1
leaq 0x2191f2(%rip), %rax    # 0x30c7a8
movb (%rax), %al
cmpb $0x42, %al
je 0xf37a1
andb $-0x2, %al
cmpb $0x56, %al
je 0xf35d6
leaq 0x127e43(%rip), %rax    # 0x21b410
cmpb $0x0, (%rax)
jne 0xf37a1
leaq 0x7d68b(%rip), %rax     # 0x170c68
testb $0x1, (%rax)
jne 0xf37a1
leaq 0x21a1cb(%rip), %r15    # 0x30d7b8
movsd (%r15), %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 0xf37a1
ucomisd 0x182f3(%rip), %xmm3    # 0x10b918
ja 0xf37a1
leaq 0x21a19e(%rip), %rax    # 0x30d7d0
movsd (%rax), %xmm4
ucomisd %xmm4, %xmm1
ja 0xf37a1
ucomisd 0x2aaf0(%rip), %xmm4    # 0x11e138
jae 0xf37a1
leaq 0x247d1f(%rip), %rax    # 0x33b374
movl (%rax), %ebx
leaq 0x247d1a(%rip), %rax    # 0x33b378
leaq 0x247d0b(%rip), %rcx    # 0x33b370
movl (%rcx), %ecx
movl %ecx, %r12d
shrl $0x1f, %r12d
addl %ecx, %r12d
sarl %r12d
leaq 0x125195(%rip), %rcx    # 0x218810
subl (%rcx), %r12d
addsd 0x390ba(%rip), %xmm3    # 0x12c740
movl (%rax), %r13d
movsd 0x18287(%rip), %xmm1    # 0x10b918
divsd %xmm1, %xmm3
movapd %xmm3, -0x40(%rbp)
addsd %xmm1, %xmm4
movsd 0x38422(%rip), %xmm1    # 0x12bac8
addsd %xmm4, %xmm1
movsd 0x2aa86(%rip), %xmm2    # 0x11e138
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 0x15a83(%rip), %xmm0    # 0x109160
callq 0x9710
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
movsd %xmm1, -0x30(%rbp)
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
addl %eax, %ebx
xorl %ecx, %ecx
testl %eax, %eax
setle %cl
leal (%rbx,%rcx,2), %ebx
decl %ebx
movapd -0x50(%rbp), %xmm0
movsd 0x2aa19(%rip), %xmm1    # 0x11e138
callq 0x94d0
divsd 0x15a34(%rip), %xmm0    # 0x109160
callq 0x9080
cvtsd2ss %xmm0, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd -0x40(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
cvttsd2si %xmm0, %r14d
addl %r13d, %r14d
movsd (%r15), %xmm0
xorpd %xmm1, %xmm1
xorl %r8d, %r8d
ucomisd %xmm1, %xmm0
setae %r8b
leal 0xf(%r12), %r15d
testl %r12d, %r12d
cmovnsl %r12d, %r15d
sarl $0x4, %r15d
movl %ebx, %edi
movl %r14d, %esi
movl %r15d, %edx
movl $0xe, %ecx
callq 0xf17c
movl %ebx, %edi
movl %r14d, %esi
movl %r15d, %edx
movl $0x1, %ecx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf31e9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq