// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
pushq %rax
xorl %eax, %eax
movl %eax, 0x329473(%rip)    # 0x33b3c4
movl %eax, 0x329465(%rip)    # 0x33b3bc
movb $0x0, 0x32948b(%rip)    # 0x33b3e9
movl %eax, 0x329488(%rip)    # 0x33b3ec
movl $0x4f, 0x20685a(%rip)   # 0x2187c8
movl %eax, 0x32941c(%rip)    # 0x33b390
movl 0x206895(%rip), %r8d    # 0x218810
imull $0x4f, %r8d, %ecx
movl %ecx, 0x32940f(%rip)    # 0x33b394
movl $0x1, 0x20947d(%rip)    # 0x21b40c
movl 0x20686a(%rip), %r9d    # 0x218800
cmpl $0x500, %r9d            # imm = 0x500
jl 0x11feb
movl $0x1, %edi
callq 0xd8c0d
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl 0x206859(%rip), %r8d    # 0x218810
shll $0x5, %ecx
orl $0xc, %ecx
imull %r8d, %ecx
addl 0x3293cd(%rip), %ecx    # 0x33b394
movl %ecx, 0x3293c7(%rip)    # 0x33b394
movl 0x3293bd(%rip), %edi    # 0x33b390
addl 0x20683b(%rip), %edi    # 0x218814
movl %edi, 0x3293b1(%rip)    # 0x33b390
movl 0x20681a(%rip), %r9d    # 0x218800
jmp 0x12081
cmpl $0x3e2, %r9d            # imm = 0x3E2
jl 0x12022
movl 0x20681a(%rip), %edi    # 0x218814
movl %edi, 0x329390(%rip)    # 0x33b390
imull $0x53, %r8d, %ecx
movl %ecx, 0x32938a(%rip)    # 0x33b394
cmpl $0x258, 0x2067f0(%rip)  # imm = 0x258
jg 0x12081
imull $0x59, %r8d, %ecx
movl %ecx, 0x329374(%rip)    # 0x33b394
jmp 0x12081
cmpq $0x400, 0x2068a3(%rip) # imm = 0x400
jne 0x12054
imull $0x31a, 0x21150b(%rip), %eax # imm = 0x31A
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rax
addl %edx, %eax
cmpl %eax, %r9d
jle 0x12073
movl %r8d, %eax
shll $0x4, %eax
leal (%rax,%rax,4), %ecx
movl %ecx, 0x329331(%rip)    # 0x33b394
movl 0x2067ab(%rip), %edi    # 0x218814
addl %edi, %edi
movl %edi, 0x32931f(%rip)    # 0x33b390
jmp 0x12081
addl $0xffffff60, %ecx       # imm = 0xFFFFFF60
movl %ecx, 0x329315(%rip)    # 0x33b394
xorl %edi, %edi
movl %r9d, %esi
subl %ecx, %esi
movl %esi, 0x329300(%rip)    # 0x33b38c
leal -0x4fa(%r9), %eax
cmpl $0x7d, %eax
ja 0x120a6
subl %r8d, %esi
subl %r8d, %esi
movl %esi, 0x3292e8(%rip)    # 0x33b38c
jmp 0x120c1
cmpl $0x3e2, %r9d            # imm = 0x3E2
jl 0x120c1
cmpb $0x0, 0x2067a3(%rip)    # 0x218859
je 0x120c1
addl %r8d, %ecx
movl %ecx, 0x3292d3(%rip)    # 0x33b394
leal (%rsi,%rdi), %eax
movl 0x2067b1(%rip), %r10d   # 0x21887c
leal -0x80(%r10), %edx
cmpl %edx, %eax
jl 0x120e1
movl %r10d, %esi
subl %edi, %esi
addl $-0x80, %esi
movl %esi, 0x3292ab(%rip)    # 0x33b38c
imull $0x31a, 0x211459(%rip), %eax # imm = 0x31A
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x25, %rax
addl %edx, %eax
xorl %edx, %edx
cmpl %eax, %r9d
setg %dl
leal 0x4(,%rdx,4), %eax
movl %eax, 0x329282(%rip)    # 0x33b398
movzbl 0x2fa68a(%rip), %r11d   # 0x30c7a8
testl %r11d, %r11d
je 0x121c7
cmpl $0x4b, %r11d
je 0x121c7
movl 0x2066cd(%rip), %ecx    # 0x218804
cmpl %ecx, %r9d
movl %ecx, %eax
cmovll %r9d, %eax
cmpl $0x1c2, %r9d            # imm = 0x1C2
cmovll %r9d, %eax
movslq %eax, %rsi
imulq $-0x66666667, %rsi, %rax # imm = 0x99999999
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x23, %rax
addl %edx, %eax
addl %eax, %esi
movl 0x2066aa(%rip), %ebx    # 0x218814
movl %esi, %eax
cltd
idivl %ebx
leal (%rdx,%rbx,4), %eax
subl %eax, %esi
movl %esi, 0x329212(%rip)    # 0x33b38c
movl %ecx, %eax
subl %esi, %eax
movl %eax, %edi
shrl $0x1f, %edi
addl %eax, %edi
sarl %edi
movl %edi, %eax
cltd
idivl %ebx
cmpl $0x259, %ecx            # imm = 0x259
setge %cl
shll %cl, %ebx
addl %edx, %ebx
subl %ebx, %edi
movl %edi, 0x3291ef(%rip)    # 0x33b390
movl %r9d, %eax
subl %esi, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, %eax
cltd
idivl %r8d
subl %edx, %ecx
movl %ecx, 0x3291d7(%rip)    # 0x33b394
movl $0x2, 0x209245(%rip)    # 0x21b40c
movb 0x22ab71(%rip), %bl     # 0x23cd3e
movb 0x3290dc(%rip), %r14b   # 0x33b2b0
cmpl $0x690, %r9d            # imm = 0x690
jl 0x12233
testb %bl, %bl
je 0x12233
testb %r14b, %r14b
je 0x12233
testl %r11d, %r11d
je 0x121f1
cmpl $0x50, %r11d
jne 0x12261
movl %edi, 0x32916d(%rip)    # 0x33b364
movl 0x2065a7(%rip), %eax    # 0x2187a4
addl $0x54, %eax
imull %r8d, %eax
movl %eax, 0x32915e(%rip)    # 0x33b368
movl %r9d, %edx
subl %eax, %edx
movl %edx, %r15d
shrl $0x1f, %r15d
addl %edx, %r15d
sarl %r15d
movl 0x2065f2(%rip), %edx    # 0x218814
shll $0x2, %edx
movl %r10d, %eax
subl %edx, %eax
cmpl %eax, %r15d
cmovll %r15d, %eax
jmp 0x1226f
movl %edi, 0x32912b(%rip)    # 0x33b364
movl %ecx, 0x329129(%rip)    # 0x33b368
leal -0x3e2(%r9), %eax
cmpl $0x117, %eax            # imm = 0x117
ja 0x1226d
subl %r8d, %ecx
subl %r8d, %ecx
movl %ecx, 0x32910f(%rip)    # 0x33b368
movl %ecx, 0x329135(%rip)    # 0x33b394
jmp 0x1226d
movl %edi, 0x3290fd(%rip)    # 0x33b364
movl %ecx, 0x3290fb(%rip)    # 0x33b368
movl %esi, %eax
movl %eax, 0x3290f7(%rip)    # 0x33b36c
testl %r11d, %r11d
je 0x1228a
cmpl $0x50, %r11d
je 0x1228a
cmpl $0x4b, %r11d
jne 0x1243c
movb 0x329157(%rip), %r15b   # 0x33b3e8
movl %ebx, %eax
orb %r15b, %al
je 0x122d6
cmpl $0x690, %r9d            # imm = 0x690
setge %al
testb %bl, %bl
setne %cl
andb %al, %cl
cmpb $0x0, 0x209158(%rip)    # 0x21b408
sete %al
testb %r14b, %r14b
sete %dl
andb %al, %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x12382
movl %r9d, %ecx
subl %esi, %ecx
movl %ecx, 0x3290c3(%rip)    # 0x33b394
jmp 0x1248c
movl 0x2065a8(%rip), %eax    # 0x218884
cmpl %r9d, %eax
jge 0x122f5
movl %r9d, %edx
subl %eax, %edx
movl %edx, %eax
shrl $0x1f, %eax
addl %edx, %eax
sarl %eax
movl %eax, 0x20658b(%rip)    # 0x218880
cmpl $0x50, %r11d
je 0x1243c
movb 0x209110(%rip), %al     # 0x21b415
movb 0x209108(%rip), %dl     # 0x21b413
orb %al, %dl
movb 0x2090f4(%rip), %r11b   # 0x21b408
movl %edx, %r15d
orb %r11b, %r15b
testb %dl, %dl
setne %dl
orb %r14b, %r15b
je 0x1243c
addl %esi, %edi
cmpl %r10d, %edi
jge 0x123d7
testb %r11b, %r11b
setne %sil
cmpl $0x690, %r9d            # imm = 0x690
jl 0x124b7
andb %sil, %dl
je 0x124b7
orb %bl, %r14b
jne 0x124b7
subl %ecx, %r9d
movl %r9d, %eax
shrl $0x1f, %eax
addl %r9d, %eax
sarl %eax
movl $0x140, %ecx            # imm = 0x140
cmpl %ecx, %eax
cmovgel %ecx, %eax
movl %eax, 0x329015(%rip)    # 0x33b38c
movl %eax, 0x328fef(%rip)    # 0x33b36c
jmp 0x1243c
movl 0x206500(%rip), %eax    # 0x218888
movl 0x2064f6(%rip), %ecx    # 0x218884
leal 0x3(%rcx), %esi
testl %ecx, %ecx
cmovnsl %ecx, %esi
sarl $0x2, %esi
cmpl %eax, %esi
cmovgel %eax, %esi
movl %esi, 0x328fe8(%rip)    # 0x33b38c
cmpl $0x141, %esi            # imm = 0x141
jl 0x12447
movl $0x140, 0x328fd2(%rip)  # imm = 0x140
movl 0x206454(%rip), %ecx    # 0x218814
leal (%rcx,%r10), %edi
decl %edi
movl %edi, %eax
cltd
idivl %ecx
subl %edx, %edi
movl $0x140, %esi            # imm = 0x140
jmp 0x12471
movl %esi, %edi
notl %edi
addl 0x2064a3(%rip), %edi    # 0x218884
movl 0x20648c(%rip), %r10d   # 0x218874
addl %r10d, %edi
movl %edi, %eax
cltd
idivl %r10d
subl %edx, %edi
movl %edi, 0x20648b(%rip)    # 0x218884
movl 0x206481(%rip), %eax    # 0x218880
addl %eax, %esi
addl %edi, %esi
cmpl %r9d, %esi
jle 0x12411
subl %r10d, %edi
movl %edi, 0x206473(%rip)    # 0x218884
addl %edi, %eax
movl %ecx, %edx
subl %eax, %edx
movl %edx, %eax
shrl $0x1f, %eax
addl %edx, %eax
sarl %eax
subl %eax, %ecx
addl %r8d, %ecx
decl %ecx
movl %ecx, %eax
cltd
idivl %r8d
subl %edx, %ecx
movl %ecx, 0x328f5f(%rip)    # 0x33b394
movb $0x1, 0x328fad(%rip)    # 0x33b3e9
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x2063b7(%rip), %ecx    # 0x218804
movl 0x2063c1(%rip), %edi    # 0x218814
leal (%rdi,%r10), %eax
decl %eax
cltd
idivl %edi
addl %r10d, %edi
addl %esi, %edx
subl %edx, %ecx
leal (%rcx,%rdi), %eax
decl %eax
movl %eax, %edi
shrl $0x1f, %edi
addl %eax, %edi
sarl %edi
movl %edi, 0x328f19(%rip)    # 0x33b390
movl %r9d, %ecx
subl %esi, %ecx
movl %ecx, 0x328f12(%rip)    # 0x33b394
movl $0x3, 0x208f80(%rip)    # 0x21b40c
movl $0x4, 0x328f02(%rip)    # 0x33b398
testb %r15b, %r15b
sete %dl
movl 0x2063e2(%rip), %eax    # 0x218884
cmpl %r9d, %eax
setl %r15b
testb %r15b, %dl
jne 0x122e1
jmp 0x122f5
cmpb $0x3, %al
setne %al
cmpl $0x4fa, %r9d            # imm = 0x4FA
setl %dl
orb %al, %dl
jne 0x1243c
addl %r8d, %r8d
subl %r8d, %ecx
movl %ecx, 0x328eba(%rip)    # 0x33b394
jmp 0x1243c