// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: config_lla()
void config_lla()
{
int lla_margin;
int adev_flag;

   // how and where to draw the lat/lon/altitude map

   adev_flag = 1;
   if     (pps_adev_period > 0.0) ;        // aaaapppp
   else if(osc_adev_period > 0.0) ;
   else if(chc_adev_period > 0.0) ;
   else if(chd_adev_period > 0.0) ;
   else if(adev_period <= 0.0) adev_flag = 0;

   LLA_ROW  = (ADEV_ROW*TEXT_HEIGHT);  // on small screens the lla map takes the place of the adev tables
   LLA_COL  = (ADEV_COL*TEXT_WIDTH);
   lla_margin = 1;
   if(zoom_screen == 'L') {
      if(reading_lla) lla_margin = 20;
      LLA_ROW = lla_margin;
      LLA_COL = lla_margin;
   }
   else if(WIDE_SCREEN) {
      if(all_adevs) {
         if(plot_lla) LLA_COL = WATCH_COL + WATCH_SIZE;
         else         LLA_COL = SCREEN_WIDTH - AZEL_SIZE - (TEXT_WIDTH*2);
      }
      else if(shared_plot) {
         if(plot_watch && (plot_azel || plot_signals)) LLA_COL = WATCH_COL + WATCH_SIZE + (TEXT_WIDTH*2);
         else                                          LLA_COL = SCREEN_WIDTH - AZEL_SIZE - (TEXT_WIDTH*2);
      }
      else {
         LLA_COL = AZEL_COL + AZEL_SIZE + (TEXT_WIDTH*2);
      }
   }
   else if(all_adevs) {
      LLA_ROW = AZEL_ROW;
      LLA_COL = AZEL_COL;
   }
   else if(SCREEN_WIDTH > BIG_WIDTH) {  // both lla map and azel map will fit on big screens
      if(shared_plot) LLA_COL = SCREEN_WIDTH - AZEL_SIZE - (TEXT_WIDTH*2);
      else            LLA_COL = AZEL_COL + AZEL_SIZE + (TEXT_WIDTH*2);
   }
// else if(SCREEN_WIDTH >= WIDE_WIDTH) {
   else if((SCREEN_WIDTH >= WIDE_WIDTH) && adev_flag) {
      if(adevs_active(1)) LLA_COL += (TEXT_WIDTH*44); // adevs and lla will fit
      else                LLA_COL += (TEXT_WIDTH*12);
   }
   else if(SCREEN_WIDTH >= MEDIUM_WIDTH) {
      LLA_COL += (4*TEXT_WIDTH);
   }
   else if(SCREEN_WIDTH >= NARROW_SCREEN) {
      LLA_COL += (2*TEXT_WIDTH);
   }
   else if(0 && all_adevs) {
      LLA_COL = AZEL_COL + AZEL_SIZE + (TEXT_WIDTH*2);
   }
   else {  // undersized screens
      LLA_ROW = AZEL_ROW;
      LLA_COL = AZEL_COL;
   }

   if(zoom_screen == 'L') {
      if((SCREEN_WIDTH < TINY_TINY_WIDTH) || (SCREEN_WIDTH < SCREEN_HEIGHT)) {  //piss
         LLA_SIZE = (SCREEN_WIDTH-LLA_ROW-TEXT_HEIGHT*4-lla_margin);
      }
      else {
         LLA_SIZE = (SCREEN_HEIGHT-LLA_ROW-TEXT_HEIGHT*4-lla_margin);
      }
   }
   else {
      LLA_SIZE = (SCREEN_WIDTH-LLA_COL);
      if(SCREEN_WIDTH >= NARROW_SCREEN) { // lla map maight be in the plot area
         if(all_adevs) ;
         else if((LLA_ROW+LLA_SIZE) >= (PLOT_ROW-128)) LLA_SIZE = (PLOT_ROW-LLA_ROW-128);
      }
   }
//sprintf(debug_text3, "share:%d  LLA: %d,%d,%d  XY=%d,%d  AZEL:%d,%d %d  WSIZE:%d  ADEV:%d,%d  SCRW:%d",
//shared_plot, LLA_COL,LLA_ROW,LLA_SIZE,  LLA_X,LLA_Y, AZEL_COL,AZEL_ROW,AZEL_SIZE, WATCH_SIZE, ADEV_COL,ADEV_ROW, SCREEN_WIDTH);

   if(LLA_SIZE > MAX_LLA_SIZE) LLA_SIZE = MAX_LLA_SIZE;
   LLA_MARGIN = 10;              // border width in pixels
   LLA_SIZE -= (LLA_MARGIN*2);   // tweek size so it matches the grid
   LLA_SIZE /= LLA_DIVISIONS;    // round size to a multiple of the grid size
   LLA_SIZE *= LLA_DIVISIONS;
   lla_step = LLA_SIZE / LLA_DIVISIONS;  // pixels per grid division
   lla_width = lla_step * LLA_DIVISIONS;
   if(lla_width > MAX_LLA_SIZE) lla_width = MAX_LLA_SIZE;
   LLA_SIZE += (LLA_MARGIN*2);   // add a margin around the lla circles
   if(LLA_SIZE > MAX_LLA_SIZE) LLA_SIZE = MAX_LLA_SIZE;
   if(zoom_screen == 'L') {
      LLA_COL = (SCREEN_WIDTH - LLA_SIZE) / 2;
   }
}

