// File: /workspace/github_cpp_makefile_star2_O3/jkingan[P]ladyheather/heather.cpp
// Function: label_plot_ref(int, int)
int label_plot_ref(int id, int col)
{
double val;
char c;

   // format the plot header reference value line entries

   val = (double) plot[id].plot_center;
   if(val == NEED_CENTER) val = 0.0;
   if(plot[id].float_center) c = '~';
   else                      c = '=';

   if(tie_plot(id) && plot[id].show_freq) {
      sprintf(out, "ref%c<%.7f %s>", c, val, "Hz");
   }
   else if(phase_plot(id)) {
      sprintf(out, "ref%c<%.7f %s>", c, val, plot[id].units);
   }
   else if((id == ADC3) && (rcvr_type == THERMO_RCVR)) {  // PPS
      sprintf(out, "ref%c<%.6f %s>", c, val, plot[id].units);
   }
   else if((id == ADC4) && (rcvr_type == THERMO_RCVR)) {  // OSC
      sprintf(out, "ref%c<%.6f %s>", c, val, plot[id].units);
   }
   else if(id == DAC)  {
      if(luxor)      sprintf(out, "ref%c<%.3f %s>", c, val, plot[DAC].units);
      else if(res_t) sprintf(out, "ref%c<%.6f ns>", c, val);
      else if(TIMING_RCVR) sprintf(out, "ref%c<%.6f ns>", c, val);
      else sprintf(out, "ref%c<%.6f %s>", c, val, plot[id].units);
   }
   else if(id == OSC)  {
      if(luxor)      sprintf(out, "ref%c<%.3f%s>", c, val, plot[id].units);
      else if(rcvr_type == CS_RCVR)   sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);
      else if(rcvr_type == TICC_RCVR) sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);
      else if(rcvr_type == X72_RCVR) {  // xxxxxx
         sprintf(out, "ref%c<%.5g %s>", c, val, plot[id].units);
      }
      else if(rcvr_type == ZODIAC_RCVR) sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);
      else if(TIMING_RCVR) sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);
      else sprintf(out, "ref%c<%.1f %s>", c, val*1000.0, plot[id].units);
   }
   else if(id == PPS) {
      if(res_t) sprintf(out, "ref%c<%.1f %s>", c, val/1000.0, plot[id].units);
      else if(rcvr_type == GPSD_RCVR)   sprintf(out, "ref%c<%.1f %s>", c, val/1.0E6F, plot[id].units);
      else if(rcvr_type == ESIP_RCVR)   sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);
      else if(rcvr_type == FURUNO_RCVR) sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);
      else if(ACU_GG)                   sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);
      else if(ACU_360)                  sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);
      else if(TIMING_RCVR)              sprintf(out, "ref%c<%.1f %s>", c, val/1000.0, plot[id].units);
      else sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);
   }
   else if(id == SAT_PLOT) {
      sprintf(out, " ");
   }
   else if(id == TEMP) {
      if((rcvr_type == UCCM_RCVR) && (scpi_type == UCCMP_TYPE)) {
         sprintf(out, "ref%c<%.3f %s>", c, val, ppt_string);
      }
      else sprintf(out, "ref%c<%.3f %c%c>", c, scale_temp(val), DEGREES,DEG_SCALE);
   }
else if((id == PRESSURE) && enviro_mode()) {
   if(HG_PRESS) sprintf(out, "ref%c<%.3f %s>", c, scale_pressure(val), "Hg");
   else         sprintf(out, "ref%c<%.3f %s>", c, scale_pressure(val), "mb");
}
   else if(luxor && (id == TC2)) {
      sprintf(out, "ref%c<%.3f %c%c>", c, val, DEGREES,DEG_SCALE);
   }
   else if(rcvr_type == CS_RCVR) {
      sprintf(out, "ref%c<%.3f %s>", c, val, plot[id].units);
   }
   else if(rcvr_type == X72_RCVR) {
      sprintf(out, "ref%c<%.4f %s>", c, val, plot[id].units);
   }
   else if((id == ONE) || (id == TWO)) {
      if(rcvr_type == TIDE_RCVR) {  // ckckck
         sprintf(out, "ref%c<%.3f %s>", c, val, plot[id].units);
      }
      else if(rcvr_type == ZYFER_RCVR) {
         sprintf(out, "ref%c<%.4f %s>", c, val, plot[id].units);
      }
      else if(plot_loc) {
         sprintf(out, "ref%c<%.7f %s>", c, val, plot[id].units);
      }
      else sprintf(out, "ref%c<private %s>", c, plot[id].units);
   }
   else if(id == THREE) {
      sprintf(out, "ref%c<%.3f %s>", c, val, plot[id].units);
   }
   else if(rcvr_type == THERMO_RCVR) {
      sprintf(out, "ref%c<%.3f %s>", c, val, plot[id].units);
   }
   else sprintf(out, "ref%c<%.1f %s>", c, val, plot[id].units);

   no_x_margin = no_y_margin = 1;
   vidstr(REF_ROW, col, plot[id].plot_color, out);
   no_x_margin = no_y_margin = 0;

   return strlen(out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movl %edi, %r15d
movslq %edi, %rdi
imulq $0xe8, %rdi, %rax
leaq 0x149713(%rip), %rcx    # 0x15dd30
leaq (%rcx,%rax), %r12
movsd 0x28(%rax,%rcx), %xmm0
movsd 0xf4ae1(%rip), %xmm1    # 0x109110
cmpeqsd %xmm0, %xmm1
andnpd %xmm0, %xmm1
movapd %xmm1, -0x30(%rbp)
cmpl $0x0, 0x1c(%rax,%rcx)
movl $0x3d, %eax
movl $0x7e, %r14d
cmovel %eax, %r14d
callq 0x13c3e
testl %eax, %eax
je 0x1467c
cmpl $0x0, 0xd0(%r12)
je 0x1467c
leaq 0x327bb4(%rip), %rdi    # 0x33c220
leaq 0xf5f3a(%rip), %rsi     # 0x10a5ad
leaq 0x101b7e(%rip), %rcx    # 0x1161f8
jmp 0x146ef
movq 0x20424d(%rip), %rax    # 0x2188d0
cmpq $0x10000, %rax          # imm = 0x10000
setne %cl
movl %r15d, %edx
andl $-0x4, %edx
cmpl $0x4, %edx
setne %dl
orb %cl, %dl
je 0x146dc
testl %r15d, %r15d
setne %cl
cmpq $0x80000, %rax          # imm = 0x80000
setne %dl
orb %cl, %dl
je 0x146c7
cmpq $0x80000, %rax          # imm = 0x80000
setne %cl
cmpl $0x1, %r15d
setne %dl
orb %cl, %dl
jne 0x1474e
movq 0x8(%r12), %rcx
leaq 0x327b4d(%rip), %rdi    # 0x33c220
leaq 0xf5ee2(%rip), %rsi     # 0x10a5bc
jmp 0x146ef
movq 0x8(%r12), %rcx
leaq 0x327b38(%rip), %rdi    # 0x33c220
leaq 0xf5ebe(%rip), %rsi     # 0x10a5ad
movl %r14d, %edx
movapd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
movb $0x1, %al
movb %al, 0x204155(%rip)     # 0x21885b
movb %al, 0x20414e(%rip)     # 0x21885a
movl 0x204096(%rip), %edi    # 0x2187a8
addl $0x6, %edi
movzbl 0x20(%r12), %edx
leaq 0x327afe(%rip), %r14    # 0x33c220
movl %ebx, %esi
movq %r14, %rcx
callq 0xe787
xorl %eax, %eax
movb %al, 0x204127(%rip)     # 0x21885b
movb %al, 0x204120(%rip)     # 0x21885a
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9120
cmpl $0x2, %r15d
jne 0x14777
cmpb $0x0, 0x22a7e3(%rip)    # 0x23ef3e
je 0x147d7
movq 0x1497a4(%rip), %rcx    # 0x15df08
leaq 0x327ab5(%rip), %rdi    # 0x33c220
leaq 0xf5e59(%rip), %rsi     # 0x10a5cb
jmp 0x146ef
cmpl $0x1, %r15d
jne 0x147a2
cmpb $0x0, 0x22a7ba(%rip)    # 0x23ef3e
je 0x1482f
movq 0x8(%r12), %rcx
leaq 0x327a8a(%rip), %rdi    # 0x33c220
leaq 0xf5e4c(%rip), %rsi     # 0x10a5e9
jmp 0x146ef
testl %r15d, %r15d
je 0x14851
cmpl $0x3, %r15d
je 0x1496f
cmpl $0x10, %r15d
je 0x1492b
cmpl $0x13, %r15d
jne 0x14992
movw $0x20, 0x327a4e(%rip)   # 0x33c220
jmp 0x146fe
cmpb $0x0, 0x204126(%rip)    # 0x218904
jne 0x1480d
cmpq $0x1, %rax
sete %dl
movl 0x2067e7(%rip), %ecx    # 0x21afd4
cmpl $0x41, %ecx
sete %sil
andb %dl, %sil
movl 0x2040fb(%rip), %edx    # 0x2188f8
cmpl $0x47, %edx
sete %dil
testb %dil, %sil
je 0x149cc
leaq 0x327a0c(%rip), %rdi    # 0x33c220
leaq 0xf5dbf(%rip), %rsi     # 0x10a5da
movl %r14d, %edx
movapd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
jmp 0x146fe
cmpq $0x1ffff, %rax          # imm = 0x1FFFF
jg 0x14886
cmpq $0x100, %rax            # imm = 0x100
je 0x14b9d
cmpq $0x10000, %rax          # imm = 0x10000
je 0x14b9d
jmp 0x1489e
cmpb $0x0, 0x2040ac(%rip)    # 0x218904
je 0x14a12
movapd -0x30(%rbp), %xmm0
divsd 0xf47cd(%rip), %xmm0    # 0x109038
movq 0x8(%r12), %rcx
leaq 0x3279a9(%rip), %rdi    # 0x33c220
leaq 0xf5d79(%rip), %rsi     # 0x10a5f7
movl %r14d, %edx
jmp 0x146f7
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x14a7e
cmpq $0x20000, %rax          # imm = 0x20000
je 0x14b9d
cmpb $0x0, 0x20405f(%rip)    # 0x218904
jne 0x14b9d
cmpq $0x1, %rax
sete %dl
movl 0x20671c(%rip), %ecx    # 0x21afd4
cmpl $0x41, %ecx
sete %sil
andb %dl, %sil
movl 0x204030(%rip), %edx    # 0x2188f8
cmpl $0x47, %edx
sete %dil
testb %dil, %sil
jne 0x14b9d
testb %sil, %sil
je 0x148ef
cmpl $0x33, %edx
je 0x14b9d
cmpl $0x47, %edx
je 0x14b9d
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
cmpl $0x50, %ecx
sete %cl
testl $0x800009e4, %eax       # imm = 0x800009E4
jne 0x14b9d
orb %cl, %dl
andb %dl, %sil
jne 0x14b9d
movapd -0x30(%rbp), %xmm0
mulsd 0xf4712(%rip), %xmm0    # 0x109038
jmp 0x1486b
callq 0x5f6cb
testl %eax, %eax
je 0x14a96
movq 0x2f8669(%rip), %rax    # 0x30cfa8
cmpb $0x66, (%rax)
jne 0x14ab7
movapd -0x30(%rbp), %xmm0
mulsd 0xf476b(%rip), %xmm0    # 0x1090c0
leaq 0x3278c4(%rip), %rdi    # 0x33c220
leaq 0xf5c68(%rip), %rsi     # 0x10a5cb
leaq 0x11577d(%rip), %rcx    # 0x12a0e7
jmp 0x1487e
cmpq $0x8, %rax
jne 0x14a4a
cmpl $0x50, 0x206660(%rip)   # 0x21afe0
jne 0x14a4a
movq 0x32ac93(%rip), %rcx    # 0x33f620
jmp 0x14764
cmpl $0x8, %r15d
jne 0x14a9d
cmpb $0x0, 0x22a59b(%rip)    # 0x23ef3e
je 0x14a9d
movsbl 0x2f85f4(%rip), %r8d    # 0x30cfa5
leaq 0x327868(%rip), %rdi    # 0x33c220
leaq 0xf5c56(%rip), %rsi     # 0x10a615
movl %r14d, %edx
movapd -0x30(%rbp), %xmm0
jmp 0x14a6d
testb %sil, %sil
je 0x149e3
cmpl $0x33, %edx
je 0x1480d
cmpl $0x47, %edx
je 0x1480d
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
cmpl $0x50, %ecx
sete %cl
testl $0x800009e4, %eax       # imm = 0x800009E4
jne 0x1480d
orb %cl, %dl
andb %dl, %sil
je 0x146c7
jmp 0x1480d
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
je 0x14b9d
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x14b9d
cmpq $0x200, %rax            # imm = 0x200
jne 0x14b37
movapd -0x30(%rbp), %xmm0
divsd 0xf460b(%rip), %xmm0    # 0x109050
jmp 0x1486b
movapd -0x30(%rbp), %xmm0
callq 0x131c9
movsbl 0x2f8549(%rip), %r8d    # 0x30cfa5
leaq 0x3277bd(%rip), %rdi    # 0x33c220
leaq 0xf5bab(%rip), %rsi     # 0x10a615
movl %r14d, %edx
movl $0x1, %ecx
movb $0x1, %al
callq 0x9060
jmp 0x146fe
movq 0x8(%r12), %rcx
leaq 0x327796(%rip), %rdi    # 0x33c220
leaq 0xf5b75(%rip), %rsi     # 0x10a606
jmp 0x146ef
movq 0x203e33(%rip), %rax    # 0x2188d0
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x14b1f
cmpq $0x20000, %rax          # imm = 0x20000
jne 0x14ad1
movq 0x8(%r12), %rcx
jmp 0x14764
leaq 0x327762(%rip), %rdi    # 0x33c220
leaq 0xf5b06(%rip), %rsi     # 0x10a5cb
leaq 0x12047d(%rip), %rcx    # 0x134f49
jmp 0x146ef
movl %r15d, %ecx
andl $-0x2, %ecx
cmpl $0x4, %ecx
jne 0x14bb5
cmpq $0x100000, %rax         # imm = 0x100000
je 0x14b1f
cmpq $0x800000, %rax         # imm = 0x800000
je 0x14aad
cmpb $0x0, 0x2068eb(%rip)    # 0x21b3e2
movq 0x8(%r12), %rcx
jne 0x146e1
leaq 0x327717(%rip), %rdi    # 0x33c220
leaq 0xf5b25(%rip), %rsi     # 0x10a635
movl %r14d, %edx
xorl %eax, %eax
callq 0x9060
jmp 0x146fe
movq 0x8(%r12), %rcx
leaq 0x3276f5(%rip), %rdi    # 0x33c220
leaq 0xf5af4(%rip), %rsi     # 0x10a626
jmp 0x146ef
cmpq $0x1, %rax
sete %dl
movl 0x206490(%rip), %ecx    # 0x21afd4
cmpl $0x41, %ecx
sete %sil
andb %dl, %sil
movl 0x203da4(%rip), %edx    # 0x2188f8
cmpl $0x47, %edx
sete %dil
andb %sil, %dil
cmpb $0x1, %dil
je 0x14b9d
testb %sil, %sil
je 0x14b73
cmpl $0x47, %edx
je 0x14b9d
cmpl $0x33, %edx
je 0x14b9d
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
cmpl $0x50, %ecx
sete %cl
testl $0x800009e4, %eax       # imm = 0x800009E4
jne 0x1485e
orb %cl, %dl
andb %dl, %sil
jne 0x1485e
movq 0x8(%r12), %rcx
leaq 0x327677(%rip), %rdi    # 0x33c220
leaq 0xf5a47(%rip), %rsi     # 0x10a5f7
jmp 0x146ef
cmpl $0x6, %r15d
je 0x14aad
movq 0x8(%r12), %rcx
cmpq $0x80000, %rax          # imm = 0x80000
je 0x14764
jmp 0x14ba2