// File: /workspace/github_cpp_makefile_star2_O1/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 0x22a5ab(%rip), %xmm1   # 0x23cd10
ucomisd %xmm0, %xmm1
seta %dl
movsd 0x22a5a4(%rip), %xmm1   # 0x23cd18
ucomisd %xmm0, %xmm1
seta %sil
movsd 0x22a584(%rip), %xmm1   # 0x23cd08
ucomisd 0x22a56c(%rip), %xmm0   # 0x23ccf8
movsd 0x22a56c(%rip), %xmm2   # 0x23cd00
setb %dil
movl $0x0, 0x328b06(%rip)    # 0x33b2a8
movl 0x206068(%rip), %eax    # 0x218810
imull $0x4f, %eax, %ecx
movl %ecx, 0x328afb(%rip)    # 0x33b2ac
cmpb $0x4c, 0x2f9ff0(%rip)   # 0x30c7a8
jne 0x127e3
xorl %edx, %edx
cmpb $0x0, 0x328b14(%rip)    # 0x33b2d7
movl $0x1, %eax
movl $0x14, %ecx
cmovel %eax, %ecx
sete %dl
negl %edx
orl $-0x14, %edx
movl %ecx, 0x328aca(%rip)    # 0x33b2a8
jmp 0x1289d
movl 0x206017(%rip), %ecx    # 0x218800
movb 0x22a54e(%rip), %r8b    # 0x23cd3e
cmpl $0x690, %ecx            # imm = 0x690
jl 0x12814
testb %r8b, %r8b
je 0x12832
cmpb $0x0, 0x328aac(%rip)    # 0x33b2b0
je 0x12877
movl 0x328b60(%rip), %ecx    # 0x33b36c
addl 0x328b56(%rip), %ecx    # 0x33b368
jmp 0x12881
testb %r8b, %r8b
je 0x12862
movl 0x328b71(%rip), %eax    # 0x33b390
movl %eax, 0x328a83(%rip)    # 0x33b2a8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl 0x328b64(%rip), %ecx    # 0x33b394
jmp 0x1289d
cmpb $0x0, 0x328baf(%rip)    # 0x33b3e8
je 0x12888
cmpb $0x0, 0x208bc6(%rip)    # 0x21b408
je 0x12877
movb 0x208bcb(%rip), %dl     # 0x21b415
orb 0x208bc3(%rip), %dl     # 0x21b413
je 0x12877
addl %eax, %eax
addl 0x328b0e(%rip), %eax    # 0x33b368
addl 0x328b0c(%rip), %eax    # 0x33b36c
jmp 0x12896
cmpl $0x59b, %ecx            # imm = 0x59B
jl 0x129d8
cmpb $0x0, 0x328b73(%rip)    # 0x33b3e8
je 0x12888
addl %eax, %eax
addl 0x328b0d(%rip), %eax    # 0x33b38c
subl %eax, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
jmp 0x1289d
addl %eax, %eax
addl 0x328b04(%rip), %eax    # 0x33b394
addl 0x328af6(%rip), %eax    # 0x33b38c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %eax, %ecx
movl %ecx, 0x328a09(%rip)    # 0x33b2ac
movb 0x2f9eff(%rip), %al     # 0x30c7a8
movl 0x205f51(%rip), %ecx    # 0x218800
cmpb $0x4c, %al
jne 0x128da
cmpl $0x1c2, %ecx            # imm = 0x1C2
jl 0x128c5
movl 0x205f43(%rip), %esi    # 0x218804
cmpl %esi, %ecx
jge 0x12932
movl 0x205f49(%rip), %esi    # 0x218814
addl %edx, %ecx
shll $0x2, %esi
addl 0x3289d2(%rip), %esi    # 0x33b2a8
subl %esi, %ecx
jmp 0x12947
movl %ecx, %edx
subl 0x3289ca(%rip), %edx    # 0x33b2ac
imull $0x31a, 0x210c58(%rip), %esi # imm = 0x31A
movl %edx, 0x3289a6(%rip)    # 0x33b298
movslq %esi, %rsi
imulq $0x51eb851f, %rsi, %rsi # imm = 0x51EB851F
movq %rsi, %rdi
shrq $0x3f, %rdi
sarq $0x25, %rsi
addl %edi, %esi
cmpl %esi, %ecx
jl 0x1294d
cmpb $0x0, 0x22a42a(%rip)    # 0x23cd3e
jne 0x1294d
movl 0x32898c(%rip), %esi    # 0x33b2a8
addl %esi, %edx
movl 0x205f58(%rip), %ecx    # 0x21887c
leal -0x80(%rcx), %edi
cmpl %edi, %edx
jl 0x1294d
subl %esi, %ecx
addl $-0x80, %ecx
jmp 0x12947
movl 0x205edc(%rip), %ecx    # 0x218814
addl %edx, %esi
shll $0x2, %ecx
addl 0x328965(%rip), %ecx    # 0x33b2a8
subl %ecx, %esi
movl %esi, %ecx
movl %ecx, 0x32894b(%rip)    # 0x33b298
cmpl $0x281, 0x328941(%rip)  # imm = 0x281
jl 0x12963
movl $0x280, 0x328935(%rip)  # imm = 0x280
movl 0x32892f(%rip), %ecx    # 0x33b298
addl $-0x14, %ecx
movslq %ecx, %rcx
imulq $0x66666667, %rcx, %rdx # imm = 0x66666667
movq %rdx, %rcx
shrq $0x3f, %rcx
sarq $0x22, %rdx
addl %ecx, %edx
leal (%rdx,%rdx), %ecx
leal (%rcx,%rcx,4), %esi
movl $0x280, %edi            # imm = 0x280
cmpl %edi, %esi
cmovll %esi, %edi
movl $0x26c, %ecx            # imm = 0x26C
cmpl %ecx, %esi
cmovll %esi, %ecx
addl $0x14, %ecx
movl $0xa, 0x3288f2(%rip)    # 0x33b29c
movl %edx, 0x3288f0(%rip)    # 0x33b2a0
movl %edi, 0x3288ee(%rip)    # 0x33b2a4
movl %ecx, 0x3288dc(%rip)    # 0x33b298
cmpb $0x4c, %al
jne 0x129d7
movl 0x205e3a(%rip), %eax    # 0x218800
subl %ecx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movl %ecx, 0x3288d5(%rip)    # 0x33b2ac
retq
xorpd %xmm3, %xmm3
cmpltpd %xmm2, %xmm3
cmpltpd %xmm1, %xmm0
orpd %xmm3, %xmm0
movd %xmm0, %r8d
orb %sil, %dl
orb %dil, %dl
orb %r8b, %dl
cmpl $0x4fa, %ecx            # imm = 0x4FA
setl %sil
notb %dl
orb %sil, %dl
testb $0x1, %dl
jne 0x12a35
pushq %rbp
movq %rsp, %rbp
movl $0x1, %edi
callq 0xd84d7
movl 0x205df0(%rip), %edx    # 0x218810
movl 0x328886(%rip), %ecx    # 0x33b2ac
testl %eax, %eax
popq %rbp
je 0x12a79
imull $0x2c, %edx, %eax
addl %eax, %ecx
jmp 0x12881
cmpl $0x3e2, %ecx            # imm = 0x3E2
jl 0x12a45
imull $0x53, %eax, %ecx
jmp 0x12881
imull $0x31a, 0x210af5(%rip), %edx # imm = 0x31A
movslq %edx, %rdx
imulq $0x51eb851f, %rdx, %rdx # imm = 0x51EB851F
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x25, %rdx
addl %esi, %edx
cmpl %edx, %ecx
jl 0x12819
leal (%rax,%rax,8), %eax
leal (%rax,%rax,8), %ecx
jmp 0x12881
leal (%rdx,%rdx,2), %eax
leal (%rcx,%rax,4), %ecx
jmp 0x12881