// File: jkingan[P]ladyheather/heathui.cpp
// Function: toggle_plot(int)
void toggle_plot(int id)
{
   if((id < 0) || (id >= (NUM_PLOTS+DERIVED_PLOTS))) return;
   if(id != FFT) pre_fft_plot = id;

   selected_plot = id;
   plot[selected_plot].show_plot = toggle_value(plot[selected_plot].show_plot);
   plot[selected_plot].user_set_show = 1;

if((selected_plot == FFT) && (plot[selected_plot].show_plot == 0)) { // just turned off FFT plot
   selected_plot = pre_fft_plot;
}

   if(USES_PLOT_THREE) ;
   else if((graph_lla == 0) && (selected_plot == THREE) && (luxor == 0)) {  //!!!! debug_plots
      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;
}
   }

   config_extra_plots();
   if(luxor && (id == AUXV)) need_redraw = 1301;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0x47c07
cmpl $0x14, -0x4(%rbp)
jl 0x47c0c
jmp 0x47e29
cmpl $0xe, -0x4(%rbp)
je 0x47c1e
movl -0x4(%rbp), %ecx
leaq 0x357328(%rip), %rax    # 0x39ef44
movl %ecx, (%rax)
movl -0x4(%rbp), %ecx
leaq 0x357310(%rip), %rax    # 0x39ef38
movl %ecx, (%rax)
leaq 0x357307(%rip), %rax    # 0x39ef38
movslq (%rax), %rcx
leaq 0x1750e5(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movzbl %al, %edi
callq 0x49220
movzbl %al, %ecx
leaq 0x3572de(%rip), %rax    # 0x39ef38
movslq (%rax), %rdx
leaq 0x1750bc(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
leaq 0x3572c0(%rip), %rax    # 0x39ef38
movslq (%rax), %rcx
leaq 0x17509e(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0xe0(%rax)
leaq 0x35729b(%rip), %rax    # 0x39ef38
cmpl $0xe, (%rax)
jne 0x47cd5
leaq 0x35728f(%rip), %rax    # 0x39ef38
movslq (%rax), %rcx
leaq 0x17506d(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x18(%rax)
jne 0x47cd5
leaq 0x35727a(%rip), %rax    # 0x39ef44
movl (%rax), %ecx
leaq 0x357265(%rip), %rax    # 0x39ef38
movl %ecx, (%rax)
leaq 0x22fdd4(%rip), %rcx    # 0x277ab0
movabsq $0x101b1b0000, %rax     # imm = 0x101B1B0000
andq (%rcx), %rax
cmpq $0x0, %rax
je 0x47cf4
jmp 0x47e05
leaq 0x3527a9(%rip), %rax    # 0x39a4a4
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x47e03
leaq 0x35722a(%rip), %rax    # 0x39ef38
cmpl $0x6, (%rax)
jne 0x47e03
leaq 0x256400(%rip), %rax    # 0x29e11e
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x47e03
leaq 0x174fef(%rip), %rax    # 0x1bcd20
movsd 0x248(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x47d46
jp 0x47d46
jmp 0x47dba
leaq 0x324423(%rip), %rax    # 0x36c170
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x47d5e
jp 0x47d5e
jmp 0x47dba
leaq 0x174fbb(%rip), %rax    # 0x1bcd20
movsd 0x330(%rax), %xmm0
leaq 0x3243fc(%rip), %rax    # 0x36c170
divsd (%rax), %xmm0
callq 0x9280
movsd %xmm0, -0x10(%rbp)
leaq 0x174f97(%rip), %rax    # 0x1bcd20
movsd 0x248(%rax), %xmm0
leaq 0x3243d8(%rip), %rax    # 0x36c170
divsd (%rax), %xmm0
callq 0x9280
movaps %xmm0, %xmm1
movsd -0x10(%rbp), %xmm0
divsd %xmm1, %xmm0
leaq 0x356b3c(%rip), %rax    # 0x39e8f0
movsd %xmm0, (%rax)
jmp 0x47dc8
leaq 0x356b2f(%rip), %rax    # 0x39e8f0
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x3566dd(%rip), %rax    # 0x39e4ac
cmpl $0x2, (%rax)
je 0x47e01
leaq 0x356b15(%rip), %rax    # 0x39e8f0
movsd (%rax), %xmm0
leaq 0x355c4a(%rip), %rdi    # 0x39da30
leaq 0x131e2b(%rip), %rsi    # 0x179c18
movb $0x1, %al
callq 0x9060
leaq 0x3566b1(%rip), %rax    # 0x39e4ac
movl $0x3, (%rax)
jmp 0x47e03
jmp 0x47e05
callq 0x19b40
leaq 0x25630d(%rip), %rax    # 0x29e11e
cmpb $0x0, (%rax)
je 0x47e29
cmpl $0xd, -0x4(%rbp)
jne 0x47e29
leaq 0x22fc01(%rip), %rax    # 0x277a24
movl $0x515, (%rax)          # imm = 0x515
addq $0x10, %rsp
popq %rbp
retq
nop