// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: draw_sun_rays(int, int, int, int)
void draw_sun_rays(int x,int y, int marker_size, int watch)
{
int k;
int thickness;
int ray_len;
int ray_gap;
#define RAY_LEN 4
#define RAY_GAP (marker_size / 3)
int color;
int clip_left_x, clip_right_x;
int clip_top_y, clip_bottom_y;
int NO_CLIP;

   color = sat_colors[YELLOW_SAT_COLOR];

   last_sun_x = x;
   last_sun_y = y;
   last_sun_r = marker_size;

   thickness = 1;
   if(!small_azel()) thickness = 2;

   // erase the satellite map area on the screen
   if((zoom_screen == 'W') || ((zoom_screen == 0) && NO_SATS)) {
      clip_left_x = aclock_x-ACLOCK_R;
      clip_right_x = aclock_x+ACLOCK_R;
      clip_top_y = aclock_y-ACLOCK_R;
      clip_bottom_y = aclock_y+ACLOCK_R;
   }
   else if(watch && ((zoom_screen == 0) || (zoom_screen == 'V'))) {
      clip_left_x = aclock_x-ACLOCK_R;
      clip_right_x = aclock_x+ACLOCK_R;
      clip_top_y = aclock_y-ACLOCK_R;
      clip_bottom_y = aclock_y+ACLOCK_R;
   }
   else {
      clip_left_x = AZEL_X-AZEL_RADIUS;
      clip_right_x = AZEL_X+AZEL_RADIUS;
      clip_top_y = AZEL_Y-AZEL_RADIUS;
      clip_bottom_y = AZEL_Y+AZEL_RADIUS;
   }
//draw_rectangle(clip_left_x,clip_top_y, clip_right_x-clip_left_x,clip_bottom_y-clip_top_y, WHITE);
   clip_right_x -= thickness;
   clip_left_x += thickness;
   clip_top_y += thickness;
   clip_bottom_y -= thickness;
//draw_rectangle(clip_left_x,clip_top_y, clip_right_x-clip_left_x,clip_bottom_y-clip_top_y, RED);

   ray_gap = RAY_GAP;
   ray_len = RAY_LEN;

   k = marker_size + ray_gap;

NO_CLIP = 0;

   if(NO_CLIP || (x+k+ray_len < clip_right_x))  {
      thick_line(x+k,y, x+k+ray_len,y, color, thickness);
   }
   if(NO_CLIP || (x-k-ray_len > clip_left_x)) {
      thick_line(x-k,y, x-k-ray_len,y, color, thickness);
   }
   if(NO_CLIP || (y-k-ray_len > clip_top_y)) {
      thick_line(x,y-k, x,y-k-ray_len, color, thickness);
   }
   if(NO_CLIP || (y+k+ray_len < clip_bottom_y)) {
      thick_line(x,y+k, x,y+k+ray_len, color, thickness);
   }

   k = (int) (((double) k) * 0.707);
   if(NO_CLIP || ((x+k+ray_len < clip_right_x) && (y+k+ray_len < clip_bottom_y))) {
      thick_line(x+k,y+k, x+k+ray_len,y+k+ray_len, color, thickness);
   }
   if(NO_CLIP || ((x-k-ray_len > clip_left_x) && (y+k+ray_len < clip_bottom_y))) {
      thick_line(x-k,y+k, x-k-ray_len,y+k+ray_len, color, thickness);
   }
   if(NO_CLIP || ((x+k+ray_len < clip_right_x) && (y-k-ray_len > clip_top_y))) {
       thick_line(x+k,y-k, x+k+ray_len,y-k-ray_len, color, thickness);
   }
   if(NO_CLIP || ((x-k-ray_len > clip_left_x) && (y-k-ray_len > clip_top_y))) {
      thick_line(x-k,y-k, x-k-ray_len,y-k-ray_len, color, thickness);
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl 0x7b02e(%rip), %eax     # 0x1c96b8
movl %eax, -0x24(%rbp)
movl -0x4(%rbp), %ecx
leaq 0x21e341(%rip), %rax    # 0x36c9d8
movl %ecx, (%rax)
movl -0x8(%rbp), %ecx
leaq 0x21e339(%rip), %rax    # 0x36c9dc
movl %ecx, (%rax)
movl -0xc(%rbp), %ecx
leaq 0x21e331(%rip), %rax    # 0x36c9e0
movl %ecx, (%rax)
movl $0x1, -0x18(%rbp)
callq 0x14e630
cmpl $0x0, %eax
jne 0x14e6c9
movl $0x2, -0x18(%rbp)
leaq 0x21d2b8(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x57, %eax
je 0x14e741
leaq 0x21d2a9(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x14e806
leaq 0x1293be(%rip), %rcx    # 0x277ab0
movabsq $0x105b8b0400, %rax     # imm = 0x105B8B0400
andq (%rcx), %rax
cmpq $0x0, %rax
jne 0x14e741
leaq 0x12baa4(%rip), %rax    # 0x27a1b0
cmpl $0x0, (%rax)
je 0x14e71d
leaq 0x21de8c(%rip), %rax    # 0x36c5a4
cmpl $0x0, (%rax)
je 0x14e741
leaq 0x12938c(%rip), %rax    # 0x277ab0
cmpq $0x400000, (%rax)       # imm = 0x400000
jne 0x14e806
leaq 0x21e45c(%rip), %rax    # 0x36cb94
cmpl $0x0, (%rax)
jne 0x14e806
leaq 0x24be0c(%rip), %rax    # 0x39a554
movl (%rax), %eax
movl %eax, -0x48(%rbp)
leaq 0x24bdfc(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x48(%rbp), %eax
leaq 0x129286(%rip), %rdx    # 0x2779f0
subl (%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x28(%rbp)
leaq 0x24bddc(%rip), %rax    # 0x39a554
movl (%rax), %eax
movl %eax, -0x44(%rbp)
leaq 0x24bdcc(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x44(%rbp), %eax
leaq 0x129256(%rip), %rdx    # 0x2779f0
subl (%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
leaq 0x24bdb0(%rip), %rax    # 0x39a558
movl (%rax), %eax
movl %eax, -0x40(%rbp)
leaq 0x24bd9c(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x40(%rbp), %eax
leaq 0x129226(%rip), %rdx    # 0x2779f0
subl (%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x30(%rbp)
leaq 0x24bd80(%rip), %rax    # 0x39a558
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
leaq 0x24bd6c(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x3c(%rbp), %eax
leaq 0x1291f6(%rip), %rdx    # 0x2779f0
subl (%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x34(%rbp)
jmp 0x14e9b9
cmpl $0x0, -0x10(%rbp)
je 0x14e8f7
leaq 0x21d171(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x14e832
leaq 0x21d162(%rip), %rax    # 0x36b988
movzbl (%rax), %eax
cmpl $0x56, %eax
jne 0x14e8f7
leaq 0x24bd1b(%rip), %rax    # 0x39a554
movl (%rax), %eax
movl %eax, -0x58(%rbp)
leaq 0x24bd0b(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x58(%rbp), %eax
leaq 0x129195(%rip), %rdx    # 0x2779f0
subl (%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x28(%rbp)
leaq 0x24bceb(%rip), %rax    # 0x39a554
movl (%rax), %eax
movl %eax, -0x54(%rbp)
leaq 0x24bcdb(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x54(%rbp), %eax
leaq 0x129165(%rip), %rdx    # 0x2779f0
subl (%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
leaq 0x24bcbf(%rip), %rax    # 0x39a558
movl (%rax), %eax
movl %eax, -0x50(%rbp)
leaq 0x24bcab(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x50(%rbp), %eax
leaq 0x129135(%rip), %rdx    # 0x2779f0
subl (%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x30(%rbp)
leaq 0x24bc8f(%rip), %rax    # 0x39a558
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
leaq 0x24bc7b(%rip), %rax    # 0x39a550
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x4c(%rbp), %eax
leaq 0x129105(%rip), %rdx    # 0x2779f0
subl (%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x34(%rbp)
jmp 0x14e9b7
leaq 0x24bc82(%rip), %rax    # 0x39a580
movl (%rax), %eax
movl %eax, -0x68(%rbp)
leaq 0x24bc62(%rip), %rax    # 0x39a56c
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x68(%rbp), %eax
leaq 0x24bc58(%rip), %rdx    # 0x39a578
subl (%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x28(%rbp)
leaq 0x24bc52(%rip), %rax    # 0x39a580
movl (%rax), %eax
movl %eax, -0x64(%rbp)
leaq 0x24bc32(%rip), %rax    # 0x39a56c
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x64(%rbp), %eax
leaq 0x24bc28(%rip), %rdx    # 0x39a578
subl (%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x2c(%rbp)
leaq 0x24bc26(%rip), %rax    # 0x39a584
movl (%rax), %eax
movl %eax, -0x60(%rbp)
leaq 0x24bc02(%rip), %rax    # 0x39a56c
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x60(%rbp), %eax
leaq 0x24bbf8(%rip), %rdx    # 0x39a578
subl (%rdx), %ecx
subl %ecx, %eax
movl %eax, -0x30(%rbp)
leaq 0x24bbf6(%rip), %rax    # 0x39a584
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
leaq 0x24bbd2(%rip), %rax    # 0x39a56c
movl (%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x5c(%rbp), %eax
leaq 0x24bbc8(%rip), %rdx    # 0x39a578
subl (%rdx), %ecx
addl %ecx, %eax
movl %eax, -0x34(%rbp)
jmp 0x14e9b9
movl -0x18(%rbp), %ecx
movl -0x2c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x2c(%rbp)
movl -0x18(%rbp), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x18(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x18(%rbp), %ecx
movl -0x34(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x34(%rbp)
movl -0xc(%rbp), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, -0x20(%rbp)
movl $0x4, -0x1c(%rbp)
movl -0xc(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x14ea1a
movl -0x4(%rbp), %eax
addl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x14ea45
movl -0x4(%rbp), %edi
addl -0x14(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0x4(%rbp), %edx
addl -0x14(%rbp), %edx
addl -0x1c(%rbp), %edx
movl -0x8(%rbp), %ecx
movl -0x24(%rbp), %eax
movb %al, %r8b
movl -0x18(%rbp), %eax
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x11710
cmpl $0x0, -0x38(%rbp)
jne 0x14ea59
movl -0x4(%rbp), %eax
subl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x14ea84
movl -0x4(%rbp), %edi
subl -0x14(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0x4(%rbp), %edx
subl -0x14(%rbp), %edx
subl -0x1c(%rbp), %edx
movl -0x8(%rbp), %ecx
movl -0x24(%rbp), %eax
movb %al, %r8b
movl -0x18(%rbp), %eax
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x11710
cmpl $0x0, -0x38(%rbp)
jne 0x14ea98
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jle 0x14eac3
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
subl -0x14(%rbp), %esi
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
subl -0x14(%rbp), %ecx
subl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %eax
movb %al, %r8b
movl -0x18(%rbp), %eax
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x11710
cmpl $0x0, -0x38(%rbp)
jne 0x14ead7
movl -0x8(%rbp), %eax
addl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x14eb02
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
addl -0x14(%rbp), %esi
movl -0x4(%rbp), %edx
movl -0x8(%rbp), %ecx
addl -0x14(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %eax
movb %al, %r8b
movl -0x18(%rbp), %eax
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x11710
cvtsi2sdl -0x14(%rbp), %xmm0
movsd 0x40631(%rip), %xmm1    # 0x18f140
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x14eb3c
movl -0x4(%rbp), %eax
addl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x14eb70
movl -0x8(%rbp), %eax
addl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x14eb70
movl -0x4(%rbp), %edi
addl -0x14(%rbp), %edi
movl -0x8(%rbp), %esi
addl -0x14(%rbp), %esi
movl -0x4(%rbp), %edx
addl -0x14(%rbp), %edx
addl -0x1c(%rbp), %edx
movl -0x8(%rbp), %ecx
addl -0x14(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %eax
movb %al, %r8b
movl -0x18(%rbp), %eax
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x11710
cmpl $0x0, -0x38(%rbp)
jne 0x14eb92
movl -0x4(%rbp), %eax
subl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x14ebc6
movl -0x8(%rbp), %eax
addl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x14ebc6
movl -0x4(%rbp), %edi
subl -0x14(%rbp), %edi
movl -0x8(%rbp), %esi
addl -0x14(%rbp), %esi
movl -0x4(%rbp), %edx
subl -0x14(%rbp), %edx
subl -0x1c(%rbp), %edx
movl -0x8(%rbp), %ecx
addl -0x14(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %eax
movb %al, %r8b
movl -0x18(%rbp), %eax
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x11710
cmpl $0x0, -0x38(%rbp)
jne 0x14ebe8
movl -0x4(%rbp), %eax
addl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x14ec1c
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jle 0x14ec1c
movl -0x4(%rbp), %edi
addl -0x14(%rbp), %edi
movl -0x8(%rbp), %esi
subl -0x14(%rbp), %esi
movl -0x4(%rbp), %edx
addl -0x14(%rbp), %edx
addl -0x1c(%rbp), %edx
movl -0x8(%rbp), %ecx
subl -0x14(%rbp), %ecx
subl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %eax
movb %al, %r8b
movl -0x18(%rbp), %eax
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x11710
cmpl $0x0, -0x38(%rbp)
jne 0x14ec3e
movl -0x4(%rbp), %eax
subl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x14ec72
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
subl -0x1c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jle 0x14ec72
movl -0x4(%rbp), %edi
subl -0x14(%rbp), %edi
movl -0x8(%rbp), %esi
subl -0x14(%rbp), %esi
movl -0x4(%rbp), %edx
subl -0x14(%rbp), %edx
subl -0x1c(%rbp), %edx
movl -0x8(%rbp), %ecx
subl -0x14(%rbp), %ecx
subl -0x1c(%rbp), %ecx
movl -0x24(%rbp), %eax
movb %al, %r8b
movl -0x18(%rbp), %eax
movzbl %r8b, %r8d
movzbl %al, %r9d
callq 0x11710
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)