// File: jkingan[P]ladyheather/heathui.cpp
// Function: show_trend_info(int)
void show_trend_info(int plot_id)
{
double val;
char *s;

   if(plot[plot_id].show_trend && (title_type != USER)) {
      if(plot[plot_id].stat_count && view_interval) {
         val = (plot[plot_id].sum_change/plot[plot_id].stat_count)/view_interval;
      }
      else val = 0.0;
      if(plot_id == OSC) {  // scale to microseconds
         if(rcvr_type == SCPI_RCVR) val *= 1000.0;
         else if(rcvr_type == UCCM_RCVR) val *= 1000.0;
      }

      sprintf(plot_title, "%s trend line: %s = (%g*t) + %g   avg_delta=%g",
                          plot[plot_id].plot_id,
                          plot[plot_id].plot_id,
                          plot[plot_id].a1,
                          plot[plot_id].a0,
                          val
      );

      if(trend_rate_display == 3) {  // per second trend
         val = plot[plot_id].a1 * (1.0);
         s = "sec";
      }
      else if(trend_rate_display == 2) {  // per minute trend
         val = plot[plot_id].a1 * (60.0);
         s = "min";
      }
      else if(trend_rate_display == 1) {
         val = plot[plot_id].a1 * (60.0*60.0);  // per hour trend
         s = "hr";
      }
      else { // per day trend
         val = plot[plot_id].a1 * (24.0*60.0*60.0);
         s = "day";
      }

      if(plot_id == OSC) {  // scale to microseconds
         if(rcvr_type == SCPI_RCVR) val *= 1000.0;
         else if(rcvr_type == UCCM_RCVR) val *= 1000.0;
      }

      if(tie_plot(plot_id)) {
         if(plot[plot_id].show_freq) {
            if(rcvr_type == X72_RCVR) {
               sprintf(out, "  (%g mHz/%s)", tie_to_freq(plot_id, val)*1.0E3, s);
            }
            else {
               sprintf(out, "  (%g Hz/%s)", tie_to_freq(plot_id, val), s);
            }
         }
         else {
            sprintf(out, "  (%g ns/%s)", val, s);
         }
      }
      else {
         sprintf(out, "  (%g %s/%s)", val, plot[plot_id].units, s);
      }
      strcat(plot_title, out);

      title_type = OTHER;
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x16b5da(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0xc8(%rax)
je 0x51b2c
leaq 0x34cd48(%rip), %rax    # 0x39e4ac
cmpl $0x2, (%rax)
je 0x51b2c
movslq -0x4(%rbp), %rcx
leaq 0x16b5a8(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movsd 0x88(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x51797
jp 0x51797
jmp 0x517f5
leaq 0x228de2(%rip), %rax    # 0x27a580
cmpq $0x0, (%rax)
je 0x517f5
movslq -0x4(%rbp), %rcx
leaq 0x16b571(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movsd 0xa8(%rax), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x16b554(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
divsd 0x88(%rax), %xmm0
leaq 0x228d9b(%rip), %rax    # 0x27a580
cvtsi2sdq (%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0x517fd
xorps %xmm0, %xmm0
movsd %xmm0, -0x10(%rbp)
cmpl $0x1, -0x4(%rbp)
jne 0x51847
leaq 0x2262a6(%rip), %rax    # 0x277ab0
cmpq $0x10, (%rax)
jne 0x51824
movsd 0x11d818(%rip), %xmm0   # 0x16f030
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0x51845
leaq 0x226285(%rip), %rax    # 0x277ab0
cmpq $0x8, (%rax)
jne 0x51843
movsd 0x11d7f7(%rip), %xmm0   # 0x16f030
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0x51845
jmp 0x51847
movslq -0x4(%rbp), %rcx
leaq 0x16b4ce(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
movslq -0x4(%rbp), %rcx
leaq 0x16b4b6(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movslq -0x4(%rbp), %rsi
leaq 0x16b49e(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rsi, %rsi
addq %rsi, %rax
movsd 0x98(%rax), %xmm0
movslq -0x4(%rbp), %rsi
leaq 0x16b481(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rsi, %rsi
addq %rsi, %rax
movsd 0x90(%rax), %xmm1
movsd -0x10(%rbp), %xmm2
leaq 0x34c173(%rip), %rdi    # 0x39da30
leaq 0x129d4d(%rip), %rsi    # 0x17b611
movb $0x3, %al
callq 0x9060
leaq 0x34d67e(%rip), %rax    # 0x39ef50
cmpl $0x3, (%rax)
jne 0x51911
movslq -0x4(%rbp), %rcx
leaq 0x16b43e(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movsd 0x11d774(%rip), %xmm0   # 0x16f068
mulsd 0x98(%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
leaq 0x1404e3(%rip), %rax    # 0x191deb
movq %rax, -0x18(%rbp)
jmp 0x519d0
leaq 0x34d638(%rip), %rax    # 0x39ef50
cmpl $0x2, (%rax)
jne 0x51954
movslq -0x4(%rbp), %rcx
leaq 0x16b3f8(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movsd 0x11d6de(%rip), %xmm0   # 0x16f018
mulsd 0x98(%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
leaq 0x147374(%rip), %rax    # 0x198cc2
movq %rax, -0x18(%rbp)
jmp 0x519ce
leaq 0x34d5f5(%rip), %rax    # 0x39ef50
cmpl $0x1, (%rax)
jne 0x51997
movslq -0x4(%rbp), %rcx
leaq 0x16b3b5(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movsd 0x11d693(%rip), %xmm0   # 0x16f010
mulsd 0x98(%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
leaq 0x129caf(%rip), %rax    # 0x17b640
movq %rax, -0x18(%rbp)
jmp 0x519cc
movslq -0x4(%rbp), %rcx
leaq 0x16b37e(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movsd 0x11d654(%rip), %xmm0   # 0x16f008
mulsd 0x98(%rax), %xmm0
movsd %xmm0, -0x10(%rbp)
leaq 0x121336(%rip), %rax    # 0x172cfe
movq %rax, -0x18(%rbp)
jmp 0x519ce
jmp 0x519d0
cmpl $0x1, -0x4(%rbp)
jne 0x51a1a
leaq 0x2260d3(%rip), %rax    # 0x277ab0
cmpq $0x10, (%rax)
jne 0x519f7
movsd 0x11d645(%rip), %xmm0   # 0x16f030
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0x51a18
leaq 0x2260b2(%rip), %rax    # 0x277ab0
cmpq $0x8, (%rax)
jne 0x51a16
movsd 0x11d624(%rip), %xmm0   # 0x16f030
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
jmp 0x51a18
jmp 0x51a1a
movl -0x4(%rbp), %edi
callq 0x19760
cmpl $0x0, %eax
je 0x51ad5
movslq -0x4(%rbp), %rcx
leaq 0x16b2ea(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0xd0(%rax)
je 0x51ab5
leaq 0x226060(%rip), %rax    # 0x277ab0
cmpq $0x2000000, (%rax)      # imm = 0x2000000
jne 0x51a8d
movl -0x4(%rbp), %edi
movsd -0x10(%rbp), %xmm0
callq 0xebbe0
movsd 0x11d5c2(%rip), %xmm1   # 0x16f030
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rdx
leaq 0x349983(%rip), %rdi    # 0x39b400
leaq 0x129bbf(%rip), %rsi    # 0x17b643
movb $0x1, %al
callq 0x9060
jmp 0x51ab3
movl -0x4(%rbp), %edi
movsd -0x10(%rbp), %xmm0
callq 0xebbe0
movq -0x18(%rbp), %rdx
leaq 0x34995b(%rip), %rdi    # 0x39b400
leaq 0x129ba5(%rip), %rsi    # 0x17b651
movb $0x1, %al
callq 0x9060
jmp 0x51ad3
movsd -0x10(%rbp), %xmm0
movq -0x18(%rbp), %rdx
leaq 0x34993b(%rip), %rdi    # 0x39b400
leaq 0x129b92(%rip), %rsi    # 0x17b65e
movb $0x1, %al
callq 0x9060
jmp 0x51b0c
movsd -0x10(%rbp), %xmm0
movslq -0x4(%rbp), %rcx
leaq 0x16b23b(%rip), %rax    # 0x1bcd20
imulq $0xe8, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movq -0x18(%rbp), %rcx
leaq 0x349902(%rip), %rdi    # 0x39b400
leaq 0x129b66(%rip), %rsi    # 0x17b66b
movb $0x1, %al
callq 0x9060
leaq 0x34bf1d(%rip), %rdi    # 0x39da30
leaq 0x3498e6(%rip), %rsi    # 0x39b400
callq 0x96a0
leaq 0x34c986(%rip), %rax    # 0x39e4ac
movl $0x3, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)