// File: /workspace/github_cpp_makefile_star2_O1/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 %ecx, %r15d
movl %edx, %r13d
movl %esi, %r10d
movl %edi, %ebx
leaq 0x217c0e(%rip), %r14    # 0x30c798
movl (%r14), %eax
testl %eax, %eax
js 0xf4d1c
testl %eax, %eax
je 0xf4bb8
movl (%r14), %eax
testl %eax, %eax
js 0xf4d53
cmpl %ebx, %eax
jne 0xf4bb8
leaq 0x218919(%rip), %rax    # 0x30d4c8
xorl %ecx, %ecx
testb $0x1, (%rax)
cmovnel %ecx, %r8d
leaq 0x2467cd(%rip), %rax    # 0x33b38c
movl (%rax), %eax
cmpl $0xa0, %eax
setge %bl
leaq 0x217bd8(%rip), %rcx    # 0x30c7a8
movzbl (%rcx), %edi
testl %edi, %edi
setne -0x40(%rbp)
cmpl $0x57, %edi
je 0xf4c3f
leaq 0x2467bf(%rip), %rcx    # 0x33b3a4
leaq 0x2467b4(%rip), %rsi    # 0x33b3a0
leaq 0x2467a5(%rip), %rdx    # 0x33b398
testl %edi, %edi
jne 0xf4c5d
leaq 0x123cd2(%rip), %rdi    # 0x2188d0
movq (%rdi), %rdi
movabsq $0x105b8b0400, %r11     # imm = 0x105B8B0400
testq %r11, %rdi
jne 0xf4c3f
leaq 0x1263b9(%rip), %r11    # 0x21afd0
cmpl $0x0, (%r11)
je 0xf4c2a
leaq 0x2187a0(%rip), %r11    # 0x30d3c4
cmpl $0x0, (%r11)
je 0xf4c3f
cmpq $0x400000, %rdi         # imm = 0x400000
jne 0xf4c5d
leaq 0x218d7a(%rip), %rdi    # 0x30d9b4
cmpl $0x0, (%rdi)
jne 0xf4c5d
leaq 0x24672a(%rip), %rax    # 0x33b370
movl (%rax), %eax
leaq 0x246729(%rip), %rcx    # 0x33b378
leaq 0x24671e(%rip), %rsi    # 0x33b374
leaq 0x123bb3(%rip), %rdx    # 0x218810
movl (%rsi), %esi
movq %rsi, -0x50(%rbp)
movl %eax, %r12d
shrl $0x1f, %r12d
addl %eax, %r12d
sarl %r12d
subl (%rdx), %r12d
movl (%rcx), %r14d
leaq 0x1267af(%rip), %rax    # 0x21b42c
movl (%rax), %eax
cmpq $0x5, %rax
ja 0xf4d88
leaq 0x36548(%rip), %rcx     # 0x12b1d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb %bl, -0x44(%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, %r11d
cmovgel %eax, %r11d
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 %r10, %rbx
movl %r10d, %edi
subl %r11d, %edi
movq %r13, -0x38(%rbp)
movl %r13d, %esi
subl %ecx, %esi
movq %r11, -0x58(%rbp)
leal (%r11,%r11), %edx
addl %ecx, %ecx
movl %r9d, -0x2c(%rbp)
testl %r9d, %r9d
movl %r8d, -0x3c(%rbp)
je 0xf4e64
callq 0xf30c
jmp 0xf4e69
cmpl $-0x2, %eax
je 0xf50e0
cmpl $-0x1, %eax
movl $0x0, %eax
jne 0xf4b95
movl %r8d, -0x3c(%rbp)
movq %r10, %r12
movl %r9d, -0x2c(%rbp)
callq 0xaddb5
movl -0x2c(%rbp), %r9d
movq %r12, %r10
movl -0x3c(%rbp), %r8d
jmp 0xf4b95
cmpl $-0x2, %eax
je 0xf5224
cmpl $-0x1, %eax
movl $0x0, %eax
jne 0xf4ba4
movl %r8d, %r14d
movq %r10, %r12
movl %r9d, -0x2c(%rbp)
callq 0xaddb5
movl -0x2c(%rbp), %r9d
movq %r12, %r10
movl %r14d, %r8d
jmp 0xf4ba4
movb %bl, -0x44(%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 %r10, %rbx
movl %r10d, %edi
movq %r13, -0x38(%rbp)
movl %r13d, %esi
movl %r8d, -0x3c(%rbp)
movl %r8d, %ecx
movl %r9d, -0x2c(%rbp)
movl %r9d, %r8d
callq 0xf1f0
movq %rax, -0x58(%rbp)
jmp 0xf4e69
movl %r10d, %edi
movl %r13d, %esi
movl %r15d, %edx
movl %r8d, %ecx
movl %r9d, %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf1f0
movb %bl, -0x44(%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 %r10, %rbx
movl %r10d, %edi
movq %r13, -0x38(%rbp)
movl %r13d, %esi
movq %rdx, -0x58(%rbp)
movl %r8d, -0x3c(%rbp)
movl %r8d, %ecx
movl %r9d, -0x2c(%rbp)
movl %r9d, %r8d
callq 0xf1f0
jmp 0xf4e69
subl %r15d, %r10d
subl %r15d, %r13d
addl %r15d, %r15d
movl %r10d, %edi
movl %r13d, %esi
movl %r15d, %edx
movl %r15d, %ecx
addq $0x38, %rsp
testl %r9d, %r9d
je 0xf5232
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf30c
callq 0xf296
leaq 0x1265bc(%rip), %rax    # 0x21b42c
movl (%rax), %ecx
movl %ecx, %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0xf4f64
movq %rbx, %r12
leal (%r15,%rbx), %edi
movq -0x38(%rbp), %r14
leal (%r15,%r14), %r13d
subl %r15d, %r14d
movzbl -0x3c(%rbp), %ebx
movl %r13d, %esi
movl %edi, -0x44(%rbp)
movl %edi, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0xe3c3
subl %r15d, %r12d
movl %r12d, %edi
movl %r13d, -0x40(%rbp)
movl %r13d, %esi
movq %r12, -0x50(%rbp)
movl %r12d, %edx
movq %r14, -0x38(%rbp)
movl %r14d, %ecx
movl %ebx, %r8d
callq 0xe3c3
cmpl $0x0, -0x2c(%rbp)
sete %al
testl %r15d, %r15d
setle %cl
orb %al, %cl
jne 0xf4f14
addl %r15d, %r15d
movq -0x50(%rbp), %rax
movl %eax, %r12d
movq -0x38(%rbp), %rax
movl %eax, %r13d
movl -0x40(%rbp), %r14d
movl %r12d, %edi
movl %r13d, %esi
movl %r12d, %edx
movl %r14d, %ecx
movl %ebx, %r8d
callq 0xe3c3
decl %r14d
incl %r13d
incl %r12d
decl %r15d
jne 0xf4ef2
cmpl $0x0, -0x3c(%rbp)
movq -0x50(%rbp), %r15
je 0xf5276
movl %r15d, %edi
movl -0x40(%rbp), %r13d
movl %r13d, %esi
movl -0x44(%rbp), %r12d
movl %r12d, %edx
movq -0x38(%rbp), %r14
movl %r14d, %ecx
movl %ebx, %r8d
callq 0xe3c3
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 0xe3c3
movb -0x44(%rbp), %al
orb -0x40(%rbp), %al
movzbl %al, %edx
incl %edx
movq -0x50(%rbp), %rsi
leal (%r12,%rsi), %r13d
subl %r12d, %esi
movl %r14d, %eax
subl %r12d, %eax
addl %r12d, %r14d
subl %edx, %r13d
addl %edx, %esi
movq %rsi, -0x50(%rbp)
addl %edx, %eax
subl %edx, %r14d
cmpl $0x4, %ecx
movl -0x3c(%rbp), %r11d
movq %rbx, %r10
je 0xf50ee
cmpl $0x5, %ecx
leaq 0x2177fd(%rip), %r12    # 0x30c7a8
jne 0xf5276
movb (%r12), %cl
movl $0x4, %r9d
testb %cl, %cl
jne 0xf4fe4
movq -0x38(%rbp), %rdx
addl %r15d, %edx
cmpl %eax, %edx
jle 0xf5276
movq -0x38(%rbp), %rax
subl %r15d, %eax
movl $0x3, %r9d
cmpl %r14d, %eax
jge 0xf5276
testb %cl, %cl
movl %r13d, -0x40(%rbp)
jne 0xf4ff8
leal (%r15,%r10), %eax
addl $-0x2, %eax
cmpl %r13d, %eax
jg 0xf502d
leal (%r15,%r10), %edi
addl $-0x2, %edi
movq -0x38(%rbp), %rax
leal (%r15,%rax), %esi
movl %eax, %ecx
subl %r15d, %ecx
movzbl %r11b, %r8d
movl %edi, %edx
movl %r11d, %ebx
movq %r10, %r14
movq %r9, %r13
callq 0xed0e
movq %r13, %r9
movl -0x40(%rbp), %r13d
movq %r14, %r10
movl %ebx, %r11d
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movl %r10d, %r14d
subl %r15d, %r14d
cmpb $0x0, (%r12)
jne 0xf5045
cmpl -0x50(%rbp), %r14d
jl 0xf5080
movq -0x38(%rbp), %rax
leal (%r15,%rax), %esi
movl %eax, %ecx
subl %r15d, %ecx
movzbl %r11b, %r8d
movl %r14d, %edi
movl %r14d, %edx
movl %r11d, -0x3c(%rbp)
movq %r10, %r12
movq %r9, %r13
callq 0xed0e
movq %r13, %r9
movl -0x40(%rbp), %r13d
movq %r12, %r10
leaq 0x21772c(%rip), %r12    # 0x30c7a8
movl -0x3c(%rbp), %r11d
movq -0x58(%rbp), %rax
subl %eax, %ebx
addl $0x2, %eax
addl %r10d, %r15d
cmpb $0x0, (%r12)
je 0xf5241
movl %r15d, %edi
addl $-0x2, %edi
movq %rax, %r12
leal (%rbx,%r15), %edx
addl $-0x2, %edx
subl %r9d, %edx
movzbl %r11b, %ebx
movq -0x38(%rbp), %r15
movl %r15d, %esi
movl %r15d, %ecx
movl %ebx, %r8d
movq %r9, %r13
callq 0xed0e
addl %r14d, %r12d
leal (%r12,%r13), %edx
decl %edx
movl %r14d, %edi
movl %r15d, %esi
movl %r15d, %ecx
movl %ebx, %r8d
movl %r13d, %r9d
jmp 0xf529b
leaq 0x2176ad(%rip), %rax    # 0x30c794
movl (%rax), %eax
jmp 0xf4b95
leaq 0x2176b3(%rip), %r12    # 0x30c7a8
movb (%r12), %cl
movb $0x4, %dl
testb %cl, %cl
jne 0xf5120
movq -0x38(%rbp), %rdx
addl %r15d, %edx
cmpl %eax, %edx
jle 0xf5276
movq -0x38(%rbp), %rax
subl %r15d, %eax
movb $0x3, %dl
cmpl %r14d, %eax
jge 0xf5276
movzbl %dl, %eax
movl %eax, -0x2c(%rbp)
testb %cl, %cl
jne 0xf5136
leal (%r15,%r10), %eax
addl $-0x2, %eax
cmpl %r13d, %eax
jg 0xf5165
leal (%r15,%r10), %edi
addl $-0x2, %edi
movq -0x38(%rbp), %rax
leal (%r15,%rax), %esi
movl %eax, %ecx
subl %r15d, %ecx
movzbl %r11b, %r8d
movl %edi, %edx
movl %r11d, %ebx
movl -0x2c(%rbp), %r9d
movq %r10, %r14
callq 0xed0e
movq %r14, %r10
movl %ebx, %r11d
movl %r10d, %r14d
subl %r15d, %r14d
cmpb $0x0, (%r12)
jne 0xf5178
cmpl -0x50(%rbp), %r14d
jl 0xf51ab
movq -0x38(%rbp), %rax
leal (%r15,%rax), %esi
movl %eax, %ecx
subl %r15d, %ecx
movzbl %r11b, %r8d
movl %r14d, %edi
movl %r14d, %edx
movl %r11d, %ebx
movl -0x2c(%rbp), %r9d
movq %r10, %r12
callq 0xed0e
movq %r12, %r10
leaq 0x217600(%rip), %r12    # 0x30c7a8
movl %ebx, %r11d
cmpb $0x0, (%r12)
jne 0xf51be
leal (%r15,%r10), %eax
addl $-0x2, %eax
cmpl %r13d, %eax
jg 0xf51f1
leal (%r15,%r10), %edx
leal (%r15,%r10), %edi
addl $-0x2, %edi
movq -0x58(%rbp), %rcx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
subl %eax, %edx
movzbl %r11b, %r8d
movq -0x38(%rbp), %rcx
movl %ecx, %esi
movl %r11d, %ebx
movl -0x2c(%rbp), %r9d
callq 0xed0e
movl %ebx, %r11d
cmpb $0x0, (%r12)
jne 0xf51fe
cmpl -0x50(%rbp), %r14d
jl 0xf5276
movq -0x58(%rbp), %rcx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
leal (%r14,%rax), %edx
decl %edx
movzbl %r11b, %r8d
movl %r14d, %edi
movq -0x38(%rbp), %rcx
movl %ecx, %esi
movl -0x2c(%rbp), %r9d
jmp 0xf529b
leaq 0x217569(%rip), %rax    # 0x30c794
movl (%rax), %eax
jmp 0xf4ba4
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xf296
movq %rax, %r12
leal -0x1(%r15), %edi
cmpl %r13d, %edi
jg 0xf5270
addl %r15d, %ebx
subl %r9d, %ebx
movzbl %r11b, %r8d
movq -0x38(%rbp), %rcx
movl %ecx, %esi
movl %ebx, %edx
movl %r11d, %ebx
movq %r9, %r15
callq 0xed0e
movq %r15, %r9
movl %ebx, %r11d
cmpl -0x50(%rbp), %r14d
jge 0xf5285
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl %r14d, %r12d
leal (%r9,%r12), %edx
decl %edx
movzbl %r11b, %r8d
movl %r14d, %edi
movq -0x38(%rbp), %rcx
movl %ecx, %esi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xed0e