// Assembly:
xorpd %xmm0, %xmm0
movsd 0x22a66d(%rip), %xmm1   # 0x23cd10
ucomisd %xmm0, %xmm1
seta %al
movsd 0x22a666(%rip), %xmm1   # 0x23cd18
ucomisd %xmm0, %xmm1
seta %sil
movsd 0x22a646(%rip), %xmm1   # 0x23cd08
ucomisd 0x22a62e(%rip), %xmm0   # 0x23ccf8
movsd 0x22a62e(%rip), %xmm2   # 0x23cd00
setb %dil
movl $0x0, 0x328bc8(%rip)    # 0x33b2a8
movl 0x20612a(%rip), %edx    # 0x218810
imull $0x4f, %edx, %ecx
movl %ecx, 0x328bbd(%rip)    # 0x33b2ac
cmpb $0x4c, 0x2fa0b2(%rip)   # 0x30c7a8
jne 0x12721
xorl %eax, %eax
cmpb $0x0, 0x328bd6(%rip)    # 0x33b2d7
movl $0x1, %edx
movl $0x14, %ecx
cmovel %edx, %ecx
sete %al
negl %eax
orl $-0x14, %eax
movl %ecx, 0x328b8c(%rip)    # 0x33b2a8
jmp 0x127db
movl 0x2060d9(%rip), %ecx    # 0x218800
movb 0x22a610(%rip), %r8b    # 0x23cd3e
cmpl $0x690, %ecx            # imm = 0x690
jl 0x12752
testb %r8b, %r8b
je 0x12770
cmpb $0x0, 0x328b6e(%rip)    # 0x33b2b0
je 0x127b5
movl 0x328c22(%rip), %ecx    # 0x33b36c
addl 0x328c18(%rip), %ecx    # 0x33b368
jmp 0x127bf
testb %r8b, %r8b
je 0x127a0
movl 0x328c33(%rip), %eax    # 0x33b390
movl %eax, 0x328b45(%rip)    # 0x33b2a8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl 0x328c26(%rip), %ecx    # 0x33b394
jmp 0x127db
cmpb $0x0, 0x328c71(%rip)    # 0x33b3e8
je 0x127c6
cmpb $0x0, 0x208c88(%rip)    # 0x21b408
je 0x127b5
movb 0x208c8d(%rip), %al     # 0x21b415
orb 0x208c85(%rip), %al     # 0x21b413
je 0x127b5
addl %edx, %edx
addl 0x328bd0(%rip), %edx    # 0x33b368
addl 0x328bce(%rip), %edx    # 0x33b36c
jmp 0x127d4
cmpl $0x59b, %ecx            # imm = 0x59B
jl 0x128ec
cmpb $0x0, 0x328c35(%rip)    # 0x33b3e8
je 0x127c6
addl %edx, %edx
addl 0x328bcf(%rip), %edx    # 0x33b38c
subl %edx, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x127db
addl %edx, %edx
addl 0x328bc6(%rip), %edx    # 0x33b394
addl 0x328bb8(%rip), %edx    # 0x33b38c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %edx, %ecx
movl %ecx, 0x328acb(%rip)    # 0x33b2ac
movb 0x2f9fc0(%rip), %sil    # 0x30c7a8
movl 0x206012(%rip), %edx    # 0x218800
cmpb $0x4c, %sil
jne 0x12804
cmpl $0x1c1, %edx            # imm = 0x1C1
jg 0x12858
movl 0x328aa6(%rip), %ecx    # 0x33b2a8
jmp 0x12868
movl %edx, %eax
imull $0x31a, 0x210d34(%rip), %edi # imm = 0x31A
subl %ecx, %eax
movslq %edi, %rcx
imulq $0x51eb851f, %rcx, %rcx # imm = 0x51EB851F
movq %rcx, %rdi
shrq $0x3f, %rdi
sarq $0x25, %rcx
addl %edi, %ecx
cmpl %ecx, %edx
jl 0x12888
cmpb $0x0, 0x22a50a(%rip)    # 0x23cd3e
jne 0x12888
movl 0x328a6c(%rip), %ecx    # 0x33b2a8
leal (%rcx,%rax), %r8d
movl 0x206036(%rip), %edi    # 0x21887c
leal -0x80(%rdi), %r9d
cmpl %r9d, %r8d
jl 0x12888
subl %ecx, %edi
addl $-0x80, %edi
movl %edi, %eax
jmp 0x12888
movl 0x205fa6(%rip), %edi    # 0x218804
movl 0x328a44(%rip), %ecx    # 0x33b2a8
cmpl %edi, %edx
jge 0x12877
movl 0x205fa6(%rip), %edi    # 0x218814
addl %edx, %eax
leal (%rcx,%rdi,4), %ecx
subl %ecx, %eax
jmp 0x12888
movl 0x205f96(%rip), %r8d    # 0x218814
addl %eax, %edi
leal (%rcx,%r8,4), %eax
subl %eax, %edi
movl %edi, %eax
movl $0x280, %ecx            # imm = 0x280
cmpl %ecx, %eax
cmovll %eax, %ecx
addl $-0x14, %ecx
movslq %ecx, %rax
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rax
addl %ecx, %eax
leal (%rax,%rax), %ecx
movl $0xa, 0x3289e3(%rip)    # 0x33b29c
movl %eax, 0x3289e1(%rip)    # 0x33b2a0
leal (%rcx,%rcx,4), %eax
movl %eax, 0x3289dc(%rip)    # 0x33b2a4
leal (%rcx,%rcx,4), %eax
addl $0x14, %eax
movl %eax, 0x3289c4(%rip)    # 0x33b298
cmpb $0x4c, %sil
jne 0x128eb
subl %eax, %edx
movl %edx, %eax
shrl $0x1f, %eax
addl %edx, %eax
sarl %eax
movl %eax, 0x3289c1(%rip)    # 0x33b2ac
retq
xorpd %xmm3, %xmm3
cmpltpd %xmm2, %xmm3
cmpltpd %xmm1, %xmm0
orpd %xmm3, %xmm0
movd %xmm0, %r8d
orb %sil, %al
orb %dil, %al
orb %r8b, %al
cmpl $0x4fa, %ecx            # imm = 0x4FA
setl %sil
notb %al
orb %sil, %al
testb $0x1, %al
jne 0x12948
pushq %rbp
movq %rsp, %rbp
movl $0x1, %edi
callq 0xd8c0d
movl 0x205edd(%rip), %edx    # 0x218810
movl 0x328973(%rip), %ecx    # 0x33b2ac
testl %eax, %eax
popq %rbp
je 0x1298b
imull $0x2c, %edx, %eax
addl %eax, %ecx
jmp 0x127bf
cmpl $0x3e2, %ecx            # imm = 0x3E2
jl 0x12958
imull $0x53, %edx, %ecx
jmp 0x127bf
imull $0x31a, 0x210be2(%rip), %eax # imm = 0x31A
cltq
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
movq %rax, %rsi
shrq $0x3f, %rsi
sarq $0x25, %rax
addl %esi, %eax
cmpl %eax, %ecx
jl 0x12757
leal (%rdx,%rdx,8), %eax
leal (%rax,%rax,8), %ecx
jmp 0x127bf
leal (%rdx,%rdx,2), %eax
leal (%rcx,%rax,4), %ecx
jmp 0x127bf