// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: set_fft_scale()
void set_fft_scale()
{
   // configure FFT/histogram plot

   if(fft_type == HIST_TYPE) {     // doing histogram instead of FFT
      plot[FFT].plot_id = "HIST";
      if(fft_db) plot[FFT].units = "dB";
      else       plot[FFT].units = "cnt";

      plot[FFT].user_scale = 0;
      plot[FFT].scale_factor = 1.0F;
      plot[FFT].plot_center = 0.0F;
      plot[FFT].float_center = 1;

      fft_scale = 1;
   }
   else if(fft_db) {
      plot[FFT].plot_id = "FFT";          // assume we are doing an FFT
      plot[FFT].units = "dB";

      plot[FFT].user_scale = 0;
      plot[FFT].scale_factor = 1.0F;
      plot[FFT].plot_center = 0.0F;
      plot[FFT].float_center = 1;
   }
   else {
      plot[FFT].plot_id = "FFT";          // assume we are doing an FFT
      plot[FFT].units = "x ";

      plot[FFT].user_scale = 1;
      plot[FFT].scale_factor = 1.0F / ((float) PLOT_HEIGHT/(float)(VERT_MAJOR*2));
      plot[FFT].plot_center = 0.0F;
      plot[FFT].float_center = 0;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x10d0f2(%rip), %rax    # 0x27a65d
movzbl (%rax), %eax
cmpl $0x1, %eax
jne 0x16d622
leaq 0x4f7a2(%rip), %rax     # 0x1bcd20
leaq 0x2b772(%rip), %rcx     # 0x198cf7
movq %rcx, 0xcb0(%rax)
leaq 0x2319e1(%rip), %rax    # 0x39ef74
cmpb $0x0, (%rax)
je 0x16d5af
leaq 0x4f781(%rip), %rax     # 0x1bcd20
leaq 0x12f29(%rip), %rcx     # 0x1804cf
movq %rcx, 0xcb8(%rax)
jmp 0x16d5c4
leaq 0x4f76a(%rip), %rax     # 0x1bcd20
leaq 0x2b73f(%rip), %rcx     # 0x198cfc
movq %rcx, 0xcb8(%rax)
leaq 0x4f755(%rip), %rax     # 0x1bcd20
movl $0x0, 0xce0(%rax)
leaq 0x4f744(%rip), %rax     # 0x1bcd20
movsd 0x1a84(%rip), %xmm0     # 0x16f068
movsd %xmm0, 0xce8(%rax)
leaq 0x4f72d(%rip), %rax     # 0x1bcd20
xorps %xmm0, %xmm0
movsd %xmm0, 0xcd8(%rax)
leaq 0x4f71b(%rip), %rax     # 0x1bcd20
movl $0x1, 0xccc(%rax)
leaq 0x231952(%rip), %rax    # 0x39ef68
movq $0x1, (%rax)
jmp 0x16d745
leaq 0x23194b(%rip), %rax    # 0x39ef74
cmpb $0x0, (%rax)
je 0x16d6a8
leaq 0x4f6eb(%rip), %rax     # 0x1bcd20
leaq 0x1d3a(%rip), %rcx      # 0x16f376
movq %rcx, 0xcb0(%rax)
leaq 0x4f6d6(%rip), %rax     # 0x1bcd20
leaq 0x12e7e(%rip), %rcx     # 0x1804cf
movq %rcx, 0xcb8(%rax)
leaq 0x4f6c1(%rip), %rax     # 0x1bcd20
movl $0x0, 0xce0(%rax)
leaq 0x4f6b0(%rip), %rax     # 0x1bcd20
movsd 0x19f0(%rip), %xmm0     # 0x16f068
movsd %xmm0, 0xce8(%rax)
leaq 0x4f699(%rip), %rax     # 0x1bcd20
xorps %xmm0, %xmm0
movsd %xmm0, 0xcd8(%rax)
leaq 0x4f687(%rip), %rax     # 0x1bcd20
movl $0x1, 0xccc(%rax)
jmp 0x16d743
leaq 0x4f671(%rip), %rax     # 0x1bcd20
leaq 0x1cc0(%rip), %rcx      # 0x16f376
movq %rcx, 0xcb0(%rax)
leaq 0x4f65c(%rip), %rax     # 0x1bcd20
leaq 0x1866d(%rip), %rcx     # 0x185d38
movq %rcx, 0xcb8(%rax)
leaq 0x4f647(%rip), %rax     # 0x1bcd20
movl $0x1, 0xce0(%rax)
leaq 0x10a37e(%rip), %rax    # 0x277a68
cvtsi2ssl (%rax), %xmm1
leaq 0x10a357(%rip), %rax    # 0x277a4c
movl (%rax), %eax
shll %eax
cvtsi2ss %eax, %xmm0
divss %xmm0, %xmm1
movss 0x4233(%rip), %xmm0     # 0x17193c
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x4f608(%rip), %rax     # 0x1bcd20
movsd %xmm0, 0xce8(%rax)
leaq 0x4f5f9(%rip), %rax     # 0x1bcd20
xorps %xmm0, %xmm0
movsd %xmm0, 0xcd8(%rax)
leaq 0x4f5e7(%rip), %rax     # 0x1bcd20
movl $0x0, 0xccc(%rax)
jmp 0x16d745
popq %rbp
retq
nopw (%rax,%rax)