// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heather.cpp
// Function: config_azel()
void config_azel()
{
int i, j;

   // how and where to draw the azimuth/elevation map (and analog watch)
   // assume azel plot will be in the adev table area
   last_track = last_used = 0L;
   share_active = 0;
   shared_item = 0;
   left_adev_col = ADEV_COL;

   AZEL_ROW = ADEV_ROW*TEXT_HEIGHT;
   AZEL_COL = (ADEV_COL*TEXT_WIDTH);
   bogo_watch = 1;
   if(SCREEN_WIDTH >= ADEV_AZEL_THRESH) {  // adev tables and azel both fit
      if(adevs_active(1)) AZEL_COL += (TEXT_WIDTH*44);
      else                AZEL_COL += (TEXT_WIDTH*12);
      AZEL_ROW += TEXT_HEIGHT;
   }
   else if(SCREEN_WIDTH >= MEDIUM_WIDTH) {
      AZEL_ROW += TEXT_HEIGHT;
      AZEL_COL += (TEXT_WIDTH*4);
      if(SCREEN_HEIGHT <= SHORT_SCREEN) AZEL_COL += (TEXT_WIDTH*6);
   }
   else if((rcvr_type == NO_RCVR) && (SCREEN_WIDTH <= NARROW_SCREEN)) {
      AZEL_COL -= 160; // analog watch size
   }
   else {
      AZEL_COL += (TEXT_WIDTH*1);
      AZEL_ROW += TEXT_HEIGHT*2;
   }
   AZEL_SIZE = (SCREEN_WIDTH-AZEL_COL);

   if((SCREEN_WIDTH >= WIDE_WIDTH) && (SCREEN_WIDTH < 1400)) AZEL_SIZE -= (TEXT_WIDTH*2);
   else if(small_font && (SCREEN_WIDTH >= MEDIUM_WIDTH)) AZEL_COL += TEXT_WIDTH;

   if((AZEL_ROW+AZEL_SIZE) >= (PLOT_ROW-128)) {  // az/el map is in plot area
      AZEL_SIZE = (PLOT_ROW-AZEL_ROW-128);
   }
   if(SCREEN_WIDTH > NARROW_SCREEN) AZEL_MARGIN = 8;
   else                             AZEL_MARGIN = 4;

   if((zoom_screen) && (zoom_screen != 'K')) {
      if((SCREEN_WIDTH < TINY_TINY_WIDTH) || (SCREEN_WIDTH < SCREEN_HEIGHT)) {  //piss
         AZEL_SIZE = SCREEN_WIDTH-(SCREEN_WIDTH/20);
      }
      else {
         AZEL_SIZE = SCREEN_HEIGHT-(SCREEN_HEIGHT/20);
      }
      AZEL_SIZE = (AZEL_SIZE/TEXT_HEIGHT)*TEXT_HEIGHT;
      AZEL_SIZE -= (TEXT_HEIGHT*2)*2;

      AZEL_ROW = (SCREEN_HEIGHT-AZEL_SIZE)/2;
      AZEL_ROW = (AZEL_ROW/TEXT_HEIGHT)*TEXT_HEIGHT;
      if(SCREEN_HEIGHT <= SHORT_SCREEN) AZEL_ROW -= TEXT_HEIGHT;
      else                              AZEL_ROW -= (TEXT_HEIGHT*2);

      AZEL_COL = (SCREEN_WIDTH-AZEL_SIZE)/2;
      AZEL_COL = (AZEL_COL/TEXT_WIDTH)*TEXT_WIDTH;
      bogo_watch = 2;
   }

   // where to put the analog clock
   if(all_adevs && plot_lla && WIDE_SCREEN && ((zoom_screen == 0) || (zoom_screen == 'P'))) {
      WATCH_ROW = AZEL_ROW;   // we could be drawing the watch here
      WATCH_COL = (FILTER_COL+20+32+32)*TEXT_WIDTH;  //AZEL_COL;
      WATCH_SIZE = (SCREEN_WIDTH-WATCH_COL)/2;
      if(WATCH_SIZE > (PLOT_ROW-TEXT_HEIGHT*4)) WATCH_SIZE = PLOT_ROW-TEXT_HEIGHT*4;
   }
   else {
      WATCH_ROW = AZEL_ROW;   // we could be drawing the watch here
      WATCH_COL = AZEL_COL;
if((SCREEN_WIDTH >= MEDIUM_WIDTH) && (SCREEN_WIDTH < WIDE_WIDTH)) {
   WATCH_COL -= (TEXT_WIDTH*2);
   AZEL_COL -= (TEXT_WIDTH*2);
}
      WATCH_SIZE = AZEL_SIZE;
   }

   if(zoom_screen == 'P') ;
   else if(zoom_screen == 'K') ;
   else if(zoom_screen) return;

   if(all_adevs || shared_plot) {  // all_adevs or share az/el space with normal plot area
      if(all_adevs && WIDE_SCREEN && (plot_watch == 0) && (plot_lla == 0)) {
         AZEL_COL = SCREEN_WIDTH-AZEL_SIZE;   // and azel goes in the corner
      }
      else {
         AZEL_SIZE = PLOT_HEIGHT;     // default size of the az/el map area
if((PLOT_WIDTH/4) < AZEL_SIZE) AZEL_SIZE = (PLOT_WIDTH / 4);  // piss
         if(AZEL_SIZE > MAX_AZEL) {   // it's just too big to look at
            AZEL_SIZE = MAX_AZEL;
            AZEL_ROW = ((PLOT_ROW+TEXT_HEIGHT-1)/TEXT_HEIGHT)*TEXT_HEIGHT;
         }
         else {
            i = j = (SCREEN_HEIGHT-AZEL_SIZE);  // bottom justify
j = ((PLOT_ROW+TEXT_HEIGHT-1)/TEXT_HEIGHT)*TEXT_HEIGHT;  // toots - top justify
            AZEL_ROW = (i+j) / 2;  // center justify
         }
         AZEL_COL = (SCREEN_WIDTH-AZEL_SIZE);
if(0 && (bogo_watch == 1)) {
   WATCH_ROW = AZEL_ROW;
   WATCH_COL = AZEL_COL;
   WATCH_SIZE = AZEL_SIZE;               // watch goes in the adev area
   aclock_x = (WATCH_COL+ACLOCK_SIZE/2);   // and azel goes in the plot area
   aclock_y = (WATCH_ROW+ACLOCK_SIZE/2);
}
         bogo_watch = 3;
      }
      AZEL_MARGIN = 4;

      if((shared_plot == 0) && (PLOT_WIDTH < SCREEN_WIDTH)) {  // center plot area on the screen
         PLOT_COL = (SCREEN_WIDTH - PLOT_WIDTH) / 2;
      }
   }
   else {   // draw az/el map in the adev table area
      if(PLOT_WIDTH < SCREEN_WIDTH) {  // center plot area on the screen
         PLOT_COL = (SCREEN_WIDTH - PLOT_WIDTH) / 2;
      }
   }

// if(plot_azel || plot_signals || plot_watch) {
   if(zoom_screen == 'P') ;
   else if(plot_azel || plot_signals || plot_watch || plot_lla) {
      if((AZEL_ROW+AZEL_SIZE) >= PLOT_ROW) {  // az/el map is in the normal plot window
         PLOT_WIDTH -= AZEL_SIZE;             // make room for it...
         PLOT_WIDTH += (HORIZ_MAJOR-1);
         PLOT_WIDTH = (PLOT_WIDTH/HORIZ_MAJOR) * HORIZ_MAJOR;
         if((PLOT_COL+PLOT_WIDTH+AZEL_SIZE) > SCREEN_WIDTH) PLOT_WIDTH -= HORIZ_MAJOR;
         AZEL_COL -= ((AZEL_COL-(PLOT_COL+PLOT_WIDTH)) / 2);
         AZEL_COL = ((AZEL_COL+TEXT_WIDTH-1)/TEXT_WIDTH)*TEXT_WIDTH;
         share_active = 1;
      }
      else if((plot_azel || plot_signals) && plot_watch && (plot_lla == 0) && (all_adevs == SINGLE_ADEVS) && WIDE_SCREEN) {
         AZEL_SIZE = (SCREEN_WIDTH - AZEL_COL) / 2;
         if(AZEL_SIZE > MAX_AZEL) AZEL_SIZE = MAX_AZEL;
         WATCH_SIZE = AZEL_SIZE;
      }
      else if((plot_signals == 3) && (SCREEN_WIDTH >= WIDE_WIDTH)) {
         AZEL_COL -= TEXT_WIDTH*2;
      }
   }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
andl $0x0, 0x313be5(%rip)    # 0x3253c4
andl $0x0, 0x313bd6(%rip)    # 0x3253bc
andl $0x0, 0x313bff(%rip)    # 0x3253ec
movb $0x0, 0x313bf5(%rip)    # 0x3253e9
andl $0x0, 0x313b95(%rip)    # 0x325390
movl $0x4f, 0x1f0fc3(%rip)   # 0x2027c8
movl 0x1f1004(%rip), %r9d    # 0x202810
imull $0x4f, %r9d, %ecx
movl %ecx, 0x313b7e(%rip)    # 0x325394
movl $0x1, 0x1f3bec(%rip)    # 0x20540c
movl 0x1f0fda(%rip), %esi    # 0x202800
pushq $0x64
popq %rbx
cmpl $0x500, %esi            # imm = 0x500
jl 0x1187d
pushq $0x1
popq %rdi
callq 0xc71ad
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl 0x1f0fc9(%rip), %r9d    # 0x202810
shll $0x5, %ecx
orl $0xc, %ecx
imull %r9d, %ecx
addl 0x313b3d(%rip), %ecx    # 0x325394
movl %ecx, 0x313b37(%rip)    # 0x325394
movl 0x313b2c(%rip), %r8d    # 0x325390
addl 0x1f0fa9(%rip), %r8d    # 0x202814
movl %r8d, 0x313b1e(%rip)    # 0x325390
movl 0x1f0f88(%rip), %esi    # 0x202800
jmp 0x118ff
cmpl $0x3e2, %esi            # imm = 0x3E2
jl 0x118b5
movl 0x1f0f88(%rip), %r8d    # 0x202814
movl %r8d, 0x313afd(%rip)    # 0x325390
imull $0x53, %r9d, %ecx
movl %ecx, 0x313af7(%rip)    # 0x325394
cmpl $0x258, 0x1f0f5d(%rip)  # imm = 0x258
jg 0x118ff
imull $0x59, %r9d, %ecx
movl %ecx, 0x313ae1(%rip)    # 0x325394
jmp 0x118ff
cmpq $0x400, 0x1f1010(%rip) # imm = 0x400
jne 0x118d3
imull $0x31a, 0x1fbc78(%rip), %eax # imm = 0x31A
cltd
idivl %ebx
cmpl %eax, %esi
jle 0x118f0
imull $0x50, %r9d, %ecx
movl %ecx, 0x313ab7(%rip)    # 0x325394
movl 0x1f0f30(%rip), %r8d    # 0x202814
addl %r8d, %r8d
movl %r8d, 0x313aa2(%rip)    # 0x325390
jmp 0x118ff
addl $0xffffff60, %ecx       # imm = 0xFFFFFF60
movl %ecx, 0x313a98(%rip)    # 0x325394
xorl %r8d, %r8d
movl %esi, %edi
subl %ecx, %edi
movl %edi, 0x313a83(%rip)    # 0x32538c
leal -0x4fa(%rsi), %eax
cmpl $0x7d, %eax
ja 0x11922
subl %r9d, %edi
subl %r9d, %edi
movl %edi, 0x313a6c(%rip)    # 0x32538c
jmp 0x1193c
cmpl $0x3e2, %esi            # imm = 0x3E2
jl 0x1193c
cmpb $0x0, 0x1f0f28(%rip)    # 0x202859
je 0x1193c
addl %r9d, %ecx
movl %ecx, 0x313a58(%rip)    # 0x325394
leal (%rdi,%r8), %eax
movl 0x1f0f35(%rip), %r10d   # 0x20287c
leal -0x80(%r10), %edx
cmpl %edx, %eax
jl 0x1195e
movl %r10d, %edi
subl %r8d, %edi
addl $-0x80, %edi
movl %edi, 0x313a2e(%rip)    # 0x32538c
imull $0x31a, 0x1fbbdc(%rip), %eax # imm = 0x31A
cltd
idivl %ebx
xorl %edx, %edx
cmpl %eax, %esi
setg %dl
leal 0x4(,%rdx,4), %eax
movl %eax, 0x313a19(%rip)    # 0x325398
movzbl 0x2e4e22(%rip), %ebx    # 0x2f67a8
pushq $0x2
popq %r11
testl %ebx, %ebx
je 0x11a20
cmpl $0x4b, %ebx
je 0x11a20
movl 0x1f0e62(%rip), %r14d   # 0x202804
cmpl %r14d, %esi
movl %r14d, %ecx
cmovll %esi, %ecx
cmpl $0x1c2, %esi            # imm = 0x1C2
cmovll %esi, %ecx
pushq $-0x14
popq %rdi
movl %ecx, %eax
cltd
idivl %edi
movl %eax, %edi
addl %ecx, %edi
movl 0x1f0e4d(%rip), %r15d   # 0x202814
movl %edi, %eax
cltd
idivl %r15d
leal (%rdx,%r15,4), %eax
subl %eax, %edi
movl %edi, 0x3139b3(%rip)    # 0x32538c
movl %r14d, %eax
subl %edi, %eax
cltd
idivl %r11d
movl %eax, %r8d
cltd
idivl %r15d
cmpl $0x259, %r14d           # imm = 0x259
setge %cl
shll %cl, %r15d
addl %edx, %r15d
subl %r15d, %r8d
movl %r8d, 0x31398d(%rip)    # 0x325390
movl %esi, %eax
subl %edi, %eax
cltd
idivl %r11d
movl %eax, %ecx
cltd
idivl %r9d
subl %edx, %ecx
movl %ecx, 0x31397b(%rip)    # 0x325394
movl %r11d, 0x1f39ec(%rip)   # 0x20540c
movb 0x215317(%rip), %r14b   # 0x226d3e
movb 0x313882(%rip), %r15b   # 0x3252b0
cmpl $0x690, %esi            # imm = 0x690
jl 0x11a83
testb %r14b, %r14b
je 0x11a83
testb %r15b, %r15b
je 0x11a83
cmpl $0x50, %ebx
je 0x11a49
testl %ebx, %ebx
jne 0x11a83
movl %r8d, 0x313914(%rip)    # 0x325364
movl 0x1f0d4e(%rip), %edx    # 0x2027a4
addl $0x54, %edx
imull %r9d, %edx
movl %edx, 0x313905(%rip)    # 0x325368
movl %esi, %eax
subl %edx, %eax
cltd
idivl %r11d
movl 0x1f0da2(%rip), %r12d   # 0x202814
shll $0x2, %r12d
movl %r10d, %edx
subl %r12d, %edx
cmpl %edx, %eax
cmovll %eax, %edx
jmp 0x11ab1
movl %r8d, 0x3138da(%rip)    # 0x325364
movl %ecx, 0x3138d8(%rip)    # 0x325368
leal -0x3e2(%rsi), %eax
cmpl $0x117, %eax            # imm = 0x117
ja 0x11aaf
subl %r9d, %ecx
subl %r9d, %ecx
movl %ecx, 0x3138bf(%rip)    # 0x325368
movl %ecx, 0x3138e5(%rip)    # 0x325394
movl %edi, %edx
movl %edx, 0x3138b5(%rip)    # 0x32536c
testl %ebx, %ebx
je 0x11ac9
cmpl $0x50, %ebx
je 0x11ac9
cmpl $0x4b, %ebx
jne 0x11c6f
movb 0x313918(%rip), %r12b   # 0x3253e8
movl %r14d, %eax
orb %r12b, %al
je 0x11b15
cmpl $0x690, %esi            # imm = 0x690
setge %al
testb %r14b, %r14b
setne %cl
andb %al, %cl
cmpb $0x0, 0x1f3918(%rip)    # 0x205408
sete %al
testb %r15b, %r15b
sete %dl
andb %al, %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x11bb1
movl %esi, %ecx
subl %edi, %ecx
movl %ecx, 0x313884(%rip)    # 0x325394
jmp 0x11cbe
movl 0x1f0d69(%rip), %edx    # 0x202884
cmpl %esi, %edx
jge 0x11b2d
movl %esi, %eax
subl %edx, %eax
cltd
idivl %r11d
movl %eax, 0x1f0d53(%rip)    # 0x202880
cmpl $0x50, %ebx
je 0x11c6f
movb 0x1f38d9(%rip), %al     # 0x205415
movb 0x1f38d1(%rip), %dl     # 0x205413
orb %al, %dl
movb 0x1f38be(%rip), %bl     # 0x205408
movl %edx, %r12d
orb %bl, %r12b
testb %dl, %dl
setne %dl
orb %r15b, %r12b
je 0x11c6f
addl %edi, %r8d
cmpl %r10d, %r8d
jge 0x11c04
testb %bl, %bl
setne %dil
cmpl $0x690, %esi            # imm = 0x690
jl 0x11ce8
andb %dil, %dl
je 0x11ce8
orb %r14b, %r15b
jne 0x11ce8
subl %ecx, %esi
movl %esi, %eax
cltd
idivl %r11d
movl $0x140, %ecx            # imm = 0x140
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x3137e6(%rip)    # 0x32538c
movl %ecx, 0x3137c0(%rip)    # 0x32536c
jmp 0x11c6f
movl 0x1f0cd1(%rip), %edi    # 0x202888
movl 0x1f0cc7(%rip), %eax    # 0x202884
pushq $0x4
popq %rcx
cltd
idivl %ecx
cmpl %edi, %eax
cmovll %eax, %edi
movl %edi, 0x3137be(%rip)    # 0x32538c
cmpl $0x141, %edi            # imm = 0x141
jl 0x11c78
movl $0x140, 0x3137a8(%rip)  # imm = 0x140
movl 0x1f0c2a(%rip), %ecx    # 0x202814
leal (%rcx,%r10), %r8d
decl %r8d
movl %r8d, %eax
cltd
idivl %ecx
subl %edx, %r8d
movl $0x140, %edi            # imm = 0x140
jmp 0x11ca3
movl %edi, %r8d
notl %r8d
addl 0x1f0c73(%rip), %r8d    # 0x202884
movl 0x1f0c5c(%rip), %r10d   # 0x202874
addl %r10d, %r8d
movl %r8d, %eax
cltd
idivl %r10d
subl %edx, %r8d
movl %r8d, 0x1f0c58(%rip)    # 0x202884
movl 0x1f0c4e(%rip), %edx    # 0x202880
addl %edx, %edi
addl %r8d, %edi
cmpl %esi, %edi
jle 0x11c45
subl %r10d, %r8d
movl %r8d, 0x1f0c3f(%rip)    # 0x202884
addl %r8d, %edx
movl %ecx, %eax
subl %edx, %eax
pushq $-0x2
popq %rsi
cltd
idivl %esi
addl %ecx, %eax
leal (%r9,%rax), %ecx
decl %ecx
movl %ecx, %eax
cltd
idivl %r9d
subl %edx, %ecx
movl %ecx, 0x31372c(%rip)    # 0x325394
movb $0x1, 0x31377a(%rip)    # 0x3253e9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x1f0b86(%rip), %ecx    # 0x202804
movl 0x1f0b8f(%rip), %r8d    # 0x202814
leal (%r8,%r10), %eax
decl %eax
cltd
idivl %r8d
addl %r10d, %r8d
addl %edi, %edx
subl %edx, %ecx
leal (%rcx,%r8), %eax
decl %eax
cltd
idivl %r11d
movl %eax, %r8d
movl %r8d, 0x3136e6(%rip)    # 0x325390
movl %esi, %ecx
subl %edi, %ecx
movl %ecx, 0x3136e0(%rip)    # 0x325394
movl $0x3, 0x1f374e(%rip)    # 0x20540c
movl $0x4, 0x3136d0(%rip)    # 0x325398
testb %r12b, %r12b
sete %al
movl 0x1f0bb0(%rip), %edx    # 0x202884
cmpl %esi, %edx
setl %r12b
testb %r12b, %al
jne 0x11b1f
jmp 0x11b2d
cmpb $0x3, %al
setne %al
cmpl $0x4fa, %esi            # imm = 0x4FA
setl %dl
orb %al, %dl
jne 0x11c6f
addl %r9d, %r9d
subl %r9d, %ecx
movl %ecx, 0x31368a(%rip)    # 0x325394
jmp 0x11c6f