// File: /workspace/github_cpp_makefile_star2_O2/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 0x2f97c6(%rip), %r14    # 0x3292e0
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 0x2fbcb
cvtsd2ss -0x18(%rbp), %xmm0
leaq 0xc6555(%rip), %rsi     # 0xf60a4
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
leaq 0x1f9395(%rip), %rcx    # 0x228ef4
movl (%rcx), %eax
xorl $0x8, %eax
movl %eax, (%rcx)
leaq 0x1d2d63(%rip), %rcx    # 0x2028d0
movq (%rcx), %rcx
leaq 0x1d545d(%rip), %rdx    # 0x204fd4
movl (%rdx), %edx
cmpq $0x1, %rcx
jne 0x2fb91
leal -0x33(%rdx), %esi
cmpl $0x1d, %esi
ja 0x2fb91
movl $0x20004009, %edi       # imm = 0x20004009
btl %esi, %edi
jb 0x2fbb1
cmpl $0x33, %edx
sete %sil
cmpl $0x50, %edx
sete %dl
cmpq $0x1, %rcx
jne 0x30186
orb %dl, %sil
je 0x30186
leaq 0x1f885d(%rip), %rax    # 0x228415
cmpb $0x0, (%rax)
jne 0x301aa
callq 0x5dffd
jmp 0x301aa
cmpl $0x21, %edx
je 0x30226
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 0x3002e
callq 0x2f8e6
jmp 0x30226
cmpb $0x0, 0x1(%r14)
je 0x30053
cvtss2sd %xmm0, %xmm3
jmp 0x301f1
cmpb $0x0, 0x1(%r14)
je 0x300ad
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1d579d(%rip), %rcx    # 0x2053d6
jmp 0x2ffbc
cvttss2si %xmm0, %eax
cmpl $0x2, %eax
pushq $0x1
popq %rcx
cmovgel %eax, %ecx
leaq 0x1d577e(%rip), %rax    # 0x2053d0
jmp 0x30103
cmpb $0x0, 0x1(%r14)
je 0x300b9
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1f92f9(%rip), %rcx    # 0x228f68
jmp 0x2ffbc
cmpb $0x0, 0x1(%r14)
je 0x300c5
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1d573a(%rip), %rcx    # 0x2053c6
jmp 0x2ffbc
cmpb $0x0, 0x1(%r14)
je 0x300d1
cvttss2si %xmm0, %eax
andl $0x3, %eax
leaq 0x1d55f6(%rip), %rcx    # 0x2052a0
jmp 0x30008
cmpb $0x0, 0x1(%r14)
je 0x300dd
cvttss2si %xmm0, %eax
andl $0x1, %eax
leaq 0x2fa0a4(%rip), %rcx    # 0x329d6c
jmp 0x30008
cmpb $0x0, 0x1(%r14)
je 0x300e9
cvttss2si %xmm0, %eax
leaq 0x2c73a9(%rip), %rcx    # 0x2f708c
jmp 0x30008
cvttss2si %xmm0, %eax
xorl %ecx, %ecx
cmpb $0x6, %al
cmovbl %eax, %ecx
leaq 0x1d5718(%rip), %rax    # 0x205412
movb %cl, (%rax)
jmp 0x30226
cmpb $0x0, 0x1(%r14)
je 0x300f5
cvttss2si %xmm0, %eax
andl $0x3, %eax
leaq 0x2fa056(%rip), %rcx    # 0x329d70
jmp 0x30008
leaq 0x2fa06e(%rip), %rax    # 0x329d94
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 0xf192c
leaq 0x1d56dd(%rip), %rax    # 0x20542b
cmpb $0x0, (%rax)
sete %al
leaq 0x2f9ffd(%rip), %rcx    # 0x329d58
movl (%rcx), %edi
cmpl $0xe, %edi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x30226
leaq 0x117fbb(%rip), %rax    # 0x147d30
movl $0x1, 0xcc8(%rax)
callq 0xf1c2d
leaq 0x1d56f2(%rip), %rax    # 0x20547d
cmpb $0x1, (%rax)
jne 0x301b1
callq 0xf2187
jmp 0x30226
cmpb $0x0, 0x1(%r14)
je 0x3010a
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1f6f86(%rip), %rcx    # 0x226d3c
jmp 0x2ffbc
leaq 0x1d5606(%rip), %rax    # 0x2053c8
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 0x3016d
cvttss2si %xmm0, %eax
testl %eax, %eax
pushq $0x5
popq %rcx
cmovgl %eax, %ecx
leaq 0x1f6e81(%rip), %rax    # 0x226c7c
movl %ecx, (%rax)
callq 0xea03a
pushq $0x64
popq %rdi
callq 0xc7144
jmp 0x30226
cmpb $0x0, 0x1(%r14)
je 0x30113
cvttss2si %xmm0, %eax
leaq 0x2c717f(%rip), %rcx    # 0x2f6fa4
jmp 0x2ffbc
leaq 0x1f90f3(%rip), %rax    # 0x228f24
movl (%rax), %ecx
cvttss2si %xmm0, %edx
xorl $0x1, %ecx
andl $0x1, %edx
cmpb $0x0, 0x1(%r14)
cmovel %ecx, %edx
movl %edx, (%rax)
leaq 0x1f90ca(%rip), %rax    # 0x228f18
pushq $0x8
popq %rcx
movl %ecx, (%rax)
leaq 0x1f90c6(%rip), %rax    # 0x228f20
movl %ecx, (%rax)
leaq 0x1f90dd(%rip), %rax    # 0x228f40
movl $0x1, (%rax)
testl %edx, %edx
je 0x2fe7f
leaq 0x1f90b4(%rip), %rax    # 0x228f28
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
callq 0x56b98
pushq $0x65
jmp 0x3016c
movq %rbx, %rdi
callq 0x98b2
cmpb $0x0, 0x1(%r14)
je 0x3012f
movl %eax, %eax
cvtsi2ss %rax, %xmm0
cvttss2si %xmm0, %eax
andl $0x17, %eax
leaq 0x1f8562(%rip), %rcx    # 0x228410
jmp 0x30008
leaq 0x1d5570(%rip), %rax    # 0x20542a
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 0x2f9e7b(%rip), %rax    # 0x329d58
movb (%rax), %al
leaq 0x1d5545(%rip), %rcx    # 0x20542b
movb %al, (%rcx)
testb %dl, %dl
je 0x30226
leaq 0x117e39(%rip), %rax    # 0x147d30
cmpl $0x0, 0xcc8(%rax)
jne 0x30226
pushq $0xe
popq %rdi
callq 0x30233
jmp 0x30226
cmpb $0x0, 0x1(%r14)
je 0x30138
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1d54f3(%rip), %rcx    # 0x20541c
jmp 0x2ffbc
leaq 0x1d54e0(%rip), %rax    # 0x205415
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 0x2c6852(%rip), %rbx    # 0x2f67a8
cmpb $0x0, (%rbx)
je 0x2ff68
pushq $-0x66
popq %rdi
callq 0x257d9
callq 0x258aa
leaq 0x2f5365(%rip), %rax    # 0x3252d4
movzbl (%rax), %eax
leaq 0x2c6833(%rip), %rcx    # 0x2f67ac
movl %eax, (%rcx)
leaq 0x2f935e(%rip), %rdi    # 0x3292e0
pushq $0x7a
popq %rsi
callq 0x9100
testq %rax, %rax
je 0x30141
pushq $0xa
jmp 0x30157
callq 0xea03a
jmp 0x30226
cmpb $0x0, 0x1(%r14)
je 0x30177
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1d545c(%rip), %rcx    # 0x205418
movb %al, (%rcx)
jmp 0x30226
xorl %eax, %eax
cmpb $0x0, 0x1(%r14)
cvttss2si %xmm0, %ecx
cmovel %eax, %ecx
cmpl $0x6, %ecx
pushq $0x1
popq %rax
cmovbl %ecx, %eax
leaq 0x2c78bb(%rip), %rcx    # 0x2f789c
movl %eax, (%rcx)
leaq 0x2c7536(%rip), %rcx    # 0x2f7520
movl (%rcx), %edi
leaq 0x12483d(%rip), %rcx    # 0x154830
movq (%rcx,%rax,8), %rsi
callq 0xce1f2
callq 0xce4ef
leaq 0x2c7898(%rip), %rcx    # 0x2f78a0
movl %eax, (%rcx)
jmp 0x30226
cvttss2si %xmm0, %eax
leaq 0x1dd4c6(%rip), %rcx    # 0x20d4e0
movb %al, (%rcx)
pushq $0x7
popq %rdi
movl $0x4b0, %esi            # imm = 0x4B0
callq 0x104b9
jmp 0x30226
leaq 0x2f61eb(%rip), %rbx    # 0x326220
leaq 0xcf2cd(%rip), %rsi     # 0xff309
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
callq 0x214df
jmp 0x30226
leaq 0x117cd6(%rip), %rbx    # 0x147d30
movsd 0x248(%rbx), %xmm0
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jne 0x30072
jnp 0x301f1
leaq 0x2c6f17(%rip), %r14    # 0x2f6f90
movsd (%r14), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x3008e
jnp 0x301f1
movsd 0x330(%rbx), %xmm0
divsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0x301b8
sqrtsd %xmm0, %xmm3
jmp 0x301c1
leaq 0x1d5322(%rip), %rax    # 0x2053d6
jmp 0x3017e
leaq 0x1f8ea8(%rip), %rax    # 0x228f68
jmp 0x3017e
leaq 0x1d52fa(%rip), %rax    # 0x2053c6
jmp 0x3017e
leaq 0x1d51c8(%rip), %rax    # 0x2052a0
jmp 0x3017e
leaq 0x2f9c88(%rip), %rax    # 0x329d6c
jmp 0x3017e
leaq 0x2c6f9c(%rip), %rax    # 0x2f708c
jmp 0x3017e
leaq 0x2f9c74(%rip), %rax    # 0x329d70
movl (%rax), %ecx
notl %ecx
andl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x30226
leaq 0x1f6c2b(%rip), %rax    # 0x226d3c
jmp 0x30127
leaq 0x2c6e8a(%rip), %rax    # 0x2f6fa4
cmpb $0x0, (%rax)
je 0x30127
movb $0x0, (%rax)
jmp 0x30226
movb $0x1, (%rax)
jmp 0x30226
leaq 0x1f82da(%rip), %rax    # 0x228410
jmp 0x3017e
leaq 0x1d52dd(%rip), %rax    # 0x20541c
jmp 0x3017e
leaq 0x2f9198(%rip), %rdi    # 0x3292e0
pushq $0x5a
popq %rsi
callq 0x9100
testq %rax, %rax
je 0x30160
pushq $0xb
popq %rdi
callq 0x257d9
movb $0x53, (%rbx)
leaq 0x1d52ad(%rip), %rax    # 0x205414
movb $0x1, (%rax)
pushq $0x66
popq %rdi
callq 0xcc4f
jmp 0x30226
leaq 0x1d529a(%rip), %rax    # 0x205418
xorb $0x1, (%rax)
jmp 0x30226
leaq 0x1d2777(%rip), %rcx    # 0x202904
xorl %edx, %edx
cmpb $0x1, (%rcx)
sete %dl
orl %edx, %eax
orb $0x2, %al
movzbl %al, %ecx
pushq $0x32
popq %rdi
pushq $0x2
popq %rsi
pushq $0x3
popq %rdx
callq 0x5fc56
callq 0x5fc1e
jmp 0x30226
callq 0xf1a6b
jmp 0x30226
callq 0x9260
movapd %xmm0, %xmm3
movsd 0x248(%rbx), %xmm0
divsd (%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x301de
sqrtsd %xmm0, %xmm0
jmp 0x301ed
movsd %xmm3, -0x18(%rbp)
callq 0x9260
movsd -0x18(%rbp), %xmm3
divsd %xmm0, %xmm3
leaq 0x2f9518(%rip), %rax    # 0x329710
movsd %xmm3, (%rax)
leaq 0x2f90c9(%rip), %rbx    # 0x3292cc
cmpl $0x2, (%rbx)
je 0x30226
leaq 0x2f8641(%rip), %rdi    # 0x328850
leaq 0xcf0e6(%rip), %rsi     # 0xff2fc
movaps %xmm3, %xmm0
movb $0x1, %al
callq 0x9060
movl $0x3, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xf426