// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heathui.cpp
// Function: edit_option_value()
void edit_option_value()
{
float val;
int i;
u08 c;

   // set a debug/test value
   val = (float) atof(&edit_buffer[1]);
   c = tolower(edit_buffer[0]);
   if(c == 'a') { // OA command - toggle AMU / dBc mode
      amu_flag ^= 0x08;
      if(SV6_FAMILY || ACE3 || PALISADE) {
         if(log_db == 0) {
            request_sig_levels();
         }
      }
      else {
//       set_io_options(0x13, 0x03, 0x01, amu_flag | BROADCAST_5A | DOPPLER_SMOOTH);  // ECEF+LLA+DBL PRECISION, ECEF+ENU vel,  UTC, no PACKET 5A, amu
         set_io_options(0x32, 0x02, 0x03, amu_flag | BROADCAST_5A | DOPPLER_SMOOTH);  // ECEF+LLA+DBL PRECISION, ECEF+ENU vel,  UTC, PACKET 5A, amu
      }
      request_io_options();
//    clear_signals();
   }
#ifdef ADEV_STUFF
   else if(c == 'b') {  // OB command - adev bin scale
      bin_scale = (int) val;
      if(bin_scale <= 0) bin_scale = 5;
      recalc_adev_info();
      force_adev_redraw(100);
   }
#endif
   else if(c == 'c') { // OC command - toggle continuous scrolling mode
      if(0) { // --- sat count plot scale
         if(edit_buffer[1]) small_sat_count = (int) val & 0x01;
         else               small_sat_count ^= 1;
         config_screen(100);
      }
      else {  // continuous plot scrolling mode
         if(edit_buffer[1]) continuous_scroll = (int) val & 0x01;
         else               continuous_scroll ^= 1;
         config_screen(9376);
      }
   }
#ifdef FFT_STUFF
   else if(c == 'd') {  // OD command - do FFT in dB
      if(edit_buffer[1]) fft_db = (int) val & 0x01;
      else               fft_db ^= 1;
      set_fft_scale();
      if((live_fft == 0) && (selected_plot != FFT)) {
         plot[FFT].show_plot = 1;
         calc_fft(selected_plot);
         if(fft_type == HIST_TYPE) dump_hist_plot();
         else                      dump_fft_plot();
      }
   }
#endif
   else if(c == 'e') {  // OE command - force Thunderbolt-E flag
      if(edit_buffer[1]) ebolt = (int) val & 0x01;
      else               ebolt ^= 1;
      max_sats = 8;     // used to format the sat_info data
      temp_sats = 8;
      eofs = 1;
      if(ebolt) {
         last_ebolt = (-2);
         saw_ebolt();
      }
      config_screen(101);
   }
#ifdef ADEV_STUFF
   else if(c == 'f') {  // OF command - keep adevs fresh (by periodically forcing a recalc)
      if(edit_buffer[1]) keep_adevs_fresh = (int) val & 0x01;
      else               keep_adevs_fresh = 1;
   }
#endif
   else if(c == 'g') {  // OG command - solid earth tide options
      if(edit_buffer[1]) tide_options = (int) val;
      else               tide_options ^= 1;   // toggle low res mode
   }
   else if(c == 'h') {  // OH command - erase lla plot every hour
      if(edit_buffer[1]) erase_every_hour = (int) val & 0x01;
      else               erase_every_hour ^= 1;
   }
   else if(c == 'i') {  // OI command - signal level displays
      if(edit_buffer[1])    plot_signals = (int) val;
      else if(plot_signals) plot_signals = 0;
      else                  plot_signals = 4;

      if(zoom_screen) {
         change_zoom_config(-102);
         cancel_zoom(12);      //zkzk
      }
      zoom_fixes = show_fixes;
      if(strchr(edit_buffer, 'z')) {
         change_zoom_config(10);
         zoom_screen = 'S';
      }
      else if(strchr(edit_buffer, 'Z')) {
         change_zoom_config(11);
         zoom_screen = 'S';
      }
      update_azel = 1;
      config_screen(102);
   }
   else if(c == 'j') {  // OJ command - just read and log serial data in hex
val = (float) atohex(&edit_buffer[1]);
      if(edit_buffer[1]) log_stream = (int) val & (LOG_HEX_STREAM | LOG_PACKET_ID | LOG_PACKET_START | LOG_SENT_DATA);
      else               log_stream ^= LOG_HEX_STREAM;
//    if(edit_buffer[1]) just_read = (int) val & 0x01;
//    else               just_read ^= 1;
//    log_stream = just_read;
   }
   else if(c == 'k') {  // OK command - flag message faults as time skips
      if(edit_buffer[1]) flag_faults = (int) val & 0x01;
      else               flag_faults ^= 1;
   }
#ifdef FFT_STUFF
   else if(c == 'l') {  // OL command - live fft
      if(edit_buffer[1]) show_live_fft = (int) val & 0x01;
      else               show_live_fft ^= 1;
      live_fft = selected_plot;
      if(show_live_fft && (plot[FFT].show_plot == 0)) toggle_plot(FFT);
   }
#endif
   else if(c == 'm') {  // OM command - plot magnification factor (for less than one sec/pixel)
      plot_mag = (int) val;
      if(plot_mag <= 1) plot_mag = 1;
   }
   else if(c == 'n') {  // ON command - dynamic trend line info display
      if(edit_buffer[1]) dynamic_trend_line = (int) val & 0x01;
      else               dynamic_trend_line ^= 1;
   }
   else if(c == 'p') {  // OP command - peak scale - dont let plot scale factors get smaller
      if(edit_buffer[1]) peak_scale = (int) val & 0x01;
      else               peak_scale ^= 1;
   }
   else if(c == 'q') {  // OQ command - skip over subsmapled queue entries using the slow, direct method
      if(edit_buffer[1]) slow_q_skips = (int) val & 0x01;
      else               slow_q_skips ^= 1;
   }
#ifdef ADEV_STUFF
   else if(c == 'r') {  // OR command - reset adev bins and recalc adevs
      recalc_adev_info();
   }
#endif
   else if(c == 's') {  // OS command - temperature spike filter 0=off  1=for temp pid  2=for pid and plot
      if(edit_buffer[1])  spike_mode = (int) val;
      else if(spike_mode) spike_mode = 0;
      else                spike_mode = 1;
   }
   else if(c == 't') {  // OT command - alarm/dump type based upon local or displayed time
      if(edit_buffer[1]) alarm_type = (int) val & 0x01;
      else               alarm_type ^= 1;
   }
   else if(c == 'u') {  // --- OU command - daylight savings time area
      if(edit_buffer[1]) dst_area = (int) val;
      else               dst_area = 0;
      if((dst_area < 0) || (dst_area > DST_AREAS)) dst_area = 1;
      calc_dst_times(this_year, dst_list[dst_area]);
      dst_ofs = dst_offset();
   }
   else if(c == 'v') {  // OV command - ADEV base value mode
      // (kludge used to increase dynamic range of single precision numbers)
      subtract_base_value = (u08) val;
      reset_queues(RESET_ALL_QUEUES, 1200);
   }
   else if(c == 'w') {  // --- OW command - watch face style
      watch_face = (u08) val;
      if(watch_face > 5) watch_face = 0;
   }
   else if(c == 'x') {  // OX command - set trend line rate display time scale
      i = (int) val;
      if(edit_buffer[1]) trend_rate_display = (i & 0x03);
      else               trend_rate_display = ((trend_rate_display & 0x01) ^ 0x01);
   }
   else if(c == 'y') {  // --- OY command - temp-dac dac scale factor
      if(edit_buffer[1]) d_scale = val;
      else if(plot[DAC].sum_yy && stat_count) {
         d_scale = sqrt(plot[TEMP].sum_yy/stat_count) / sqrt(plot[DAC].sum_yy/stat_count);
      }
      else d_scale = 0.0;
if(title_type != USER) {
   sprintf(plot_title, "DAC_scale=%f", d_scale);
   title_type = OTHER;
}
   }
   else if(c == 'z') {  // OZ command - plot cursor time ref
      if(edit_buffer[1]) cursor_time_ref = (int) val & 0x03;
      else               cursor_time_ref ^= 1;
   }
   else if(c == '!') { // O! command -
   }
   else if((c == '/') || (c == '-') || (c == '$') || (c == '=') || isdigit(c)) {
      edit_option_switch();
   }
   else {
      // bugs_black_blood:
      sprintf(out, "Unknown option parameter: %c", c);
      edit_error(out);
   }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x30cac8(%rip), %r14    # 0x33f2e0
leaq 0x1(%r14), %rbx
movq %rbx, %rdi
callq 0x9470
movsd %xmm0, -0x18(%rbp)
movsbl (%r14), %edi
callq 0x9580
movzbl %al, %edx
leal -0x61(%rdx), %ecx
cmpl $0x19, %ecx
ja 0x328b1
xorps %xmm0, %xmm0
cvtsd2ss -0x18(%rbp), %xmm0
leaq 0xd97e0(%rip), %rsi     # 0x10c02c
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
leaq 0x20c698(%rip), %rcx    # 0x23eef4
movl (%rcx), %eax
xorl $0x8, %eax
movl %eax, (%rcx)
leaq 0x1e6066(%rip), %rcx    # 0x2188d0
cmpq $0x1, (%rcx)
jne 0x32d9c
leaq 0x1e8759(%rip), %rcx    # 0x21afd4
movl (%rcx), %ecx
addl $-0x33, %ecx
cmpl $0x1d, %ecx
ja 0x32d9c
movl $0x20004009, %edx       # imm = 0x20004009
btl %ecx, %edx
jae 0x32d9c
leaq 0x20bb77(%rip), %rax    # 0x23e415
cmpb $0x0, (%rax)
jne 0x32dc6
callq 0x66646
jmp 0x32dc6
cmpl $0x21, %edx
je 0x32eb0
andl $0xfd, %eax
cmpl $0x2d, %eax
sete %al
cmpl $0x24, %edx
sete %cl
orb %al, %cl
cmpl $0x3d, %edx
sete %al
orb %cl, %al
leal -0x30(%rdx), %ecx
cmpl $0xa, %ecx
setb %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x32d77
callq 0x325d5
jmp 0x32eb0
cmpb $0x0, 0x1(%r14)
je 0x32dd0
cvtss2sd %xmm0, %xmm3
jmp 0x32efd
cmpb $0x0, 0x1(%r14)
je 0x32e2d
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1e8ab7(%rip), %rcx    # 0x21b3d6
jmp 0x32d01
cvttss2si %xmm0, %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
leaq 0x1e8a96(%rip), %rax    # 0x21b3d0
jmp 0x32e71
cmpb $0x0, 0x1(%r14)
je 0x32e36
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x20c611(%rip), %rcx    # 0x23ef68
jmp 0x32d01
cmpb $0x0, 0x1(%r14)
je 0x32e3f
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1e8a52(%rip), %rcx    # 0x21b3c6
jmp 0x32d01
cmpb $0x0, 0x1(%r14)
je 0x32e48
cvttss2si %xmm0, %eax
andl $0x3, %eax
leaq 0x1e890e(%rip), %rcx    # 0x21b2a0
jmp 0x32d4f
cmpb $0x0, 0x1(%r14)
je 0x32e51
cvttss2si %xmm0, %eax
andl $0x1, %eax
leaq 0x30d3bc(%rip), %rcx    # 0x33fd6c
jmp 0x32d4f
cmpb $0x0, 0x1(%r14)
je 0x32e5a
cvttss2si %xmm0, %eax
leaq 0x2da6c1(%rip), %rcx    # 0x30d08c
jmp 0x32d4f
cvttss2si %xmm0, %eax
xorl %ecx, %ecx
cmpb $0x6, %al
cmovbl %eax, %ecx
leaq 0x1e8a30(%rip), %rax    # 0x21b412
movb %cl, (%rax)
jmp 0x32eb0
cmpb $0x0, 0x1(%r14)
je 0x32e63
cvttss2si %xmm0, %eax
andl $0x3, %eax
leaq 0x30d36e(%rip), %rcx    # 0x33fd70
jmp 0x32d4f
leaq 0x30d386(%rip), %rax    # 0x33fd94
movb (%rax), %cl
xorb $0x1, %cl
cvttss2si %xmm0, %edx
andb $0x1, %dl
cmpb $0x0, 0x1(%r14)
movzbl %cl, %ecx
movzbl %dl, %edx
cmovel %ecx, %edx
movb %dl, (%rax)
callq 0x1084f5
leaq 0x1e89f5(%rip), %rax    # 0x21b42b
cmpb $0x0, (%rax)
sete %al
leaq 0x30d315(%rip), %rcx    # 0x33fd58
movl (%rcx), %edi
cmpl $0xe, %edi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x32eb0
leaq 0x12b2d3(%rip), %rax    # 0x15dd30
movl $0x1, 0xcc8(%rax)
callq 0x10881f
leaq 0x1e8a0a(%rip), %rax    # 0x21b47d
cmpb $0x1, (%rax)
jne 0x32ebd
callq 0x108da1
jmp 0x32eb0
cmpb $0x0, 0x1(%r14)
je 0x32e75
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x20a29e(%rip), %rcx    # 0x23cd3c
jmp 0x32d01
leaq 0x1e891e(%rip), %rax    # 0x21b3c8
movb (%rax), %cl
xorb $0x1, %cl
cvttss2si %xmm0, %edx
andb $0x1, %dl
cmpb $0x0, 0x1(%r14)
movzbl %cl, %ecx
movzbl %dl, %edx
cmovel %ecx, %edx
movb %dl, (%rax)
movl $0x24a0, %edi           # imm = 0x24A0
jmp 0x32cd5
cvttss2si %xmm0, %eax
testl %eax, %eax
movl $0x5, %ecx
cmovgl %eax, %ecx
leaq 0x20a197(%rip), %rax    # 0x23cc7c
movl %ecx, (%rax)
callq 0x10013b
movl $0x64, %edi
callq 0xd8ba5
jmp 0x32eb0
cmpb $0x0, 0x1(%r14)
je 0x32e7e
cvttss2si %xmm0, %eax
leaq 0x2da493(%rip), %rcx    # 0x30cfa4
jmp 0x32d01
leaq 0x20c407(%rip), %rax    # 0x23ef24
movl (%rax), %ecx
cvttss2si %xmm0, %edx
xorl $0x1, %ecx
andl $0x1, %edx
cmpb $0x0, 0x1(%r14)
cmovel %ecx, %edx
movl %edx, (%rax)
leaq 0x20c3de(%rip), %rax    # 0x23ef18
movl $0x8, %ecx
movl %ecx, (%rax)
leaq 0x20c3d8(%rip), %rax    # 0x23ef20
movl %ecx, (%rax)
leaq 0x20c3ef(%rip), %rax    # 0x23ef40
movl $0x1, (%rax)
testl %edx, %edx
je 0x32b6d
leaq 0x20c3c6(%rip), %rax    # 0x23ef28
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
callq 0x5e140
movl $0x65, %edi
jmp 0x32cd5
movq %rbx, %rdi
callq 0x98c6
cmpb $0x0, 0x1(%r14)
je 0x32e94
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
cvttss2si %xmm0, %eax
andl $0x17, %eax
leaq 0x20b86e(%rip), %rcx    # 0x23e410
jmp 0x32d4f
leaq 0x1e887c(%rip), %rax    # 0x21b42a
movb (%rax), %cl
xorb $0x1, %cl
cvttss2si %xmm0, %edx
andb $0x1, %dl
cmpb $0x0, 0x1(%r14)
movzbl %cl, %ecx
movzbl %dl, %edx
cmovel %ecx, %edx
movb %dl, (%rax)
leaq 0x30d187(%rip), %rax    # 0x33fd58
movb (%rax), %al
leaq 0x1e8851(%rip), %rcx    # 0x21b42b
movb %al, (%rcx)
testb %dl, %dl
je 0x32eb0
leaq 0x12b145(%rip), %rax    # 0x15dd30
cmpl $0x0, 0xcc8(%rax)
jne 0x32eb0
movl $0xe, %edi
callq 0x32f37
jmp 0x32eb0
cmpb $0x0, 0x1(%r14)
je 0x32e9d
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1e87fd(%rip), %rcx    # 0x21b41c
jmp 0x32d01
leaq 0x1e87ea(%rip), %rax    # 0x21b415
cmpb $0x0, (%rax)
sete %cl
shlb $0x2, %cl
cmpb $0x0, 0x1(%r14)
cvttss2si %xmm0, %edx
movzbl %cl, %ecx
cmovnel %edx, %ecx
movb %cl, (%rax)
leaq 0x2d9b5c(%rip), %rbx    # 0x30c7a8
cmpb $0x0, (%rbx)
je 0x32c75
movl $0xffffff9a, %edi       # imm = 0xFFFFFF9A
callq 0x27479
movb $0x0, (%rbx)
leaq 0x308bc7(%rip), %rax    # 0x33b82c
movl $0x0, (%rax)
movl $0x69, %edi
callq 0xd8ba5
leaq 0x308658(%rip), %rax    # 0x33b2d4
movzbl (%rax), %eax
leaq 0x2d9b26(%rip), %rcx    # 0x30c7ac
movl %eax, (%rcx)
leaq 0x30c651(%rip), %rdi    # 0x33f2e0
movl $0x7a, %esi
callq 0x9100
movl $0xa, %edi
testq %rax, %rax
jne 0x32cbe
leaq 0x30c636(%rip), %rdi    # 0x33f2e0
movl $0x5a, %esi
callq 0x9100
movl $0xb, %edi
testq %rax, %rax
je 0x32cc6
callq 0x27479
movb $0x53, (%rbx)
leaq 0x1e8747(%rip), %rax    # 0x21b414
movb $0x1, (%rax)
movl $0x66, %edi
callq 0xcf89
jmp 0x32eb0
callq 0x10013b
jmp 0x32eb0
cmpb $0x0, 0x1(%r14)
je 0x32ea6
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1e8717(%rip), %rcx    # 0x21b418
movb %al, (%rcx)
jmp 0x32eb0
xorl %eax, %eax
cmpb $0x0, 0x1(%r14)
cvttss2si %xmm0, %ecx
cmovel %eax, %ecx
cmpl $0x6, %ecx
movl $0x1, %eax
cmovbl %ecx, %eax
leaq 0x2dab74(%rip), %rcx    # 0x30d89c
movl %eax, (%rcx)
leaq 0x2da7ef(%rip), %rcx    # 0x30d520
movl (%rcx), %edi
leaq 0x137af6(%rip), %rcx    # 0x16a830
movq (%rcx,%rax,8), %rsi
callq 0xe1326
callq 0xe1630
leaq 0x2dab51(%rip), %rcx    # 0x30d8a0
movl %eax, (%rcx)
jmp 0x32eb0
cvttss2si %xmm0, %eax
leaq 0x1f077f(%rip), %rcx    # 0x2234e0
movb %al, (%rcx)
movl $0x7, %edi
movl $0x4b0, %esi            # imm = 0x4B0
callq 0x10bd1
jmp 0x32eb0
leaq 0x3094a2(%rip), %rbx    # 0x33c220
leaq 0xe2504(%rip), %rsi     # 0x115289
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
callq 0x23027
jmp 0x32eb0
leaq 0x1e5b61(%rip), %rcx    # 0x218904
xorl %edx, %edx
cmpb $0x1, (%rcx)
sete %dl
orl %edx, %eax
orb $0x2, %al
movzbl %al, %ecx
movl $0x32, %edi
movl $0x2, %esi
movl $0x3, %edx
callq 0x687e1
callq 0x687a7
jmp 0x32eb0
leaq 0x12af59(%rip), %rbx    # 0x15dd30
movsd 0x248(%rbx), %xmm0
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jne 0x32def
jnp 0x32efd
leaq 0x2da19a(%rip), %r14    # 0x30cf90
movsd (%r14), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x32e0b
jnp 0x32efd
movsd 0x330(%rbx), %xmm0
divsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0x32ec4
xorps %xmm3, %xmm3
sqrtsd %xmm0, %xmm3
jmp 0x32ecd
leaq 0x1e85a2(%rip), %rax    # 0x21b3d6
jmp 0x32ead
leaq 0x20c12b(%rip), %rax    # 0x23ef68
jmp 0x32ead
leaq 0x1e8580(%rip), %rax    # 0x21b3c6
jmp 0x32ead
leaq 0x1e8451(%rip), %rax    # 0x21b2a0
jmp 0x32ead
leaq 0x30cf14(%rip), %rax    # 0x33fd6c
jmp 0x32ead
leaq 0x2da22b(%rip), %rax    # 0x30d08c
jmp 0x32ead
leaq 0x30cf06(%rip), %rax    # 0x33fd70
movl (%rax), %ecx
notl %ecx
andl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x32eb0
leaq 0x209ec0(%rip), %rax    # 0x23cd3c
jmp 0x32e8f
leaq 0x2da11f(%rip), %rax    # 0x30cfa4
cmpb $0x0, (%rax)
je 0x32e8f
movb $0x0, (%rax)
jmp 0x32eb0
movb $0x1, (%rax)
jmp 0x32eb0
leaq 0x20b575(%rip), %rax    # 0x23e410
jmp 0x32ead
leaq 0x1e8578(%rip), %rax    # 0x21b41c
jmp 0x32ead
leaq 0x1e856b(%rip), %rax    # 0x21b418
xorb $0x1, (%rax)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xfa97
callq 0x108649
jmp 0x32eb0
callq 0x9270
movapd %xmm0, %xmm3
movsd 0x248(%rbx), %xmm0
divsd (%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x32eea
sqrtsd %xmm0, %xmm0
jmp 0x32ef9
movsd %xmm3, -0x18(%rbp)
callq 0x9270
movsd -0x18(%rbp), %xmm3
divsd %xmm0, %xmm3
leaq 0x30c80c(%rip), %rax    # 0x33f710
movsd %xmm3, (%rax)
leaq 0x30c3bd(%rip), %rbx    # 0x33f2cc
cmpl $0x2, (%rbx)
je 0x32eb0
leaq 0x30b935(%rip), %rdi    # 0x33e850
leaq 0xe235a(%rip), %rsi     # 0x11527c
movaps %xmm3, %xmm0
movb $0x1, %al
callq 0x9060
movl $0x3, (%rbx)
jmp 0x32eb0