// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathmsc.cpp
// Function: draw_sat(int, int, int, int, int, int)
void draw_sat(int prn, int x, int y, int r, int color, int fill)
{
int i,j;
int clip_left_x, clip_right_x;
int clip_top_y, clip_bottom_y;
int thickness;

   // draw the satellite on the map

   if(blink_sat() && (prn == blink_sat()) && (seconds & 1)) {  // blink the specified sat
      color = BLACK;
   }

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

   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 {
      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;
   }
clip_right_x -= thickness;
clip_left_x += thickness;
clip_top_y += thickness;
clip_bottom_y -= thickness;


   if(fancy_sats == ROUND_SATS) {  // simple circular sats
      draw_circle(x,y, r, color, fill);
   }
   else if(fancy_sats == RECT_SATS) {  // simple rectangular sats
      i = j = r;
      if(fill) fill_rectangle(x-i,y-j, i+i,j+j, color);
      else     draw_rectangle(x-i,y-j, i+i,j+j, color);
   }
   else { // fancy sats
      if((fancy_sats == RECT_WINGS) || (fancy_sats == RECT_LINES)) {  // rectangle with wings
         i = (r*4) / 10;
         if(i < 2) i = 2;

         j = (r*3)/4;
         if(j < 3) j = 3;

         if(fill) fill_rectangle(x-i,y-j, i+i,j+j, color);
         else     draw_rectangle(x-i,y-j, i+i,j+j, color);
      }
      else if(fancy_sats == ROUND_LINES) {
         i = r*2/3;
         draw_circle(x,y, r*2/3, color, fill);
      }
      else {  // circle with wings
         draw_circle(x,y, r*2/3, color, fill);
      }

      // draw the wings
      if((fancy_sats == RECT_WINGS) || (fancy_sats == ROUND_WINGS)) {
         line(x+r,y+r, x+r,y-r, color);
         line(x-r,y+r, x-r,y-r, color);

         if(fill) {
            for(i=0-r; i<r; i++) {
               line(x+i,y+i, x+i,y-i, color);
            }
         }
         if(color) {
            line(x-r,y+r, x+r,y-r, color);
            line(x+r,y+r, x-r,y-r, color);
         }
      }
      else if(fancy_sats == RECT_LINES) {
         j = 3;
         i += 2;
         if(zoom_screen) j = 4;
         else if((y+r) <= clip_top_y) return;
         else if((y-r) >= clip_bottom_y) return;

         if(zoom_screen || ((x+r-2) <= clip_right_x)) {
            thick_line(x+r-2,y+r, x+r-2,y-r, color,j);
         }
         if(zoom_screen || ((x-r) >= (clip_left_x))) {
            thick_line(x-r,y+r,   x-r,y-r,   color,j);
         }

         if(zoom_screen) {
            thick_line(x+r-2,y, x+r-2-i-j,  y, color,j);
            thick_line(x-r,y,   x-r+i+(j-1),y, color,j);
         }
         else {
            if((x+r-1) <= clip_right_x) {
               thick_line(x+r-1,y, x+r-i-j-0,y, color,j);
            }
            if((x-r) >= clip_left_x) {
               thick_line(x-r,y,   x-r+i+j-1,y, color,j);
            }
         }
      }
      else if(fancy_sats == ROUND_LINES) {
         j = 3;
         if(zoom_screen) j = 4;
         else if((y+r) <= clip_top_y) return;
         else if((y-r) >= clip_bottom_y) return;

         if(zoom_screen || ((x+r-2) <= clip_right_x)) {
            thick_line(x+r-2,y+r, x+r-2,y-r, color,j);
         }
         if(zoom_screen || ((x-r) >= clip_left_x)) {
            thick_line(x-r,y+r,   x-r,y-r,   color,j);
         }

         if(zoom_screen || ((x+r-2) <= clip_right_x)) {
            thick_line(x+r-2,y, x+r-i/2,y,   color,j);
         }
         if(zoom_screen || ((x-r) >= clip_left_x)) {
            thick_line(x-r,y,   x-r+i/2-1,y, color,j);
         }
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, -0x2c(%rbp)
movl %ecx, %r15d
movl %edx, %r9d
movl %edi, %ebx
leaq 0x21756f(%rip), %r14    # 0x30c798
movl (%r14), %eax
testl %eax, %eax
js 0xf5255
testl %eax, %eax
je 0xf527e
movl (%r14), %eax
testl %eax, %eax
js 0xf53e2
cmpl %ebx, %eax
jne 0xf527e
leaq 0x21827e(%rip), %rax    # 0x30d4c8
xorl %ecx, %ecx
testb $0x1, (%rax)
cmovnel %ecx, %r8d
jmp 0xf527e
cmpl $-0x2, %eax
je 0xf5762
cmpl $-0x1, %eax
jne 0xf527e
movq %r9, %r12
movl %r8d, %r13d
movq %rsi, -0x38(%rbp)
callq 0xae069
movq -0x38(%rbp), %rsi
movl %r13d, %r8d
movq %r12, %r9
jmp 0xf5230
leaq 0x246107(%rip), %rax    # 0x33b38c
movl (%rax), %eax
cmpl $0xa0, %eax
setge %bl
leaq 0x217512(%rip), %rcx    # 0x30c7a8
movzbl (%rcx), %edi
testl %edi, %edi
setne %r13b
cmpl $0x57, %edi
je 0xf5305
leaq 0x2460f9(%rip), %rcx    # 0x33b3a4
leaq 0x2460ee(%rip), %r11    # 0x33b3a0
leaq 0x2460df(%rip), %rdx    # 0x33b398
testl %edi, %edi
jne 0xf5323
leaq 0x12360c(%rip), %rdi    # 0x2188d0
movq (%rdi), %rdi
movabsq $0x105b8b0400, %r10     # imm = 0x105B8B0400
testq %r10, %rdi
jne 0xf5305
leaq 0x125cf3(%rip), %r10    # 0x21afd0
cmpl $0x0, (%r10)
je 0xf52f0
leaq 0x2180da(%rip), %r10    # 0x30d3c4
cmpl $0x0, (%r10)
je 0xf5305
cmpq $0x400000, %rdi         # imm = 0x400000
jne 0xf5323
leaq 0x2186b4(%rip), %rdi    # 0x30d9b4
cmpl $0x0, (%rdi)
jne 0xf5323
leaq 0x246064(%rip), %rax    # 0x33b370
movl (%rax), %eax
leaq 0x246063(%rip), %rcx    # 0x33b378
leaq 0x246058(%rip), %r11    # 0x33b374
leaq 0x1234ed(%rip), %rdx    # 0x218810
movl (%r11), %edi
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
subl (%rdx), %r12d
movl (%rcx), %r14d
leaq 0x1260ec(%rip), %rax    # 0x21b42c
movl (%rax), %eax
cmpq $0x5, %rax
ja 0xf5415
leaq 0x35f55(%rip), %rcx     # 0x12b2a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb %r13b, -0x58(%rbp)
movb %bl, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
leal (,%r15,4), %eax
cltq
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
cmpl $0x3, %eax
movl $0x2, %r10d
cmovgel %eax, %r10d
leal (%r15,%r15,2), %eax
leal (%r15,%r15,2), %edx
addl $0x3, %edx
testl %eax, %eax
cmovnsl %eax, %edx
sarl $0x2, %edx
cmpl $0x4, %edx
movl $0x3, %ecx
cmovgel %edx, %ecx
movq %rsi, %r13
movl %esi, %edi
subl %r10d, %edi
movq %r9, %rbx
movl %r9d, %esi
subl %ecx, %esi
movq %r10, -0x48(%rbp)
leal (%r10,%r10), %edx
addl %ecx, %ecx
cmpl $0x0, -0x2c(%rbp)
movl %r8d, -0x4c(%rbp)
je 0xf54f7
callq 0xf298
jmp 0xf54fc
cmpl $-0x2, %eax
je 0xf583e
cmpl $-0x1, %eax
movl $0x0, %eax
jne 0xf523f
movq %r9, %r14
movl %r8d, %r12d
movq %rsi, %r13
callq 0xae069
movq %r13, %rsi
movl %r12d, %r8d
movq %r14, %r9
jmp 0xf523f
movb %r13b, -0x58(%rbp)
movb %bl, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
leal (%r15,%r15), %eax
cltq
imulq $0x55555556, %rax, %rdx # imm = 0x55555556
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x20, %rdx
addl %eax, %edx
movq %rsi, %r13
movl %esi, %edi
movq %r9, %rbx
movl %r9d, %esi
movl %r8d, -0x4c(%rbp)
movl %r8d, %ecx
movl -0x2c(%rbp), %r8d
callq 0xf17c
movq %rax, -0x48(%rbp)
jmp 0xf54fc
movl %esi, %edi
movl %r9d, %esi
movl %r15d, %edx
movl %r8d, %ecx
movl -0x2c(%rbp), %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf17c
movb %r13b, -0x58(%rbp)
movb %bl, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
leal (%r15,%r15), %eax
cltq
imulq $0x55555556, %rax, %rdx # imm = 0x55555556
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x20, %rdx
addl %eax, %edx
movq %rsi, %r13
movl %esi, %edi
movq %r9, %rbx
movl %r9d, %esi
movq %rdx, -0x48(%rbp)
movl %r8d, -0x4c(%rbp)
movl %r8d, %ecx
movl -0x2c(%rbp), %r8d
callq 0xf17c
jmp 0xf54fc
subl %r15d, %esi
subl %r15d, %r9d
addl %r15d, %r15d
cmpl $0x0, -0x2c(%rbp)
je 0xf584c
movl %esi, %edi
movl %r9d, %esi
movl %r15d, %edx
movl %r15d, %ecx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf298
callq 0xf222
leaq 0x125f29(%rip), %rax    # 0x21b42c
movl (%rax), %ecx
movl %ecx, %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0xf55f6
movq %r13, %r12
leal (%r15,%r13), %edi
movq %rbx, %r14
leal (%r15,%rbx), %r13d
subl %r15d, %r14d
movzbl -0x4c(%rbp), %ebx
movl %r13d, %esi
movl %edi, -0x58(%rbp)
movl %edi, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0xe38a
subl %r15d, %r12d
movl %r12d, %edi
movl %r13d, -0x48(%rbp)
movl %r13d, %esi
movq %r12, -0x38(%rbp)
movl %r12d, %edx
movq %r14, -0x40(%rbp)
movl %r14d, %ecx
movl %ebx, %r8d
callq 0xe38a
cmpl $0x0, -0x2c(%rbp)
sete %al
testl %r15d, %r15d
setle %cl
orb %al, %cl
jne 0xf55a6
addl %r15d, %r15d
movq -0x38(%rbp), %rax
movl %eax, %r12d
movq -0x40(%rbp), %rax
movl %eax, %r13d
movl -0x48(%rbp), %r14d
movl %r12d, %edi
movl %r13d, %esi
movl %r12d, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0xe38a
decl %r14d
incl %r13d
incl %r12d
decl %r15d
jne 0xf5584
cmpl $0x0, -0x4c(%rbp)
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r15
je 0xf590f
movl %r15d, %edi
movl -0x48(%rbp), %r13d
movl %r13d, %esi
movl -0x58(%rbp), %r12d
movl %r12d, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0xe38a
movl %r12d, %edi
movl %r13d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movl %ebx, %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe38a
movb -0x40(%rbp), %al
orb -0x58(%rbp), %al
movzbl %al, %edx
incl %edx
movq -0x38(%rbp), %rsi
leal (%r12,%rsi), %edi
subl %r12d, %esi
movl %r14d, %eax
subl %r12d, %eax
addl %r12d, %r14d
subl %edx, %edi
addl %edx, %esi
movq %rsi, -0x38(%rbp)
addl %edx, %eax
subl %edx, %r14d
cmpl $0x4, %ecx
movq %rbx, %r9
movl -0x4c(%rbp), %r10d
movq %r13, %r11
je 0xf5770
cmpl $0x5, %ecx
leaq 0x217169(%rip), %r13    # 0x30c7a8
jne 0xf590f
cmpb $0x0, (%r13)
je 0xf5954
movl %edi, -0x2c(%rbp)
leal (%r15,%r11), %edi
addl $-0x2, %edi
leal (%r15,%r9), %esi
movl %r9d, %ecx
subl %r15d, %ecx
movl $0x4, %r12d
movzbl %r10b, %r8d
movl %edi, %edx
movq %r9, %rbx
movl %r12d, %r9d
movl %r10d, %r14d
movq %r12, %r13
movq %r11, %r12
callq 0xec9b
movq %r12, %r11
movq %r13, %r12
leaq 0x217117(%rip), %r13    # 0x30c7a8
movl %r14d, %r10d
movq %rbx, %r9
cmpb $0x0, (%r13)
sete %al
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movq -0x48(%rbp), %rcx
subl %ecx, %ebx
addl $0x2, %ecx
movq %rcx, -0x48(%rbp)
movl %r11d, %r14d
subl %r15d, %r14d
testb %al, %al
je 0xf56c5
cmpl -0x38(%rbp), %r14d
jl 0xf586a
leal (%r15,%r9), %esi
movl %r9d, %ecx
subl %r15d, %ecx
movzbl %r10b, %r8d
movl %r14d, %edi
movl %r14d, %edx
movl %r8d, -0x5c(%rbp)
movq %r9, -0x40(%rbp)
movl %r12d, %r9d
movl %r10d, %r13d
movq %r12, -0x58(%rbp)
movq %r11, %r12
callq 0xec9b
movq %r12, %r11
movq -0x58(%rbp), %r12
movl %r13d, %r10d
movq -0x40(%rbp), %r9
leaq 0x2170a0(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
je 0xf586a
leal (%r15,%r11), %eax
leal (%r15,%r11), %edi
addl $-0x2, %edi
leal (%rbx,%rax), %edx
addl $-0x2, %edx
subl %r12d, %edx
movzbl %r12b, %ebx
movl %r9d, %esi
movl %r9d, %ecx
movl -0x5c(%rbp), %r13d
movl %r13d, %r8d
movq %r9, %r15
movl %ebx, %r9d
callq 0xec9b
movq -0x48(%rbp), %rax
addl %r14d, %eax
leal (%r12,%rax), %edx
decl %edx
movl %r14d, %edi
movl %r15d, %esi
movl %r15d, %ecx
movl %r13d, %r8d
movl %ebx, %r9d
jmp 0xf5941
leaq 0x21702b(%rip), %rax    # 0x30c794
movl (%rax), %eax
jmp 0xf5230
leaq 0x217031(%rip), %r13    # 0x30c7a8
cmpb $0x0, (%r13)
je 0xf5988
movl %edi, -0x2c(%rbp)
leal (%r15,%r11), %edi
addl $-0x2, %edi
leal (%r15,%r9), %esi
movl %r9d, %ecx
subl %r15d, %ecx
movb $0x4, %r8b
movq %r9, -0x40(%rbp)
movzbl %r8b, %r9d
movl %r8d, %r14d
movzbl %r10b, %r8d
movl %edi, %edx
movl %r10d, %r12d
movq %r13, %rbx
movq %r11, %r13
callq 0xec9b
movl %r14d, %r8d
movq %r13, %r11
movq %rbx, %r13
movl %r12d, %r10d
movq -0x40(%rbp), %r9
cmpb $0x0, (%rbx)
sete %al
movl %r11d, %r14d
subl %r15d, %r14d
movzbl %r8b, %r12d
testb %al, %al
je 0xf57e6
cmpl -0x38(%rbp), %r14d
jl 0xf58c3
leal (%r15,%r9), %esi
movl %r9d, %ecx
subl %r15d, %ecx
movzbl %r10b, %r8d
movl %r14d, %edi
movl %r14d, %edx
movq %r9, %rbx
movl %r12d, %r9d
movl %r12d, -0x40(%rbp)
movl %r10d, %r12d
movq %r11, %r13
callq 0xec9b
movq %r13, %r11
leaq 0x216f8f(%rip), %r13    # 0x30c7a8
movl %r12d, %r10d
movl -0x40(%rbp), %r12d
movq %rbx, %r9
cmpb $0x0, (%r13)
je 0xf58c3
leal (%r15,%r11), %edx
leal (%r15,%r11), %edi
addl $-0x2, %edi
jmp 0xf58d5
leaq 0x216f4f(%rip), %rax    # 0x30c794
movl (%rax), %eax
jmp 0xf523f
movl %esi, %edi
movl %r9d, %esi
movl %r15d, %edx
movl %r15d, %ecx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf222
leal (%r15,%r11), %edi
decl %edi
cmpl -0x2c(%rbp), %edi
jg 0xf589e
addl %r11d, %r15d
addl %r15d, %ebx
subl %r12d, %ebx
movzbl %r10b, %r8d
movl %r9d, %esi
movl %ebx, %edx
movl %r9d, %ecx
movq %r9, %rbx
movl %r12d, %r9d
movl %r10d, %r15d
callq 0xec9b
movl %r15d, %r10d
movq %rbx, %r9
cmpl -0x38(%rbp), %r14d
jl 0xf590f
movq -0x48(%rbp), %rax
addl %r14d, %eax
leal (%r12,%rax), %edx
decl %edx
movzbl %r10b, %r8d
movl %r14d, %edi
movl %r9d, %esi
movl %r9d, %ecx
movl %r12d, %r9d
jmp 0xf5941
leal (%r15,%r11), %edi
addl $-0x2, %edi
cmpl -0x2c(%rbp), %edi
jg 0xf5909
addl %r11d, %r15d
movl %r15d, %edx
movq -0x48(%rbp), %rcx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
subl %eax, %edx
movzbl %r10b, %r8d
movl %r9d, %esi
movl %r9d, %ecx
movq %r9, %rbx
movl %r12d, %r9d
movl %r10d, %r15d
callq 0xec9b
movl %r15d, %r10d
movq %rbx, %r9
cmpb $0x0, (%r13)
jne 0xf591e
cmpl -0x38(%rbp), %r14d
jge 0xf591e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x48(%rbp), %rcx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
leal (%r14,%rax), %edx
decl %edx
movzbl %r10b, %r8d
movl %r14d, %edi
movl %r9d, %esi
movl %r9d, %ecx
movl %r12d, %r9d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xec9b
leal (%r15,%r9), %esi
cmpl %eax, %esi
jle 0xf590f
movl %r9d, %ecx
subl %r15d, %ecx
cmpl %r14d, %ecx
jge 0xf590f
movl %edi, %edx
leal (%r15,%r11), %edi
addl $-0x2, %edi
movl $0x3, %r12d
movb $0x1, %al
movl %edx, -0x2c(%rbp)
cmpl %edx, %edi
jle 0xf566a
jmp 0xf569f
leal (%r15,%r9), %esi
cmpl %eax, %esi
jle 0xf590f
movl %r9d, %ecx
subl %r15d, %ecx
cmpl %r14d, %ecx
jge 0xf590f
movl %edi, %edx
leal (%r15,%r11), %edi
addl $-0x2, %edi
movb $0x3, %r8b
movb $0x1, %al
movl %edx, -0x2c(%rbp)
cmpl %edx, %edi
jle 0xf5799
jmp 0xf57ce