// File: jkingan[P]ladyheather/heathui.cpp
// Function: edit_plot(int, int)
void edit_plot(int id, int c)
{
char *s;
char *a;
char *pid;

   // process the plot control commands

   last_selected_plot = selected_plot;
   if(id != FFT) pre_fft_plot = id;

   selected_plot = id;
   #ifdef FFT_STUFF
      if(selected_plot != FFT) live_fft = selected_plot;
   #endif
   getting_plot = c;
   first_key = '{';
   prot_menu = 0;
   set_steps();

   if(text_mode) erase_screen();
   else          erase_help();

   // display prompt string for the command
   if(plot[selected_plot].show_plot) s = "hide";
   else                              s = "show";
   if(auto_scale) a = "disable";
   else           a = "enable";

   pid = plot[selected_plot].plot_id;
   sprintf(out, " %4s plot: A)utoscale %s all plots      X) toggle %s autoscale modes", pid, a, pid);
   vidstr(EDIT_ROW+0, EDIT_COL, PROMPT_COLOR, out);

   #ifdef FFT_STUFF
      if(selected_plot == FFT) sprintf(out, "            C)olor   I)nvert  S)cale factor   Z)ero ref     /)statistics");
      else if(luxor)           sprintf(out, "            C)olor   I)nvert  S)cale factor   Z)ero ref     /)statistics   &C)al");
      else                     sprintf(out, "            C)olor   I)nvert  S)cale factor   Z)ero ref     /)statistics   F)FT   H)ist");
   #else
      if(luxor) sprintf(out,                "            C)olor   I)nvert  S)cale factor   Z)ero ref     &)Cal   /)statistics");
      else      sprintf(out,                "            C)olor   I)nvert  S)cale factor   Z)ero ref     /)statistics");
   #endif
   vidstr(EDIT_ROW+1, EDIT_COL, PROMPT_COLOR, out);

   if(tie_plot(selected_plot)) {
      if(rcvr_type == PRS_RCVR) {
         sprintf(out,                       "            trend L)ine       =)remove trend  *)derivative  #) FC as freq   ~)deglitch");
      }
      else {
         sprintf(out,                       "            trend L)ine       =)remove trend  *)derivative  #) TIE as freq  ~)deglitch");
      }
   }
   else {
      sprintf(out,                          "            trend L)ine       =)remove trend  *)derivative  ~)deglitch");
   }
   vidstr(EDIT_ROW+2, EDIT_COL, PROMPT_COLOR, out);

   sprintf(out,                             "            %c or <cr>=%s", c, s);
   vidstr(EDIT_ROW+3, EDIT_COL, PROMPT_COLOR, out);

   refresh_page();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
leaq 0x34dd33(%rip), %rax    # 0x39ef38
movl (%rax), %ecx
leaq 0x34dd2e(%rip), %rax    # 0x39ef3c
movl %ecx, (%rax)
cmpl $0xe, -0x4(%rbp)
je 0x51222
movl -0x4(%rbp), %ecx
leaq 0x34dd24(%rip), %rax    # 0x39ef44
movl %ecx, (%rax)
movl -0x4(%rbp), %ecx
leaq 0x34dd0c(%rip), %rax    # 0x39ef38
movl %ecx, (%rax)
leaq 0x34dd03(%rip), %rax    # 0x39ef38
cmpl $0xe, (%rax)
je 0x5124e
leaq 0x34dcf7(%rip), %rax    # 0x39ef38
movl (%rax), %eax
movb %al, %cl
leaq 0x2293bf(%rip), %rax    # 0x27a60b
movb %cl, (%rax)
movl -0x8(%rbp), %eax
movl %eax, 0x3508c5(%rip)    # 0x3a1b1c
leaq 0x24ceda(%rip), %rax    # 0x29e138
movl $0x7b, (%rax)
leaq 0x2290cd(%rip), %rax    # 0x27a338
movb $0x0, (%rax)
callq 0x504a0
leaq 0x22673e(%rip), %rax    # 0x2779b8
cmpl $0x0, (%rax)
je 0x51286
callq 0x117e0
jmp 0x5128b
callq 0x117a0
leaq 0x34dca6(%rip), %rax    # 0x39ef38
movslq (%rax), %rcx
leaq 0x16ba84(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x18(%rax)
je 0x512b9
leaq 0x12a489(%rip), %rax    # 0x17b73c
movq %rax, -0x10(%rbp)
jmp 0x512c4
leaq 0x12a106(%rip), %rax    # 0x17b3c6
movq %rax, -0x10(%rbp)
leaq 0x2292e9(%rip), %rax    # 0x27a5b4
cmpb $0x0, (%rax)
je 0x512dd
leaq 0x12ce02(%rip), %rax    # 0x17e0d9
movq %rax, -0x18(%rbp)
jmp 0x512e8
leaq 0x126128(%rip), %rax    # 0x17740c
movq %rax, -0x18(%rbp)
leaq 0x34dc49(%rip), %rax    # 0x39ef38
movslq (%rax), %rcx
leaq 0x16ba27(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
leaq 0x34a0e3(%rip), %rdi    # 0x39b400
leaq 0x12a0a7(%rip), %rsi    # 0x17b3cb
movb $0x0, %al
callq 0x9060
leaq 0x34d4ba(%rip), %rax    # 0x39e7ec
movl (%rax), %edi
addl $0x0, %edi
leaq 0x34d4b2(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
movl $0xb, %edx
leaq 0x34a0b4(%rip), %rcx    # 0x39b400
callq 0x10ee0
leaq 0x34dbe0(%rip), %rax    # 0x39ef38
cmpl $0xe, (%rax)
jne 0x51374
leaq 0x34a09c(%rip), %rdi    # 0x39b400
leaq 0x12a0a5(%rip), %rsi    # 0x17b410
movb $0x0, %al
callq 0x9060
jmp 0x513ae
leaq 0x24cda3(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x51397
leaq 0x34a079(%rip), %rdi    # 0x39b400
leaq 0x12a0cb(%rip), %rsi    # 0x17b459
movb $0x0, %al
callq 0x9060
jmp 0x513ac
leaq 0x34a062(%rip), %rdi    # 0x39b400
leaq 0x12a105(%rip), %rsi    # 0x17b4aa
movb $0x0, %al
callq 0x9060
jmp 0x513ae
leaq 0x34d437(%rip), %rax    # 0x39e7ec
movl (%rax), %edi
addl $0x1, %edi
leaq 0x34d42f(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
movl $0xb, %edx
leaq 0x34a031(%rip), %rcx    # 0x39b400
callq 0x10ee0
leaq 0x34db5d(%rip), %rax    # 0x39ef38
movl (%rax), %edi
callq 0x19760
cmpl $0x0, %eax
je 0x51425
leaq 0x2266c2(%rip), %rax    # 0x277ab0
cmpq $0x1000000, (%rax)      # imm = 0x1000000
jne 0x5140e
leaq 0x34a002(%rip), %rdi    # 0x39b400
leaq 0x12a0fd(%rip), %rsi    # 0x17b502
movb $0x0, %al
callq 0x9060
jmp 0x51423
leaq 0x349feb(%rip), %rdi    # 0x39b400
leaq 0x12a13d(%rip), %rsi    # 0x17b559
movb $0x0, %al
callq 0x9060
jmp 0x5143a
leaq 0x349fd4(%rip), %rdi    # 0x39b400
leaq 0x12a17d(%rip), %rsi    # 0x17b5b0
movb $0x0, %al
callq 0x9060
leaq 0x34d3ab(%rip), %rax    # 0x39e7ec
movl (%rax), %edi
addl $0x2, %edi
leaq 0x34d3a3(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
movl $0xb, %edx
leaq 0x349fa5(%rip), %rcx    # 0x39b400
callq 0x10ee0
movl -0x8(%rbp), %edx
movq -0x10(%rbp), %rcx
leaq 0x349f92(%rip), %rdi    # 0x39b400
leaq 0x12a182(%rip), %rsi    # 0x17b5f7
movb $0x0, %al
callq 0x9060
leaq 0x34d369(%rip), %rax    # 0x39e7ec
movl (%rax), %edi
addl $0x3, %edi
leaq 0x34d361(%rip), %rax    # 0x39e7f0
movl (%rax), %esi
movl $0xb, %edx
leaq 0x349f63(%rip), %rcx    # 0x39b400
callq 0x10ee0
callq 0xb0d0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)