// File: /workspace/github_cpp_makefile_star2_O2/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, -0x30(%rbp)
movl %r8d, -0x2c(%rbp)
movl %ecx, %r12d
movl %edx, %r15d
movl %esi, %r14d
movl %edi, %ebx
callq 0xdfc8c
testl %eax, %eax
je 0xdfd0a
callq 0xdfc8c
cmpl %ebx, %eax
jne 0xdfd0a
leaq 0x2177cc(%rip), %rax    # 0x2f74c8
xorl %ecx, %ecx
testb $0x1, (%rax)
movl -0x2c(%rbp), %eax
cmovnel %ecx, %eax
movl %eax, -0x2c(%rbp)
leaq 0x24567b(%rip), %rax    # 0x32538c
movl (%rax), %eax
cmpl $0xa0, %eax
setge -0x40(%rbp)
leaq 0x216a85(%rip), %rcx    # 0x2f67a8
movzbl (%rcx), %edi
testl %edi, %edi
setne -0x50(%rbp)
cmpl $0x57, %edi
je 0xdfd92
leaq 0x24566c(%rip), %rcx    # 0x3253a4
leaq 0x245661(%rip), %rdx    # 0x3253a0
leaq 0x245652(%rip), %rsi    # 0x325398
testl %edi, %edi
jne 0xdfdb0
leaq 0x122b7f(%rip), %rdi    # 0x2028d0
movq (%rdi), %rdi
movabsq $0x105b8b0400, %r8      # imm = 0x105B8B0400
testq %r8, %rdi
jne 0xdfd92
leaq 0x125266(%rip), %r8     # 0x204fd0
cmpl $0x0, (%r8)
je 0xdfd7d
leaq 0x21764d(%rip), %r8     # 0x2f73c4
cmpl $0x0, (%r8)
je 0xdfd92
cmpq $0x400000, %rdi         # imm = 0x400000
jne 0xdfdb0
leaq 0x217c27(%rip), %rdi    # 0x2f79b4
cmpl $0x0, (%rdi)
jne 0xdfdb0
leaq 0x2455d7(%rip), %rax    # 0x325370
movl (%rax), %eax
leaq 0x2455d6(%rip), %rcx    # 0x325378
leaq 0x2455cb(%rip), %rdx    # 0x325374
leaq 0x122a60(%rip), %rsi    # 0x202810
movq %r12, -0x58(%rbp)
movq %r14, -0x38(%rbp)
movl (%rdx), %r14d
pushq $0x2
popq %rdi
cltd
idivl %edi
movl %eax, %r13d
subl (%rsi), %r13d
movl (%rcx), %ebx
leaq 0x12565c(%rip), %r12    # 0x20542c
movl (%r12), %eax
pushq $0x4
popq %r9
pushq $0x3
popq %rsi
cmpq $0x5, %rax
ja 0xdfe4d
leaq 0x35400(%rip), %rcx     # 0x1151e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x58(%rbp), %r10
leal (,%r10,4), %eax
pushq $0xa
popq %rcx
cltd
idivl %ecx
movl %eax, %r8d
cmpl $0x3, %eax
cmovll %edi, %r8d
leal (%r10,%r10,2), %eax
cltd
idivl %r9d
cmpl $0x4, %eax
cmovll %esi, %eax
movq -0x38(%rbp), %rcx
movl %ecx, %edi
subl %r8d, %edi
movl %r15d, %esi
subl %eax, %esi
movq %r8, -0x48(%rbp)
leal (%r8,%r8), %edx
addl %eax, %eax
cmpl $0x0, -0x30(%rbp)
je 0xdfef5
movl %eax, %ecx
movl -0x2c(%rbp), %r8d
callq 0xed4b
jmp 0xdff00
movq -0x58(%rbp), %rax
addl %eax, %eax
pushq $0x3
popq %rcx
cltd
idivl %ecx
movq -0x38(%rbp), %rdi
movl %r15d, %esi
movl %eax, %edx
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
callq 0xec2f
movq %rax, -0x48(%rbp)
jmp 0xdff00
movq -0x38(%rbp), %rdi
movl %r15d, %esi
movq -0x58(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xec2f
movq -0x58(%rbp), %rax
addl %eax, %eax
cltd
idivl %esi
movq -0x38(%rbp), %rdi
movl %r15d, %esi
movq %rax, -0x48(%rbp)
movl %eax, %edx
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
callq 0xec2f
jmp 0xdff00
movq -0x38(%rbp), %rdi
movq -0x58(%rbp), %rcx
subl %ecx, %edi
subl %ecx, %r15d
addl %ecx, %ecx
cmpl $0x0, -0x30(%rbp)
je 0xe01ca
movl %r15d, %esi
movl %ecx, %edx
movl -0x2c(%rbp), %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xed4b
movl %eax, %ecx
movl -0x2c(%rbp), %r8d
callq 0xecd5
movl (%r12), %ecx
movl %ecx, %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0xdffae
movq -0x38(%rbp), %rbx
movq -0x58(%rbp), %r12
leal (%r12,%rbx), %edi
leal (%r12,%r15), %r13d
subl %r12d, %r15d
movzbl -0x2c(%rbp), %r14d
movl %r13d, %esi
movl %edi, -0x48(%rbp)
movl %edi, %edx
movl %r15d, %ecx
movl %r14d, %r8d
callq 0xdedf
subl %r12d, %ebx
movl %ebx, %edi
movl %r13d, -0x50(%rbp)
movl %r13d, %esi
movq %rbx, -0x38(%rbp)
movl %ebx, %edx
movq %r15, -0x40(%rbp)
movl %r15d, %ecx
movl %r14d, %r8d
callq 0xdedf
cmpl $0x0, -0x30(%rbp)
je 0xe00de
movl %r12d, %ebx
negl %ebx
cmovsl %r12d, %ebx
addl %r12d, %ebx
movl -0x50(%rbp), %r12d
movq -0x40(%rbp), %rax
movl %eax, %r15d
movq -0x38(%rbp), %rax
movl %eax, %r13d
subl $0x1, %ebx
jb 0xe00de
movl %r13d, %edi
movl %r15d, %esi
movl %r13d, %edx
movl %r12d, %ecx
movl %r14d, %r8d
callq 0xdedf
incl %r13d
incl %r15d
decl %r12d
jmp 0xdff86
movq %r14, %rdi
movb -0x40(%rbp), %al
orb -0x50(%rbp), %al
movzbl %al, %edx
incl %edx
leal (%r14,%r13), %esi
subl %r13d, %edi
movl %ebx, %eax
subl %r13d, %eax
addl %r13d, %ebx
subl %edx, %esi
movl %esi, -0x30(%rbp)
addl %edx, %edi
addl %edx, %eax
subl %edx, %ebx
cmpl $0x4, %ecx
movq -0x58(%rbp), %r12
je 0xe012c
cmpl $0x5, %ecx
movq -0x38(%rbp), %r14
jne 0xe0304
leaq 0x2167b1(%rip), %rcx    # 0x2f67a8
cmpb $0x0, (%rcx)
je 0xe0261
movq %rdi, -0x40(%rbp)
leal (%r12,%r14), %edi
addl $-0x2, %edi
leal (%r12,%r15), %esi
movl %r15d, %ecx
subl %r12d, %ecx
pushq $0x4
popq %rax
movl %eax, %ebx
movzbl -0x2c(%rbp), %r8d
movl %edi, %edx
movl %ebx, %r9d
callq 0xe78c
leaq 0x216778(%rip), %rax    # 0x2f67a8
cmpb $0x0, (%rax)
sete %al
movq %rbx, -0x50(%rbp)
pushq $-0x2
popq %rbx
movq -0x48(%rbp), %rcx
subl %ecx, %ebx
addl $0x2, %ecx
movq %rcx, -0x48(%rbp)
subl %r12d, %r14d
testb %al, %al
je 0xe005b
cmpl -0x40(%rbp), %r14d
jl 0xe01e6
leal (%r12,%r15), %esi
movl %r15d, %ecx
subl %r12d, %ecx
movzbl -0x2c(%rbp), %r13d
movl %r14d, %edi
movl %r14d, %edx
movl %r13d, %r8d
movq -0x50(%rbp), %r9
callq 0xe78c
leaq 0x216725(%rip), %rax    # 0x2f67a8
cmpb $0x0, (%rax)
je 0xe01e6
movq -0x38(%rbp), %rcx
leal (%r12,%rcx), %eax
leal (%r12,%rcx), %edi
addl $-0x2, %edi
leal (%rbx,%rax), %edx
addl $-0x2, %edx
movq -0x50(%rbp), %r12
subl %r12d, %edx
movzbl %r12b, %ebx
movl %r15d, %esi
movl %r15d, %ecx
movl %r13d, %r8d
movl %ebx, %r9d
callq 0xe78c
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 0xe0334
cmpl $0x0, -0x2c(%rbp)
movq -0x40(%rbp), %rbx
movq -0x38(%rbp), %r15
je 0xe0304
movl %r15d, %edi
movl -0x50(%rbp), %r13d
movl %r13d, %esi
movl -0x48(%rbp), %r12d
movl %r12d, %edx
movl %ebx, %ecx
movl %r14d, %r8d
callq 0xdedf
movl %r12d, %edi
movl %r13d, %esi
movl %r15d, %edx
movl %ebx, %ecx
movl %r14d, %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xdedf
leaq 0x216675(%rip), %rcx    # 0x2f67a8
cmpb $0x0, (%rcx)
movq -0x38(%rbp), %r13
je 0xe0299
movq %rdi, -0x40(%rbp)
leal (%r12,%r13), %edi
addl $-0x2, %edi
leal (%r12,%r15), %esi
movl %r15d, %ecx
subl %r12d, %ecx
movb $0x4, %bl
movzbl %bl, %r9d
movzbl -0x2c(%rbp), %r8d
movl %edi, %edx
callq 0xe78c
leaq 0x21663a(%rip), %rax    # 0x2f67a8
cmpb $0x0, (%rax)
sete %al
subl %r12d, %r13d
movzbl %bl, %r14d
testb %al, %al
je 0xe0189
cmpl -0x40(%rbp), %r13d
jl 0xe0242
leal (%r12,%r15), %esi
movl %r15d, %ecx
subl %r12d, %ecx
movzbl -0x2c(%rbp), %r8d
movl %r13d, %edi
movl %r13d, %edx
movl %r14d, %r9d
callq 0xe78c
leaq 0x2165fb(%rip), %rax    # 0x2f67a8
cmpb $0x0, (%rax)
je 0xe0242
movq -0x38(%rbp), %rax
leal (%r12,%rax), %ecx
leal (%r12,%rax), %edi
addl $-0x2, %edi
jmp 0xe02ce
movl %r15d, %esi
movl %ecx, %edx
movl -0x2c(%rbp), %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xecd5
movq -0x38(%rbp), %rax
leal (%r12,%rax), %edi
decl %edi
cmpl -0x30(%rbp), %edi
jg 0xe0214
addl %eax, %r12d
addl %r12d, %ebx
movq -0x50(%rbp), %r9
subl %r9d, %ebx
movzbl -0x2c(%rbp), %r8d
movl %r15d, %esi
movl %ebx, %edx
movl %r15d, %ecx
callq 0xe78c
cmpl -0x40(%rbp), %r14d
jl 0xe0304
movq -0x48(%rbp), %rax
addl %r14d, %eax
movq -0x50(%rbp), %r9
leal (%r9,%rax), %edx
decl %edx
movzbl -0x2c(%rbp), %r8d
movl %r14d, %edi
movl %r15d, %esi
movl %r15d, %ecx
jmp 0xe0334
movq -0x38(%rbp), %rax
leal (%r12,%rax), %edi
addl $-0x2, %edi
cmpl -0x30(%rbp), %edi
jle 0xe02c8
cmpl -0x40(%rbp), %r13d
jl 0xe0304
jmp 0xe0313
leal (%r12,%r15), %esi
cmpl %eax, %esi
jle 0xe0304
movl %r15d, %ecx
subl %r12d, %ecx
cmpl %ebx, %ecx
jge 0xe0304
movq %rdi, -0x40(%rbp)
leal (%r12,%r14), %edi
addl $-0x2, %edi
movb $0x1, %al
cmpl -0x30(%rbp), %edi
pushq $0x3
popq %rbx
jle 0xe001a
jmp 0xe0036
leal (%r12,%r15), %esi
cmpl %eax, %esi
jle 0xe0304
movl %r15d, %ecx
subl %r12d, %ecx
cmpl %ebx, %ecx
jge 0xe0304
movq %rdi, -0x40(%rbp)
leal (%r12,%r13), %edi
addl $-0x2, %edi
movb $0x3, %bl
movb $0x1, %al
cmpl -0x30(%rbp), %edi
jle 0xe0157
jmp 0xe0174
addl %eax, %r12d
movl %r12d, %ecx
pushq $-0x2
popq %rsi
movq -0x48(%rbp), %rax
cltd
idivl %esi
addl %eax, %ecx
movzbl -0x2c(%rbp), %r8d
movl %r15d, %esi
movl %ecx, %edx
movl %r15d, %ecx
movl %r14d, %r9d
callq 0xe78c
leaq 0x2164b2(%rip), %rax    # 0x2f67a8
cmpb $0x0, (%rax)
movq -0x40(%rbp), %rax
jne 0xe0313
cmpl %eax, %r13d
jge 0xe0313
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x48(%rbp), %rax
cltd
pushq $0x2
popq %rcx
idivl %ecx
leal (%rax,%r13), %edx
decl %edx
movzbl -0x2c(%rbp), %r8d
movl %r13d, %edi
movl %r15d, %esi
movl %r15d, %ecx
movl %r14d, %r9d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe78c