// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: change_lla_scale()
void change_lla_scale()
{
double lw;
double radius;

   // re-scale the lat/lon scattergram if the lat/lon span changes

   LLA_SPAN = calc_lla_span(1);  // meters or feet per division
   user_set_ref_lla = 2;
   ref_lat = ((min_q_lat + max_q_lat) / 2.0) * DEG_TO_RAD;
   ref_lon = ((min_q_lon + max_q_lon) / 2.0) * DEG_TO_RAD;
   ref_alt = alt;

   ref_lat_span = (max_q_lat - min_q_lat);  // in degrees
   ref_lon_span = (max_q_lon - min_q_lon);

   cos_factor = cos(ref_lat);
   if(cos_factor == 0.0) cos_factor = 0.001;
   lw = ref_lon_span = ((double)LLA_SPAN * (double) LLA_DIVISIONS);  // scattergram width in meters or feet
   if(angle_units) {
      if(angle_units[0] == 'f') lw /= FEET_PER_METER;  // lw now in meters
      else if(angle_units[0] == 'l') lw /= LG_PER_METER;  // lw now in meters
   }

   radius = (2.0*PI*earth_radius(0.0,ref_alt)*1000.0);    // divided by earth circumference in meters
   if(radius > 0.0) ref_lon_span /= radius;
   else ref_lon_span = 0.0;
   ref_lon_span *= 360.0;  // scattergram width in degrees
if(show_debug_info) sprintf(debug_text3, "lla_span:%f  lla_divs:%d  lw:%.9f  ref_lon_span: %.9f degrees", LLA_SPAN,LLA_DIVISIONS,lw,ref_lon_span);  //llascale
   ref_lat_span = ref_lon_span;
if(show_debug_info) {
   sprintf(debug_text4, "new span,divs %d,%.2f:  last:%.2f  ref:%.9f %.9f  dist:%.9f %.9f",   //llascale
   LLA_DIVISIONS, LLA_SPAN, last_lla_span, ref_lat*RAD_TO_DEG,ref_lon*RAD_TO_DEG, ref_lat_span,ref_lon_span);
}
   last_lla_span = LLA_SPAN * LLA_THRESH;  //llascale
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
callq 0x15b350
leaq 0x23ee87(%rip), %rax    # 0x39a470
movsd %xmm0, (%rax)
leaq 0x23ef2c(%rip), %rax    # 0x39a520
movl $0x2, (%rax)
leaq 0x210bdf(%rip), %rax    # 0x36c1e0
movsd (%rax), %xmm0
leaq 0x210bdc(%rip), %rax    # 0x36c1e8
addsd (%rax), %xmm0
movsd 0x13b38(%rip), %xmm1    # 0x16f150
divsd %xmm1, %xmm0
movsd 0x1606c(%rip), %xmm1    # 0x171690
mulsd %xmm1, %xmm0
leaq 0x23eec1(%rip), %rax    # 0x39a4f0
movsd %xmm0, (%rax)
leaq 0x210bb6(%rip), %rax    # 0x36c1f0
movsd (%rax), %xmm0
leaq 0x210bb3(%rip), %rax    # 0x36c1f8
addsd (%rax), %xmm0
movsd 0x13aff(%rip), %xmm1    # 0x16f150
divsd %xmm1, %xmm0
movsd 0x16033(%rip), %xmm1    # 0x171690
mulsd %xmm1, %xmm0
leaq 0x23ee90(%rip), %rax    # 0x39a4f8
movsd %xmm0, (%rax)
leaq 0x210b4d(%rip), %rax    # 0x36c1c0
movsd (%rax), %xmm0
leaq 0x23ee82(%rip), %rax    # 0x39a500
movsd %xmm0, (%rax)
leaq 0x210b5f(%rip), %rax    # 0x36c1e8
movsd (%rax), %xmm0
leaq 0x210b4c(%rip), %rax    # 0x36c1e0
subsd (%rax), %xmm0
movsd %xmm0, 0x357df0(%rip)   # 0x4b3490
leaq 0x210b51(%rip), %rax    # 0x36c1f8
movsd (%rax), %xmm0
leaq 0x210b3e(%rip), %rax    # 0x36c1f0
subsd (%rax), %xmm0
movsd %xmm0, 0x357dda(%rip)   # 0x4b3498
leaq 0x23ee2b(%rip), %rax    # 0x39a4f0
movsd (%rax), %xmm0
callq 0x96f0
leaq 0x210ad3(%rip), %rax    # 0x36c1a8
movsd %xmm0, (%rax)
leaq 0x210ac8(%rip), %rax    # 0x36c1a8
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x15b702
jp 0x15b702
leaq 0x210ab2(%rip), %rax    # 0x36c1a8
movsd 0x13a92(%rip), %xmm0    # 0x16f190
movsd %xmm0, (%rax)
movsd 0x139b6(%rip), %xmm0    # 0x16f0c0
leaq 0x23ed5f(%rip), %rax    # 0x39a470
mulsd (%rax), %xmm0
movsd %xmm0, 0x357d7b(%rip)   # 0x4b3498
movsd %xmm0, -0x8(%rbp)
leaq 0x210a77(%rip), %rax    # 0x36c1a0
cmpq $0x0, (%rax)
je 0x15b785
leaq 0x210a6a(%rip), %rax    # 0x36c1a0
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jne 0x15b759
movsd -0x8(%rbp), %xmm0
movsd 0x15ee2(%rip), %xmm1    # 0x171630
divsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x15b783
leaq 0x210a40(%rip), %rax    # 0x36c1a0
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x6c, %eax
jne 0x15b781
movsd -0x8(%rbp), %xmm0
movsd 0x279c0(%rip), %xmm1    # 0x183138
divsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x15b783
jmp 0x15b785
leaq 0x23ed74(%rip), %rax    # 0x39a500
movsd (%rax), %xmm1
xorps %xmm0, %xmm0
callq 0x13cab0
movaps %xmm0, %xmm1
movsd 0x273b5(%rip), %xmm0    # 0x182b58
mulsd %xmm1, %xmm0
movsd 0x13881(%rip), %xmm1    # 0x16f030
mulsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x15b7e1
movsd -0x10(%rbp), %xmm1
movsd 0x357cc5(%rip), %xmm0   # 0x4b3498
divsd %xmm1, %xmm0
movsd %xmm0, 0x357cb9(%rip)   # 0x4b3498
jmp 0x15b7ec
xorps %xmm0, %xmm0
movsd %xmm0, 0x357cac(%rip)   # 0x4b3498
movsd 0x2733c(%rip), %xmm0    # 0x182b30
mulsd 0x357c9c(%rip), %xmm0   # 0x4b3498
movsd %xmm0, 0x357c94(%rip)   # 0x4b3498
leaq 0x11c299(%rip), %rax    # 0x277aa4
cmpb $0x0, (%rax)
je 0x15b842
leaq 0x23ec59(%rip), %rax    # 0x39a470
movsd (%rax), %xmm0
movsd -0x8(%rbp), %xmm1
movsd 0x357c70(%rip), %xmm2   # 0x4b3498
leaq 0x2425f1(%rip), %rdi    # 0x39de20
leaq 0x3ca21(%rip), %rsi     # 0x198257
movl $0xa, %edx
movb $0x3, %al
callq 0x9060
movsd 0x357c4e(%rip), %xmm0   # 0x4b3498
movsd %xmm0, 0x357c3e(%rip)   # 0x4b3490
leaq 0x11c24b(%rip), %rax    # 0x277aa4
cmpb $0x0, (%rax)
je 0x15b8c4
leaq 0x23ec0b(%rip), %rax    # 0x39a470
movsd (%rax), %xmm0
leaq 0x23ec28(%rip), %rax    # 0x39a498
movsd (%rax), %xmm1
movsd 0x13904(%rip), %xmm2    # 0x16f180
leaq 0x23ec6d(%rip), %rax    # 0x39a4f0
mulsd (%rax), %xmm2
movsd 0x138f1(%rip), %xmm3    # 0x16f180
leaq 0x23ec62(%rip), %rax    # 0x39a4f8
mulsd (%rax), %xmm3
movsd 0x357bee(%rip), %xmm4   # 0x4b3490
movsd 0x357bee(%rip), %xmm5   # 0x4b3498
leaq 0x2426bf(%rip), %rdi    # 0x39df70
leaq 0x3c9dd(%rip), %rsi     # 0x198295
movl $0xa, %edx
movb $0x6, %al
callq 0x9060
movsd 0x3387c(%rip), %xmm0    # 0x18f148
leaq 0x23eb9d(%rip), %rax    # 0x39a470
mulsd (%rax), %xmm0
leaq 0x23ebba(%rip), %rax    # 0x39a498
movsd %xmm0, (%rax)
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)