// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
xorl %eax, %eax
movl %eax, 0x3293e6(%rip)    # 0x33b3c4
movl %eax, 0x3293d8(%rip)    # 0x33b3bc
movb $0x0, 0x3293fe(%rip)    # 0x33b3e9
movl %eax, 0x3293fb(%rip)    # 0x33b3ec
movl $0x4f, 0x2067cd(%rip)   # 0x2187c8
movl %eax, 0x32938f(%rip)    # 0x33b390
movl 0x206809(%rip), %eax    # 0x218810
imull $0x4f, %eax, %ecx
movl %ecx, 0x329384(%rip)    # 0x33b394
movl $0x1, 0x2093f2(%rip)    # 0x21b40c
movl 0x2067e0(%rip), %edx    # 0x218800
cmpl $0x500, %edx            # imm = 0x500
jl 0x1205d
movl $0x1, %edi
callq 0xd84d7
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
shll $0x5, %ecx
orl $0xc, %ecx
imull 0x2067ca(%rip), %ecx    # 0x218810
addl %ecx, 0x329348(%rip)    # 0x33b394
movl 0x2067c2(%rip), %eax    # 0x218814
addl %eax, 0x329338(%rip)    # 0x33b390
jmp 0x120eb
cmpl $0x3e2, %edx            # imm = 0x3E2
jl 0x12091
movl 0x2067a9(%rip), %ecx    # 0x218814
movl %ecx, 0x32931f(%rip)    # 0x33b390
imull $0x53, %eax, %ecx
movl %ecx, 0x32931a(%rip)    # 0x33b394
cmpl $0x258, 0x206780(%rip)  # imm = 0x258
jg 0x120eb
imull $0x59, %eax, %eax
movl %eax, 0x329305(%rip)    # 0x33b394
jmp 0x120eb
cmpq $0x400, 0x206834(%rip) # imm = 0x400
jne 0x120c3
imull $0x31a, 0x21149c(%rip), %esi # imm = 0x31A
movslq %esi, %rsi
imulq $0x51eb851f, %rsi, %rsi # imm = 0x51EB851F
movq %rsi, %rdi
shrq $0x3f, %rdi
sarq $0x25, %rsi
addl %edi, %esi
cmpl %esi, %edx
jle 0x120df
shll $0x4, %eax
leal (%rax,%rax,4), %eax
movl %eax, 0x3292c5(%rip)    # 0x33b394
movl 0x20673f(%rip), %eax    # 0x218814
addl %eax, %eax
movl %eax, 0x3292b3(%rip)    # 0x33b390
jmp 0x120eb
addl $0xffffff60, %ecx       # imm = 0xFFFFFF60
movl %ecx, 0x3292a9(%rip)    # 0x33b394
movl 0x20670e(%rip), %r8d    # 0x218800
movl 0x32929c(%rip), %eax    # 0x33b394
movl %r8d, %ecx
subl %eax, %ecx
movl %ecx, 0x329289(%rip)    # 0x33b38c
leal -0x4fa(%r8), %edx
cmpl $0x7d, %edx
ja 0x12121
movl 0x2066fb(%rip), %eax    # 0x218810
addl %eax, %eax
subl %eax, %ecx
movl %ecx, 0x32926d(%rip)    # 0x33b38c
jmp 0x1213f
cmpl $0x3e2, %r8d            # imm = 0x3E2
jl 0x1213f
cmpb $0x0, 0x206728(%rip)    # 0x218859
je 0x1213f
addl 0x2066d7(%rip), %eax    # 0x218810
movl %eax, 0x329255(%rip)    # 0x33b394
movl 0x32924b(%rip), %eax    # 0x33b390
movl 0x329241(%rip), %ecx    # 0x33b38c
addl %eax, %ecx
movl 0x206728(%rip), %r9d    # 0x21887c
leal -0x80(%r9), %edx
cmpl %edx, %ecx
jl 0x1216a
movl %r9d, %ecx
subl %eax, %ecx
addl $-0x80, %ecx
movl %ecx, 0x329222(%rip)    # 0x33b38c
imull $0x31a, 0x2113d0(%rip), %eax # imm = 0x31A
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x25, %rax
addl %ecx, %eax
xorl %ecx, %ecx
cmpl %eax, %r8d
setg %cl
leal 0x4(,%rcx,4), %eax
movl %eax, 0x3291f9(%rip)    # 0x33b398
movzbl 0x2fa601(%rip), %r10d   # 0x30c7a8
testl %r10d, %r10d
je 0x1225a
cmpl $0x4b, %r10d
je 0x1225a
movl 0x206644(%rip), %ecx    # 0x218804
cmpl %ecx, %r8d
movl %ecx, %eax
cmovll %r8d, %eax
cmpl $0x1c2, %r8d            # imm = 0x1C2
cmovll %r8d, %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 0x206620(%rip), %r11d   # 0x218814
movl %esi, %eax
cltd
idivl %r11d
leal (%rdx,%r11,4), %eax
subl %eax, %esi
movl %esi, 0x329186(%rip)    # 0x33b38c
movl %ecx, %eax
subl %esi, %eax
movl %eax, %edi
shrl $0x1f, %edi
addl %eax, %edi
sarl %edi
movl %edi, %eax
cltd
idivl %r11d
cmpl $0x259, %ecx            # imm = 0x259
setge %cl
shll %cl, %r11d
addl %edx, %r11d
subl %r11d, %edi
movl %edi, 0x32915f(%rip)    # 0x33b390
movl %r8d, %eax
subl %esi, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, %eax
cltd
idivl 0x2065c8(%rip)          # 0x218810
subl %edx, %ecx
movl %ecx, 0x329144(%rip)    # 0x33b394
movl $0x2, 0x2091b2(%rip)    # 0x21b40c
movb 0x22aadd(%rip), %sil    # 0x23cd3e
movb 0x329048(%rip), %dil    # 0x33b2b0
cmpl $0x690, %r8d            # imm = 0x690
jl 0x122d1
testb %sil, %sil
je 0x122d1
testb %dil, %dil
je 0x122d1
cmpl $0x50, %r10d
je 0x12286
testl %r10d, %r10d
jne 0x122d1
movl 0x329104(%rip), %eax    # 0x33b390
movl 0x206512(%rip), %ecx    # 0x2187a4
addl $0x54, %ecx
imull 0x206574(%rip), %ecx    # 0x218810
movl %eax, 0x3290c2(%rip)    # 0x33b364
movl %ecx, 0x3290c0(%rip)    # 0x33b368
movl %r8d, %eax
subl %ecx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x3290b0(%rip)    # 0x33b36c
movl 0x206552(%rip), %edx    # 0x218814
shll $0x2, %edx
movl %r9d, %eax
subl %edx, %eax
cmpl %eax, %ecx
cmovll %ecx, %eax
jmp 0x12314
movl 0x3290b9(%rip), %eax    # 0x33b390
movl %eax, 0x329087(%rip)    # 0x33b364
movl 0x3290b1(%rip), %eax    # 0x33b394
movl %eax, 0x32907f(%rip)    # 0x33b368
leal -0x3e2(%r8), %ecx
cmpl $0x117, %ecx            # imm = 0x117
ja 0x1230e
movl 0x206512(%rip), %ecx    # 0x218810
addl %ecx, %ecx
subl %ecx, %eax
movl %eax, 0x329060(%rip)    # 0x33b368
movl %eax, 0x329086(%rip)    # 0x33b394
movl 0x329078(%rip), %eax    # 0x33b38c
movl %eax, 0x329052(%rip)    # 0x33b36c
testl %r10d, %r10d
je 0x1232f
cmpl $0x50, %r10d
je 0x1232f
cmpl $0x4b, %r10d
jne 0x124fd
movb 0x3290b2(%rip), %r11b   # 0x33b3e8
movl %esi, %eax
orb %r11b, %al
je 0x12380
cmpl $0x690, %r8d            # imm = 0x690
setge %al
testb %sil, %sil
setne %cl
andb %al, %cl
cmpb $0x0, 0x2090b2(%rip)    # 0x21b408
sete %al
testb %dil, %dil
sete %dl
andb %al, %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1243b
movl %r8d, %eax
subl 0x329017(%rip), %eax    # 0x33b38c
movl %eax, 0x329019(%rip)    # 0x33b394
jmp 0x1254e
movl 0x2064fe(%rip), %eax    # 0x218884
cmpl %r8d, %eax
jge 0x1239f
movl %r8d, %ecx
subl %eax, %ecx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
movl %eax, 0x2064e1(%rip)    # 0x218880
cmpl $0x50, %r10d
je 0x124fd
movb 0x209066(%rip), %al     # 0x21b415
movb 0x20905e(%rip), %cl     # 0x21b413
orb %al, %cl
movb 0x20904b(%rip), %dl     # 0x21b408
movl %ecx, %r10d
orb %dl, %r10b
testb %cl, %cl
setne %cl
orb %dil, %r10b
je 0x124fd
movl 0x328fb4(%rip), %r10d   # 0x33b38c
movl 0x328fb1(%rip), %r11d   # 0x33b390
addl %r10d, %r11d
cmpl %r9d, %r11d
jge 0x1248b
testb %dl, %dl
setne %dl
cmpl $0x690, %r8d            # imm = 0x690
jl 0x12577
andb %dl, %cl
je 0x12577
orb %sil, %dil
jne 0x12577
subl 0x328f7f(%rip), %r8d    # 0x33b394
movl %r8d, %eax
shrl $0x1f, %eax
addl %r8d, %eax
sarl %eax
movl $0x140, %ecx            # imm = 0x140
cmpl %ecx, %eax
cmovgel %ecx, %eax
movl %eax, 0x328f5c(%rip)    # 0x33b38c
movl %eax, 0x328f36(%rip)    # 0x33b36c
jmp 0x124fd
movl 0x206447(%rip), %eax    # 0x218888
movl 0x20643d(%rip), %edx    # 0x218884
leal 0x3(%rdx), %ecx
testl %edx, %edx
cmovnsl %edx, %ecx
sarl $0x2, %ecx
cmpl %eax, %ecx
cmovgel %eax, %ecx
movl %ecx, 0x328f2f(%rip)    # 0x33b38c
cmpl $0x141, %ecx            # imm = 0x141
jl 0x12502
movl $0x140, 0x328f19(%rip)  # imm = 0x140
movl 0x20639b(%rip), %ebx    # 0x218814
leal (%rbx,%r9), %ecx
decl %ecx
movl %ecx, %eax
cltd
idivl %ebx
subl %edx, %ecx
jmp 0x1252f
movl 0x2063f3(%rip), %ecx    # 0x218884
subl %r10d, %ecx
movl 0x2063da(%rip), %esi    # 0x218874
addl %esi, %ecx
decl %ecx
movl %ecx, %eax
cltd
idivl %esi
subl %edx, %ecx
movl %ecx, 0x2063d9(%rip)    # 0x218884
movl 0x2063cf(%rip), %eax    # 0x218880
addl %eax, %r10d
addl %ecx, %r10d
cmpl %r8d, %r10d
jle 0x124c4
subl %esi, %ecx
movl %ecx, 0x2063c0(%rip)    # 0x218884
movl 0x328eca(%rip), %ecx    # 0x33b394
addl 0x2063b4(%rip), %eax    # 0x218884
movl %ecx, %edx
subl %eax, %edx
movl %edx, %eax
shrl $0x1f, %eax
addl %edx, %eax
sarl %eax
subl %eax, %ecx
movl 0x20632b(%rip), %esi    # 0x218810
addl %esi, %ecx
decl %ecx
movl %ecx, %eax
cltd
idivl %esi
subl %edx, %ecx
movl %ecx, 0x328e9e(%rip)    # 0x33b394
movb $0x1, 0x328eec(%rip)    # 0x33b3e9
popq %rbx
popq %r14
popq %rbp
retq
movl 0x2062fc(%rip), %ebx    # 0x218804
movl 0x206305(%rip), %r14d   # 0x218814
leal (%r14,%r9), %eax
decl %eax
cltd
idivl %r14d
addl %r9d, %r14d
addl %edx, %ecx
subl %ecx, %ebx
leal (%rbx,%r14), %eax
decl %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x328e5b(%rip)    # 0x33b390
movl %r8d, %eax
subl 0x328e4e(%rip), %eax    # 0x33b38c
movl %eax, 0x328e50(%rip)    # 0x33b394
movl $0x3, 0x208ebe(%rip)    # 0x21b40c
movl $0x4, 0x328e40(%rip)    # 0x33b398
testb %r11b, %r11b
sete %cl
movl 0x206320(%rip), %eax    # 0x218884
cmpl %r8d, %eax
setl %dl
testb %dl, %cl
jne 0x1238b
jmp 0x1239f
cmpb $0x3, %al
setne %al
cmpl $0x4fa, %r8d            # imm = 0x4FA
setl %cl
orb %al, %cl
jne 0x124fd
movl 0x20627c(%rip), %eax    # 0x218810
addl %eax, %eax
subl %eax, 0x328df8(%rip)    # 0x33b394
jmp 0x124fd