// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorpd %xmm0, %xmm0
movsd 0x214e48(%rip), %xmm1   # 0x226d10
ucomisd %xmm0, %xmm1
seta %al
movsd 0x214e41(%rip), %xmm1   # 0x226d18
ucomisd %xmm0, %xmm1
seta %dl
ucomisd 0x214e12(%rip), %xmm0   # 0x226cf8
setb %dil
andl $0x0, 0x3133b7(%rip)    # 0x3252a8
movsd 0x214e0f(%rip), %xmm1   # 0x226d08
movsd 0x214dff(%rip), %xmm2   # 0x226d00
movl 0x1f0909(%rip), %ecx    # 0x202810
imull $0x4f, %ecx, %esi
movl %esi, 0x31339c(%rip)    # 0x3252ac
cmpb $0x4c, 0x2e4891(%rip)   # 0x2f67a8
pushq $0x64
popq %rbx
jne 0x11f42
xorl %edi, %edi
cmpb $0x0, 0x3133b2(%rip)    # 0x3252d7
pushq $0x1
popq %rax
pushq $0x14
popq %rsi
cmovel %eax, %esi
sete %dil
negl %edi
orl $-0x14, %edi
movl %esi, 0x31336b(%rip)    # 0x3252a8
jmp 0x11ff6
movl 0x1f08b8(%rip), %esi    # 0x202800
movb 0x214def(%rip), %r8b    # 0x226d3e
cmpl $0x690, %esi            # imm = 0x690
jl 0x11f73
testb %r8b, %r8b
je 0x11f8f
cmpb $0x0, 0x31334d(%rip)    # 0x3252b0
je 0x11fd4
movl 0x313401(%rip), %esi    # 0x32536c
addl 0x3133f7(%rip), %esi    # 0x325368
jmp 0x11fde
testb %r8b, %r8b
je 0x11fbf
movl 0x313412(%rip), %eax    # 0x325390
movl %eax, 0x313324(%rip)    # 0x3252a8
pushq $-0x1
popq %rdi
movl 0x313407(%rip), %esi    # 0x325394
jmp 0x11ff6
cmpb $0x0, 0x313452(%rip)    # 0x3253e8
je 0x11fe3
cmpb $0x0, 0x1f3469(%rip)    # 0x205408
je 0x11fd4
movb 0x1f346e(%rip), %al     # 0x205415
orb 0x1f3466(%rip), %al     # 0x205413
je 0x11fd4
addl %ecx, %ecx
addl 0x3133b1(%rip), %ecx    # 0x325368
addl 0x3133af(%rip), %ecx    # 0x32536c
jmp 0x11ff1
cmpl $0x59b, %esi            # imm = 0x59B
jl 0x120da
cmpb $0x0, 0x313416(%rip)    # 0x3253e8
je 0x11fe3
addl %ecx, %ecx
addl 0x3133b0(%rip), %ecx    # 0x32538c
subl %ecx, %esi
pushq $-0x1
popq %rdi
jmp 0x11ff6
addl %ecx, %ecx
addl 0x3133a9(%rip), %ecx    # 0x325394
addl 0x31339b(%rip), %ecx    # 0x32538c
pushq $-0x1
popq %rdi
movl %ecx, %esi
movl %esi, 0x3132b0(%rip)    # 0x3252ac
movb 0x2e47a5(%rip), %r8b    # 0x2f67a8
movl 0x1f07f7(%rip), %ecx    # 0x202800
cmpb $0x4c, %r8b
jne 0x1201f
cmpl $0x1c1, %ecx            # imm = 0x1C1
jg 0x1205e
movl 0x31328b(%rip), %eax    # 0x3252a8
jmp 0x1206e
movl %ecx, %edi
subl %esi, %edi
imull $0x31a, 0x1fb517(%rip), %eax # imm = 0x31A
cltd
idivl %ebx
cmpl %eax, %ecx
jl 0x1208c
cmpb $0x0, 0x214d03(%rip)    # 0x226d3e
jne 0x1208c
movl 0x313265(%rip), %eax    # 0x3252a8
leal (%rax,%rdi), %esi
movl 0x1f0830(%rip), %edx    # 0x20287c
leal -0x80(%rdx), %r9d
cmpl %r9d, %esi
jl 0x1208c
subl %eax, %edx
addl $-0x80, %edx
movl %edx, %edi
jmp 0x1208c
movl 0x1f07a0(%rip), %edx    # 0x202804
movl 0x31323e(%rip), %eax    # 0x3252a8
cmpl %edx, %ecx
jge 0x1207d
movl 0x1f07a0(%rip), %edx    # 0x202814
addl %ecx, %edi
leal (%rax,%rdx,4), %eax
subl %eax, %edi
jmp 0x1208c
movl 0x1f0791(%rip), %esi    # 0x202814
addl %edi, %edx
leal (%rax,%rsi,4), %eax
subl %eax, %edx
movl %edx, %edi
movl $0x280, %eax            # imm = 0x280
cmpl %eax, %edi
cmovll %edi, %eax
addl $-0x14, %eax
pushq $0xa
popq %rsi
cltd
idivl %esi
imull $0xa, %eax, %edi
leal 0x14(%rdi), %edx
movl %esi, 0x3131f1(%rip)    # 0x32529c
movl %eax, 0x3131ef(%rip)    # 0x3252a0
movl %edi, 0x3131ed(%rip)    # 0x3252a4
movl %edx, 0x3131db(%rip)    # 0x325298
cmpb $0x4c, %r8b
jne 0x120d3
subl %edx, %ecx
pushq $0x2
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
movl %eax, 0x3131d9(%rip)    # 0x3252ac
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorpd %xmm3, %xmm3
cmpltpd %xmm2, %xmm3
cmpltpd %xmm1, %xmm0
orpd %xmm3, %xmm0
movd %xmm0, %r8d
orb %dl, %al
orb %dil, %al
orb %r8b, %al
cmpl $0x4fa, %esi            # imm = 0x4FA
setl %dl
notb %al
orb %dl, %al
testb $0x1, %al
jne 0x12127
pushq $0x1
popq %rdi
callq 0xc71ad
movl 0x1f06f8(%rip), %ecx    # 0x202810
movl 0x31318e(%rip), %esi    # 0x3252ac
testl %eax, %eax
je 0x12154
imull $0x2c, %ecx, %eax
jmp 0x12157
cmpl $0x3e2, %esi            # imm = 0x3E2
jl 0x12137
imull $0x53, %ecx, %esi
jmp 0x11fde
imull $0x31a, 0x1fb403(%rip), %eax # imm = 0x31A
cltd
idivl %ebx
cmpl %eax, %esi
jl 0x11f78
imull $0x51, %ecx, %esi
jmp 0x11fde
imull $0xc, %ecx, %eax
addl %eax, %esi
jmp 0x11fde