// File: /workspace/github_cpp_makefile_star2_O1/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 0x30cc0d(%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 0x32790
xorps %xmm0, %xmm0
cvtsd2ss -0x18(%rbp), %xmm0
leaq 0xd9919(%rip), %rsi     # 0x10c024
movslq (%rsi,%rcx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
leaq 0x20c7d9(%rip), %rcx    # 0x23eef4
movl (%rcx), %eax
xorl $0x8, %eax
movl %eax, (%rcx)
leaq 0x1e61a7(%rip), %rcx    # 0x2188d0
movq (%rcx), %rcx
cmpq $0x1, %rcx
jne 0x3274d
leaq 0x1e889b(%rip), %rdx    # 0x21afd4
movl (%rdx), %edx
addl $-0x33, %edx
cmpl $0x1d, %edx
ja 0x3274d
movl $0x20004009, %esi       # imm = 0x20004009
btl %edx, %esi
jb 0x32776
leaq 0x1e8880(%rip), %rdx    # 0x21afd4
movl (%rdx), %esi
cmpl $0x33, %esi
sete %dl
cmpl $0x50, %esi
sete %sil
cmpq $0x1, %rcx
jne 0x32d6c
orb %sil, %dl
je 0x32d6c
leaq 0x20bc98(%rip), %rax    # 0x23e415
cmpb $0x0, (%rax)
jne 0x32d96
callq 0x66423
jmp 0x32d96
cmpl $0x21, %edx
je 0x32e13
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 0x32c56
callq 0x32427
jmp 0x32e13
cmpb $0x0, 0x1(%r14)
je 0x32c7b
cvtss2sd %xmm0, %xmm3
jmp 0x32ddd
cmpb $0x0, 0x1(%r14)
je 0x32cd8
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1e8bd8(%rip), %rcx    # 0x21b3d6
jmp 0x32be0
cvttss2si %xmm0, %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
leaq 0x1e8bb7(%rip), %rax    # 0x21b3d0
jmp 0x32d1f
cmpb $0x0, 0x1(%r14)
je 0x32ce4
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x20c732(%rip), %rcx    # 0x23ef68
jmp 0x32be0
cmpb $0x0, 0x1(%r14)
je 0x32ced
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1e8b73(%rip), %rcx    # 0x21b3c6
jmp 0x32be0
cmpb $0x0, 0x1(%r14)
je 0x32cf6
cvttss2si %xmm0, %eax
andl $0x3, %eax
leaq 0x1e8a2f(%rip), %rcx    # 0x21b2a0
jmp 0x32c2e
cmpb $0x0, 0x1(%r14)
je 0x32cff
cvttss2si %xmm0, %eax
andl $0x1, %eax
leaq 0x30d4dd(%rip), %rcx    # 0x33fd6c
jmp 0x32c2e
cmpb $0x0, 0x1(%r14)
je 0x32d08
cvttss2si %xmm0, %eax
leaq 0x2da7e2(%rip), %rcx    # 0x30d08c
jmp 0x32c2e
cvttss2si %xmm0, %eax
xorl %ecx, %ecx
cmpb $0x6, %al
cmovbl %eax, %ecx
leaq 0x1e8b51(%rip), %rax    # 0x21b412
movb %cl, (%rax)
jmp 0x32e13
cmpb $0x0, 0x1(%r14)
je 0x32d11
cvttss2si %xmm0, %eax
andl $0x3, %eax
leaq 0x30d48f(%rip), %rcx    # 0x33fd70
jmp 0x32c2e
leaq 0x30d4a7(%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 0x107dd8
leaq 0x1e8b16(%rip), %rax    # 0x21b42b
cmpb $0x0, (%rax)
sete %al
leaq 0x30d436(%rip), %rcx    # 0x33fd58
movl (%rcx), %edi
cmpl $0xe, %edi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x32e13
leaq 0x12b3f4(%rip), %rax    # 0x15dd30
movl $0x1, 0xcc8(%rax)
callq 0x108102
leaq 0x1e8b2b(%rip), %rax    # 0x21b47d
cmpb $0x1, (%rax)
jne 0x32d9d
callq 0x10867f
jmp 0x32e13
cmpb $0x0, 0x1(%r14)
je 0x32d26
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x20a3bf(%rip), %rcx    # 0x23cd3c
jmp 0x32be0
leaq 0x1e8a3f(%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 0x32bb4
cvttss2si %xmm0, %eax
testl %eax, %eax
movl $0x5, %ecx
cmovgl %eax, %ecx
leaq 0x20a2b8(%rip), %rax    # 0x23cc7c
movl %ecx, (%rax)
callq 0xffa90
movl $0x64, %edi
callq 0xd846f
jmp 0x32e13
cmpb $0x0, 0x1(%r14)
je 0x32d2f
cvttss2si %xmm0, %eax
leaq 0x2da5b4(%rip), %rcx    # 0x30cfa4
jmp 0x32be0
leaq 0x20c528(%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 0x20c4ff(%rip), %rax    # 0x23ef18
movl $0x8, %ecx
movl %ecx, (%rax)
leaq 0x20c4f9(%rip), %rax    # 0x23ef20
movl %ecx, (%rax)
leaq 0x20c510(%rip), %rax    # 0x23ef40
movl $0x1, (%rax)
testl %edx, %edx
je 0x32a4c
leaq 0x20c4e7(%rip), %rax    # 0x23ef28
movl $0xfffffffe, (%rax)     # imm = 0xFFFFFFFE
callq 0x5e1a6
movl $0x65, %edi
jmp 0x32bb4
movq %rbx, %rdi
callq 0x98c6
cmpb $0x0, 0x1(%r14)
je 0x32d4b
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
cvttss2si %xmm0, %eax
andl $0x17, %eax
leaq 0x20b98f(%rip), %rcx    # 0x23e410
jmp 0x32c2e
leaq 0x1e899d(%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 0x30d2a8(%rip), %rax    # 0x33fd58
movb (%rax), %al
leaq 0x1e8972(%rip), %rcx    # 0x21b42b
movb %al, (%rcx)
testb %dl, %dl
je 0x32e13
leaq 0x12b266(%rip), %rax    # 0x15dd30
cmpl $0x0, 0xcc8(%rax)
jne 0x32e13
movl $0xe, %edi
callq 0x32e20
jmp 0x32e13
cmpb $0x0, 0x1(%r14)
je 0x32d54
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1e891e(%rip), %rcx    # 0x21b41c
jmp 0x32be0
leaq 0x1e890b(%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 0x2d9c7d(%rip), %rbx    # 0x30c7a8
cmpb $0x0, (%rbx)
je 0x32b54
movl $0xffffff9a, %edi       # imm = 0xFFFFFF9A
callq 0x27724
movb $0x0, (%rbx)
leaq 0x308ce8(%rip), %rax    # 0x33b82c
movl $0x0, (%rax)
movl $0x69, %edi
callq 0xd846f
leaq 0x308779(%rip), %rax    # 0x33b2d4
movzbl (%rax), %eax
leaq 0x2d9c47(%rip), %rcx    # 0x30c7ac
movl %eax, (%rcx)
leaq 0x30c772(%rip), %rdi    # 0x33f2e0
movl $0x7a, %esi
callq 0x9100
movl $0xa, %edi
testq %rax, %rax
jne 0x32b9d
leaq 0x30c757(%rip), %rdi    # 0x33f2e0
movl $0x5a, %esi
callq 0x9100
movl $0xb, %edi
testq %rax, %rax
je 0x32ba5
callq 0x27724
movb $0x53, (%rbx)
leaq 0x1e8868(%rip), %rax    # 0x21b414
movb $0x1, (%rax)
movl $0x66, %edi
callq 0xcf81
jmp 0x32e13
callq 0xffa90
jmp 0x32e13
cmpb $0x0, 0x1(%r14)
je 0x32d5d
cvttss2si %xmm0, %eax
andb $0x1, %al
leaq 0x1e8838(%rip), %rcx    # 0x21b418
movb %al, (%rcx)
jmp 0x32e13
xorl %eax, %eax
cmpb $0x0, 0x1(%r14)
cvttss2si %xmm0, %ecx
cmovel %eax, %ecx
cmpl $0x6, %ecx
movl $0x1, %eax
cmovbl %ecx, %eax
leaq 0x2dac95(%rip), %rcx    # 0x30d89c
movl %eax, (%rcx)
leaq 0x2da910(%rip), %rcx    # 0x30d520
movl (%rcx), %edi
leaq 0x137c17(%rip), %rcx    # 0x16a830
movq (%rcx,%rax,8), %rsi
callq 0xe0868
callq 0xe0af6
leaq 0x2dac72(%rip), %rcx    # 0x30d8a0
movl %eax, (%rcx)
jmp 0x32e13
cvttss2si %xmm0, %eax
leaq 0x1f08a0(%rip), %rcx    # 0x2234e0
movb %al, (%rcx)
movl $0x7, %edi
movl $0x4b0, %esi            # imm = 0x4B0
callq 0x10c56
jmp 0x32e13
leaq 0x3095c3(%rip), %rbx    # 0x33c220
leaq 0xe2591(%rip), %rsi     # 0x1151f5
movq %rbx, %rdi
xorl %eax, %eax
callq 0x9060
movq %rbx, %rdi
callq 0x2326e
jmp 0x32e13
leaq 0x12b0ae(%rip), %rbx    # 0x15dd30
movsd 0x248(%rbx), %xmm0
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jne 0x32c9a
jnp 0x32ddd
leaq 0x2da2ef(%rip), %r14    # 0x30cf90
movsd (%r14), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x32cb6
jnp 0x32ddd
movsd 0x330(%rbx), %xmm0
divsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jb 0x32da4
xorps %xmm3, %xmm3
sqrtsd %xmm0, %xmm3
jmp 0x32dad
leaq 0x1e86f7(%rip), %rax    # 0x21b3d6
jmp 0x32d64
leaq 0x20c27d(%rip), %rax    # 0x23ef68
jmp 0x32d64
leaq 0x1e86d2(%rip), %rax    # 0x21b3c6
jmp 0x32d64
leaq 0x1e85a3(%rip), %rax    # 0x21b2a0
jmp 0x32d64
leaq 0x30d066(%rip), %rax    # 0x33fd6c
jmp 0x32d64
leaq 0x2da37d(%rip), %rax    # 0x30d08c
jmp 0x32d64
leaq 0x30d058(%rip), %rax    # 0x33fd70
movl (%rax), %ecx
notl %ecx
andl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x32e13
leaq 0x20a00f(%rip), %rax    # 0x23cd3c
jmp 0x32d43
leaq 0x2da26e(%rip), %rax    # 0x30cfa4
cmpb $0x0, (%rax)
je 0x32d43
movb $0x0, (%rax)
jmp 0x32e13
movb $0x1, (%rax)
jmp 0x32e13
leaq 0x20b6be(%rip), %rax    # 0x23e410
jmp 0x32d64
leaq 0x1e86c1(%rip), %rax    # 0x21b41c
jmp 0x32d64
leaq 0x1e86b4(%rip), %rax    # 0x21b418
xorb $0x1, (%rax)
jmp 0x32e13
leaq 0x1e5b91(%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 0x68554
callq 0x6851a
jmp 0x32e13
callq 0x107f2c
jmp 0x32e13
callq 0x9270
movapd %xmm0, %xmm3
movsd 0x248(%rbx), %xmm0
divsd (%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x32dca
sqrtsd %xmm0, %xmm0
jmp 0x32dd9
movsd %xmm3, -0x18(%rbp)
callq 0x9270
movsd -0x18(%rbp), %xmm3
divsd %xmm0, %xmm3
leaq 0x30c92c(%rip), %rax    # 0x33f710
movsd %xmm3, (%rax)
leaq 0x30c4dd(%rip), %rbx    # 0x33f2cc
cmpl $0x2, (%rbx)
je 0x32e13
movsd (%rax), %xmm0
leaq 0x30ba51(%rip), %rdi    # 0x33e850
leaq 0xe23e2(%rip), %rsi     # 0x1151e8
movb $0x1, %al
callq 0x9060
movl $0x3, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0xfb1a