// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathgps.cpp
// Function: show_lla(int)
void show_lla(int why)
{
   if(text_mode && first_key) return;
   if(zoom_screen) return;
   if(luxor) return;
   if(all_adevs && (all_adev_row < (ALL_ROW+5))) return;

   if(lat < (0.0-PI)) return;    // filter out any bogosity
   if(lat > PI) return;
   if(lon < (0.0-PI)) return;
   if(lon > PI) return;
   if(alt > 100000.0) return;
   if(alt < (0.0-100000.0)) return;

   // get a default precise position from the last self-surveyed coordinates
   if((have_initial_posn == 0) && (lla_log == 0) && (lat || lon || alt)) {  
      precise_lat = lat;
      precise_lon = lon;
      precise_alt = alt;
      have_precise_lla = (-3);

      #ifdef BUFFER_LLA
         clear_lla_points(0);
      #endif

      cos_factor = cos(lat);
      if(cos_factor == 0.0) cos_factor = 0.001;
      if(rcvr_mode == RCVR_MODE_HOLD) have_initial_posn = 1;
have_initial_posn = 1;  // ggggggggggg
   }
   
   #ifdef PRECISE_STUFF
      if(lla_file && (gps_status == GPS_FIXES) && have_time && (precision_survey || show_fixes)) {
         fprintf(lla_file, "%-6lu %X %13.8lf  %13.8lf  %8.3lf\n", 
         (unsigned long) tow, gps_status, lat*RAD_TO_DEG, lon*RAD_TO_DEG, alt);
      }

      // user requested a precision survey from the command line
      if(have_initial_posn && have_time && user_precision_survey) {
         if(user_precision_survey == 1) {  // start precise survey
            user_precision_survey = 0;
            start_precision_survey(200);
         }
         else {  // start 3D fix mode
            user_precision_survey = 0;
            start_3d_fixes(4, 20);
            config_screen(2202);
         }
      }
   #endif  // PRECISE_STUFF

   format_lla(lat, lon, alt,  POSN_ROW+1+eofs, POSN_COL, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x164988(%rip), %rax    # 0x2187d8
cmpl $0x0, (%rax)
setne %al
leaq 0x18b0fb(%rip), %rcx    # 0x23ef58
cmpl $0x0, (%rcx)
setne %cl
testb %cl, %al
jne 0xb4076
leaq 0x258936(%rip), %rax    # 0x30c7a8
cmpb $0x0, (%rax)
jne 0xb4076
leaq 0x18b0bc(%rip), %rax    # 0x23ef3e
cmpb $0x0, (%rax)
jne 0xb4076
leaq 0x188eac(%rip), %rax    # 0x23cd3e
cmpb $0x0, (%rax)
setne %al
leaq 0x164915(%rip), %rcx    # 0x2187b4
cmpl $0xc, (%rcx)
setl %cl
testb %cl, %al
jne 0xb4076
leaq 0x25911c(%rip), %rbx    # 0x30cfd0
movsd (%rbx), %xmm0
movapd 0x552c0(%rip), %xmm3    # 0x109180
movapd %xmm0, %xmm1
andpd %xmm3, %xmm1
ucomisd 0x57948(%rip), %xmm1    # 0x10b818
ja 0xb4076
leaq 0x2590fb(%rip), %r14    # 0x30cfd8
movsd (%r14), %xmm1
movapd %xmm1, %xmm2
andpd %xmm3, %xmm2
ucomisd 0x57926(%rip), %xmm2    # 0x10b818
ja 0xb4076
leaq 0x2590e1(%rip), %r15    # 0x30cfe0
movsd (%r15), %xmm2
andpd %xmm2, %xmm3
ucomisd 0x551b8(%rip), %xmm3    # 0x1090c8
ja 0xb4076
leaq 0x259f83(%rip), %r12    # 0x30dea0
leaq 0x18ac67(%rip), %rax    # 0x23eb8b
movb (%rax), %al
orb (%r12), %al
jne 0xb3fc8
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jne 0xb3f4c
jp 0xb3f4c
ucomisd %xmm3, %xmm1
jne 0xb3f4c
jp 0xb3f4c
ucomisd %xmm3, %xmm2
jne 0xb3f4c
jnp 0xb3fc8
leaq 0x28739d(%rip), %rax    # 0x33b2f0
movsd %xmm0, (%rax)
leaq 0x28739a(%rip), %rax    # 0x33b2f8
movsd %xmm1, (%rax)
leaq 0x287397(%rip), %rax    # 0x33b300
movsd %xmm2, (%rax)
leaq 0x287394(%rip), %rax    # 0x33b308
movl $0xfffffffd, (%rax)     # imm = 0xFFFFFFFD
xorl %edi, %edi
callq 0xfa6ba
movsd (%rbx), %xmm0
callq 0x9710
xorpd %xmm2, %xmm2
cmpeqsd %xmm0, %xmm2
movsd 0x5798d(%rip), %xmm1    # 0x10b928
andpd %xmm2, %xmm1
andnpd %xmm0, %xmm2
orpd %xmm1, %xmm2
leaq 0x25901a(%rip), %rax    # 0x30cfc8
movlpd %xmm2, (%rax)
leaq 0x259117(%rip), %rax    # 0x30d0d0
cmpb $0x7, (%rax)
jne 0xb3fc3
movb $0x1, (%r12)
movb $0x1, (%r12)
leaq 0x18a3d1(%rip), %rax    # 0x23e3a0
movq (%rax), %rdi
leaq 0x18af03(%rip), %r13    # 0x23eedc
testq %rdi, %rdi
je 0xb4038
leaq 0x2594b7(%rip), %rax    # 0x30d49c
cmpl $0x0, (%rax)
jne 0xb4038
cmpb $0x0, (%r13)
je 0xb4038
leaq 0x259ea0(%rip), %rax    # 0x30de98
leaq 0x2872d5(%rip), %rcx    # 0x33b2d4
movb (%rcx), %cl
orb (%rax), %cl
je 0xb4038
leaq 0x259730(%rip), %rax    # 0x30d73c
movl (%rax), %edx
movsd 0x55142(%rip), %xmm1    # 0x109158
movsd (%rbx), %xmm0
mulsd %xmm1, %xmm0
mulsd (%r14), %xmm1
movsd (%r15), %xmm2
leaq 0x7337e(%rip), %rsi     # 0x1273ad
xorl %ecx, %ecx
movb $0x3, %al
callq 0x9560
cmpb $0x0, (%r12)
setne %al
cmpb $0x0, (%r13)
setne %dl
andb %al, %dl
leaq 0x259e48(%rip), %rax    # 0x30de99
movb (%rax), %cl
testb %cl, %cl
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xb409e
movb $0x0, (%rax)
cmpb $0x1, %cl
jne 0xb4085
movl $0xc8, %edi
callq 0xfa793
jmp 0xb409e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
movl $0x14, %esi
callq 0xfa611
movl $0x89a, %edi            # imm = 0x89A
callq 0xcf81
movsd (%rbx), %xmm0
movsd (%r14), %xmm1
movsd (%r15), %xmm2
leaq 0x18ae8d(%rip), %rax    # 0x23ef40
movl (%rax), %edi
addl $0x7, %edi
xorl %esi, %esi
movl $0x1, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xb24b9