// File: /workspace/github_cpp_makefile_star2_O1/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 0x21a8e7(%rip), %rax    # 0x30d7c8
cmpl $0x0, (%rax)
je 0xf30dc
leaq 0x2198b7(%rip), %rax    # 0x30c7a8
movb (%rax), %al
cmpb $0x42, %al
je 0xf30dc
andb $-0x2, %al
cmpb $0x56, %al
je 0xf2f11
leaq 0x128508(%rip), %rax    # 0x21b410
cmpb $0x0, (%rax)
jne 0xf30dc
leaq 0x7dd50(%rip), %rax     # 0x170c68
testb $0x1, (%rax)
jne 0xf30dc
leaq 0x21a890(%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 0xf30dc
ucomisd 0x189b0(%rip), %xmm3    # 0x10b910
ja 0xf30dc
leaq 0x21a863(%rip), %rax    # 0x30d7d0
movsd (%rax), %xmm4
ucomisd %xmm4, %xmm1
ja 0xf30dc
ucomisd 0x2b10d(%rip), %xmm4    # 0x11e090
jae 0xf30dc
leaq 0x2483e4(%rip), %rax    # 0x33b374
movl (%rax), %ebx
leaq 0x2483df(%rip), %rax    # 0x33b378
leaq 0x2483d0(%rip), %rcx    # 0x33b370
movl (%rcx), %ecx
movl %ecx, %r12d
shrl $0x1f, %r12d
addl %ecx, %r12d
sarl %r12d
leaq 0x12585a(%rip), %rcx    # 0x218810
subl (%rcx), %r12d
addsd 0x189cf(%rip), %xmm3    # 0x10b990
movl (%rax), %r13d
movsd 0x18944(%rip), %xmm1    # 0x10b910
divsd %xmm1, %xmm3
movapd %xmm3, -0x40(%rbp)
addsd %xmm1, %xmm4
movsd 0x38a07(%rip), %xmm1    # 0x12b9e8
addsd %xmm4, %xmm1
movsd 0x2b0a3(%rip), %xmm2    # 0x11e090
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 0x16140(%rip), %xmm0    # 0x109158
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 0x2b036(%rip), %xmm1    # 0x11e090
callq 0x94d0
divsd 0x160f1(%rip), %xmm0    # 0x109158
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 0xf1f0
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 0xf2b24
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq