// File: /workspace/github_cpp_makefile_star2_O1/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 0x14975b(%rip), %rcx    # 0x15dd30
leaq (%rcx,%rax), %r12
movsd 0x28(%rax,%rcx), %xmm0
movsd 0xf4b29(%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 0x13ccd
testl %eax, %eax
je 0x14634
cmpl $0x0, 0xd0(%r12)
je 0x14634
leaq 0x327bfc(%rip), %rdi    # 0x33c220
leaq 0xf5f72(%rip), %rsi     # 0x10a59d
leaq 0x101b32(%rip), %rcx    # 0x116164
jmp 0x146a7
movq 0x204295(%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 0x14694
testl %r15d, %r15d
setne %cl
cmpq $0x80000, %rax          # imm = 0x80000
setne %dl
orb %cl, %dl
je 0x1467f
cmpq $0x80000, %rax          # imm = 0x80000
setne %cl
cmpl $0x1, %r15d
setne %dl
orb %cl, %dl
jne 0x14706
movq 0x8(%r12), %rcx
leaq 0x327b95(%rip), %rdi    # 0x33c220
leaq 0xf5f1a(%rip), %rsi     # 0x10a5ac
jmp 0x146a7
movq 0x8(%r12), %rcx
leaq 0x327b80(%rip), %rdi    # 0x33c220
leaq 0xf5ef6(%rip), %rsi     # 0x10a59d
movl %r14d, %edx
movapd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
movb $0x1, %al
movb %al, 0x20419d(%rip)     # 0x21885b
movb %al, 0x204196(%rip)     # 0x21885a
movl 0x2040de(%rip), %edi    # 0x2187a8
addl $0x6, %edi
movzbl 0x20(%r12), %edx
leaq 0x327b46(%rip), %r14    # 0x33c220
movl %ebx, %esi
movq %r14, %rcx
callq 0xe7d0
xorl %eax, %eax
movb %al, 0x20416f(%rip)     # 0x21885b
movb %al, 0x204168(%rip)     # 0x21885a
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9120
cmpl $0x2, %r15d
jne 0x1472f
cmpb $0x0, 0x22a82b(%rip)    # 0x23ef3e
je 0x1478f
movq 0x1497ec(%rip), %rcx    # 0x15df08
leaq 0x327afd(%rip), %rdi    # 0x33c220
leaq 0xf5e91(%rip), %rsi     # 0x10a5bb
jmp 0x146a7
cmpl $0x1, %r15d
jne 0x1475a
cmpb $0x0, 0x22a802(%rip)    # 0x23ef3e
je 0x147e7
movq 0x8(%r12), %rcx
leaq 0x327ad2(%rip), %rdi    # 0x33c220
leaq 0xf5e84(%rip), %rsi     # 0x10a5d9
jmp 0x146a7
testl %r15d, %r15d
je 0x14809
cmpl $0x3, %r15d
je 0x1495d
cmpl $0x10, %r15d
je 0x148e3
cmpl $0x13, %r15d
jne 0x14923
movw $0x20, 0x327a96(%rip)   # 0x33c220
jmp 0x146b6
cmpb $0x0, 0x20416e(%rip)    # 0x218904
jne 0x147c5
cmpq $0x1, %rax
sete %dl
movl 0x20682f(%rip), %ecx    # 0x21afd4
cmpl $0x41, %ecx
sete %sil
andb %dl, %sil
movl 0x204143(%rip), %edx    # 0x2188f8
cmpl $0x47, %edx
sete %dil
testb %dil, %sil
je 0x14980
leaq 0x327a54(%rip), %rdi    # 0x33c220
leaq 0xf5df7(%rip), %rsi     # 0x10a5ca
movl %r14d, %edx
movapd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
jmp 0x146b6
cmpq $0x1ffff, %rax          # imm = 0x1FFFF
jg 0x1483e
cmpq $0x100, %rax            # imm = 0x100
je 0x14b70
cmpq $0x10000, %rax          # imm = 0x10000
je 0x14b70
jmp 0x14856
cmpb $0x0, 0x2040f4(%rip)    # 0x218904
je 0x149c6
movapd -0x30(%rbp), %xmm0
divsd 0xf4815(%rip), %xmm0    # 0x109038
movq 0x8(%r12), %rcx
leaq 0x3279f1(%rip), %rdi    # 0x33c220
leaq 0xf5db1(%rip), %rsi     # 0x10a5e7
movl %r14d, %edx
jmp 0x146af
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x14a57
cmpq $0x20000, %rax          # imm = 0x20000
je 0x14b70
cmpb $0x0, 0x2040a7(%rip)    # 0x218904
jne 0x14b70
cmpq $0x1, %rax
sete %dl
movl 0x206764(%rip), %ecx    # 0x21afd4
cmpl $0x41, %ecx
sete %sil
andb %dl, %sil
movl 0x204078(%rip), %edx    # 0x2188f8
cmpl $0x47, %edx
sete %dil
testb %dil, %sil
jne 0x14b70
testb %sil, %sil
je 0x148a7
cmpl $0x33, %edx
je 0x14b70
cmpl $0x47, %edx
je 0x14b70
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
cmpl $0x50, %ecx
sete %cl
testl $0x800009e4, %eax       # imm = 0x800009E4
jne 0x14b70
orb %cl, %dl
andb %dl, %sil
jne 0x14b70
movapd -0x30(%rbp), %xmm0
mulsd 0xf475a(%rip), %xmm0    # 0x109038
jmp 0x14823
callq 0x5f743
testl %eax, %eax
je 0x14923
movq 0x2f86b5(%rip), %rax    # 0x30cfa8
cmpb $0x66, (%rax)
jne 0x14a6f
movapd -0x30(%rbp), %xmm0
mulsd 0xf47b7(%rip), %xmm0    # 0x1090c0
leaq 0x327910(%rip), %rdi    # 0x33c220
leaq 0xf5ca4(%rip), %rsi     # 0x10a5bb
leaq 0x1156fe(%rip), %rcx    # 0x12a01c
jmp 0x14836
cmpl $0x8, %r15d
jne 0x149fe
cmpb $0x0, 0x22a60a(%rip)    # 0x23ef3e
je 0x149fe
movsbl 0x2f8663(%rip), %r8d    # 0x30cfa5
leaq 0x3278d7(%rip), %rdi    # 0x33c220
leaq 0xf5cb5(%rip), %rsi     # 0x10a605
movl %r14d, %edx
movapd -0x30(%rbp), %xmm0
jmp 0x14a46
cmpq $0x8, %rax
jne 0x14a23
cmpl $0x50, 0x206672(%rip)   # 0x21afe0
jne 0x14a23
movq 0x32aca5(%rip), %rcx    # 0x33f620
jmp 0x1471c
testb %sil, %sil
je 0x14997
cmpl $0x33, %edx
je 0x147c5
cmpl $0x47, %edx
je 0x147c5
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
cmpl $0x50, %ecx
sete %cl
testl $0x800009e4, %eax       # imm = 0x800009E4
jne 0x147c5
orb %cl, %dl
andb %dl, %sil
je 0x1467f
jmp 0x147c5
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
je 0x14b70
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x14b70
cmpq $0x200, %rax            # imm = 0x200
jne 0x14af3
movapd -0x30(%rbp), %xmm0
divsd 0xf4657(%rip), %xmm0    # 0x109050
jmp 0x14823
movq 0x203ecb(%rip), %rax    # 0x2188d0
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x14adb
cmpq $0x20000, %rax          # imm = 0x20000
jne 0x14a89
movq 0x8(%r12), %rcx
jmp 0x1471c
movapd -0x30(%rbp), %xmm0
callq 0x1325e
movsbl 0x2f8570(%rip), %r8d    # 0x30cfa5
leaq 0x3277e4(%rip), %rdi    # 0x33c220
leaq 0xf5bc2(%rip), %rsi     # 0x10a605
movl %r14d, %edx
movl $0x1, %ecx
movb $0x1, %al
callq 0x9060
jmp 0x146b6
movq 0x8(%r12), %rcx
leaq 0x3277bd(%rip), %rdi    # 0x33c220
leaq 0xf5b8c(%rip), %rsi     # 0x10a5f6
jmp 0x146a7
leaq 0x3277aa(%rip), %rdi    # 0x33c220
leaq 0xf5b3e(%rip), %rsi     # 0x10a5bb
leaq 0x1203d5(%rip), %rcx    # 0x134e59
jmp 0x146a7
movl %r15d, %ecx
andl $-0x2, %ecx
cmpl $0x4, %ecx
jne 0x14b88
cmpq $0x100000, %rax         # imm = 0x100000
je 0x14adb
cmpq $0x800000, %rax         # imm = 0x800000
je 0x14a19
cmpb $0x0, 0x20692f(%rip)    # 0x21b3e2
movq 0x8(%r12), %rcx
jne 0x14699
leaq 0x32775b(%rip), %rdi    # 0x33c220
leaq 0xf5b59(%rip), %rsi     # 0x10a625
movl %r14d, %edx
xorl %eax, %eax
callq 0x9060
jmp 0x146b6
movq 0x8(%r12), %rcx
leaq 0x327739(%rip), %rdi    # 0x33c220
leaq 0xf5b28(%rip), %rsi     # 0x10a616
jmp 0x146a7
cmpq $0x1, %rax
sete %dl
movl 0x2064d4(%rip), %ecx    # 0x21afd4
cmpl $0x41, %ecx
sete %sil
andb %dl, %sil
movl 0x203de8(%rip), %edx    # 0x2188f8
cmpl $0x47, %edx
sete %dil
andb %sil, %dil
cmpb $0x1, %dil
je 0x14b70
testb %sil, %sil
je 0x14b46
cmpl $0x47, %edx
je 0x14b70
cmpl $0x33, %edx
je 0x14b70
testb %sil, %sil
je 0x14b46
cmpl $0x33, %edx
je 0x14816
cmpl $0x47, %edx
je 0x14816
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
cmpl $0x50, %ecx
sete %cl
testl $0x800009e4, %eax       # imm = 0x800009E4
jne 0x14816
orb %cl, %dl
andb %dl, %sil
jne 0x14816
movq 0x8(%r12), %rcx
leaq 0x3276a4(%rip), %rdi    # 0x33c220
leaq 0xf5a64(%rip), %rsi     # 0x10a5e7
jmp 0x146a7
cmpl $0x6, %r15d
je 0x14a19
movq 0x8(%r12), %rcx
cmpq $0x80000, %rax          # imm = 0x80000
je 0x1471c
jmp 0x14b75