// File: /workspace/github_cpp_makefile_star2_O2/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 0x1340d8(%rip), %rcx    # 0x147d30
leaq (%rcx,%rax), %r12
movsd 0x28(%rax,%rcx), %xmm0
movsd 0xdf4a6(%rip), %xmm1    # 0xf3110
cmpeqsd %xmm0, %xmm1
andnpd %xmm0, %xmm1
movapd %xmm1, -0x30(%rbp)
cmpl $0x0, 0x1c(%rax,%rcx)
pushq $0x3d
popq %rax
pushq $0x7e
popq %r14
cmovel %eax, %r14d
callq 0x13376
testl %eax, %eax
je 0x13cb3
cmpl $0x0, 0xd0(%r12)
je 0x13cb3
leaq 0x31257d(%rip), %rdi    # 0x326220
leaq 0xe0953(%rip), %rsi     # 0xf45fd
leaq 0xec5c7(%rip), %rcx     # 0x100278
jmp 0x13d26
movq 0x1eec16(%rip), %rax    # 0x2028d0
cmpq $0x10000, %rax          # imm = 0x10000
setne %cl
movl %r15d, %edx
andl $-0x4, %edx
cmpl $0x4, %edx
setne %dl
orb %cl, %dl
je 0x13d13
testl %r15d, %r15d
setne %cl
cmpq $0x80000, %rax          # imm = 0x80000
setne %dl
orb %cl, %dl
je 0x13cfe
cmpq $0x80000, %rax          # imm = 0x80000
setne %cl
cmpl $0x1, %r15d
setne %dl
orb %cl, %dl
jne 0x13d85
movq 0x8(%r12), %rcx
leaq 0x312516(%rip), %rdi    # 0x326220
leaq 0xe08fb(%rip), %rsi     # 0xf460c
jmp 0x13d26
movq 0x8(%r12), %rcx
leaq 0x312501(%rip), %rdi    # 0x326220
leaq 0xe08d7(%rip), %rsi     # 0xf45fd
movl %r14d, %edx
movapd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
movb $0x1, %al
movb %al, 0x1eeb1e(%rip)     # 0x20285b
movb %al, 0x1eeb17(%rip)     # 0x20285a
movl 0x1eea5f(%rip), %edi    # 0x2027a8
addl $0x6, %edi
movzbl 0x20(%r12), %edx
leaq 0x3124c7(%rip), %r14    # 0x326220
movl %ebx, %esi
movq %r14, %rcx
callq 0xe2d2
xorl %eax, %eax
movb %al, 0x1eeaf0(%rip)     # 0x20285b
movb %al, 0x1eeae9(%rip)     # 0x20285a
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9120
cmpl $0x2, %r15d
jne 0x13dae
cmpb $0x0, 0x2151ac(%rip)    # 0x228f3e
je 0x13e0e
movq 0x13416d(%rip), %rcx    # 0x147f08
leaq 0x31247e(%rip), %rdi    # 0x326220
leaq 0xe0872(%rip), %rsi     # 0xf461b
jmp 0x13d26
cmpl $0x1, %r15d
jne 0x13dd9
cmpb $0x0, 0x215183(%rip)    # 0x228f3e
je 0x13e66
movq 0x8(%r12), %rcx
leaq 0x312453(%rip), %rdi    # 0x326220
leaq 0xe0865(%rip), %rsi     # 0xf4639
jmp 0x13d26
testl %r15d, %r15d
je 0x13f20
cmpl $0x3, %r15d
je 0x13fcf
cmpl $0x10, %r15d
je 0x13f55
cmpl $0x13, %r15d
jne 0x13f92
movw $0x20, 0x312417(%rip)   # 0x326220
jmp 0x13d35
cmpb $0x0, 0x1eeaef(%rip)    # 0x202904
jne 0x13e44
cmpq $0x1, %rax
sete %dl
movl 0x1f11b0(%rip), %ecx    # 0x204fd4
cmpl $0x41, %ecx
sete %sil
andb %dl, %sil
movl 0x1eeac4(%rip), %edx    # 0x2028f8
cmpl $0x47, %edx
sete %dil
testb %dil, %sil
je 0x13ff2
leaq 0x3123d5(%rip), %rdi    # 0x326220
leaq 0xe07d8(%rip), %rsi     # 0xf462a
movl %r14d, %edx
movapd -0x30(%rbp), %xmm0
movb $0x1, %al
callq 0x9060
jmp 0x13d35
cmpq $0x100, %rax            # imm = 0x100
je 0x141c9
cmpq $0x10000, %rax          # imm = 0x10000
je 0x141c9
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x140c7
cmpq $0x20000, %rax          # imm = 0x20000
je 0x141c9
cmpb $0x0, 0x1eea67(%rip)    # 0x202904
jne 0x141c9
cmpq $0x1, %rax
sete %dl
movl 0x1f1124(%rip), %ecx    # 0x204fd4
cmpl $0x41, %ecx
sete %sil
andb %dl, %sil
movl 0x1eea38(%rip), %edx    # 0x2028f8
cmpl $0x47, %edx
sete %dil
testb %dil, %sil
jne 0x141c9
testb %sil, %sil
je 0x13ee7
cmpl $0x33, %edx
je 0x141c9
cmpl $0x47, %edx
je 0x141c9
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
cmpl $0x50, %ecx
sete %cl
testl $0x800009e4, %eax       # imm = 0x800009E4
jne 0x141c9
orb %cl, %dl
andb %dl, %sil
jne 0x141c9
movapd -0x30(%rbp), %xmm0
mulsd 0xdf11a(%rip), %xmm0    # 0xf3038
jmp 0x13f3a
cmpb $0x0, 0x1ee9dd(%rip)    # 0x202904
je 0x14038
movapd -0x30(%rbp), %xmm0
divsd 0xdf0fe(%rip), %xmm0    # 0xf3038
movq 0x8(%r12), %rcx
leaq 0x3122da(%rip), %rdi    # 0x326220
leaq 0xe06fa(%rip), %rsi     # 0xf4647
movl %r14d, %edx
jmp 0x13d2e
callq 0x57eca
testl %eax, %eax
je 0x13f92
movq 0x2e3043(%rip), %rax    # 0x2f6fa8
cmpb $0x66, (%rax)
jne 0x140df
movapd -0x30(%rbp), %xmm0
mulsd 0xdf145(%rip), %xmm0    # 0xf30c0
leaq 0x31229e(%rip), %rdi    # 0x326220
leaq 0xe0692(%rip), %rsi     # 0xf461b
leaq 0x10009c(%rip), %rcx    # 0x11402c
jmp 0x13f4d
cmpl $0x8, %r15d
jne 0x14070
cmpb $0x0, 0x214f9b(%rip)    # 0x228f3e
je 0x14070
movsbl 0x2e2ff4(%rip), %r8d    # 0x2f6fa5
leaq 0x312268(%rip), %rdi    # 0x326220
leaq 0xe06a6(%rip), %rsi     # 0xf4665
pushq $0x1
popq %rcx
movl %r14d, %edx
movapd -0x30(%rbp), %xmm0
jmp 0x140bb
cmpq $0x8, %rax
jne 0x14095
cmpl $0x50, 0x1f1000(%rip)   # 0x204fe0
jne 0x14095
movq 0x315633(%rip), %rcx    # 0x329620
jmp 0x13d9b
testb %sil, %sil
je 0x14009
cmpl $0x33, %edx
je 0x13e44
cmpl $0x47, %edx
je 0x13e44
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
cmpl $0x50, %ecx
sete %cl
testl $0x800009e4, %eax       # imm = 0x800009E4
jne 0x13e44
orb %cl, %dl
andb %dl, %sil
je 0x13cfe
jmp 0x13e44
movl $0x80000000, %ecx       # imm = 0x80000000
cmpq %rcx, %rax
je 0x141c9
cmpq $0x20000000, %rax       # imm = 0x20000000
je 0x141c9
cmpq $0x200, %rax            # imm = 0x200
jne 0x14163
movapd -0x30(%rbp), %xmm0
divsd 0xdefe5(%rip), %xmm0    # 0xf3050
jmp 0x13f3a
movq 0x1ee859(%rip), %rax    # 0x2028d0
cmpq $0x2000000, %rax        # imm = 0x2000000
je 0x1414b
cmpq $0x20000, %rax          # imm = 0x20000
jne 0x140f9
movq 0x8(%r12), %rcx
jmp 0x13d9b
movapd -0x30(%rbp), %xmm0
callq 0x12952
movsbl 0x2e2efe(%rip), %r8d    # 0x2f6fa5
leaq 0x312172(%rip), %rdi    # 0x326220
leaq 0xe05b0(%rip), %rsi     # 0xf4665
pushq $0x1
popq %rcx
movl %r14d, %edx
movb $0x1, %al
callq 0x9060
jmp 0x13d35
movq 0x8(%r12), %rcx
leaq 0x31214d(%rip), %rdi    # 0x326220
leaq 0xe057c(%rip), %rsi     # 0xf4656
jmp 0x13d26
leaq 0x31213a(%rip), %rdi    # 0x326220
leaq 0xe052e(%rip), %rsi     # 0xf461b
leaq 0x10ad75(%rip), %rcx    # 0x11ee69
jmp 0x13d26
movl %r15d, %ecx
andl $-0x2, %ecx
cmpl $0x4, %ecx
jne 0x141e1
cmpq $0x100000, %rax         # imm = 0x100000
je 0x1414b
cmpq $0x800000, %rax         # imm = 0x800000
je 0x1408b
cmpb $0x0, 0x1f12bf(%rip)    # 0x2053e2
movq 0x8(%r12), %rcx
jne 0x13d18
leaq 0x3120eb(%rip), %rdi    # 0x326220
leaq 0xe0549(%rip), %rsi     # 0xf4685
movl %r14d, %edx
xorl %eax, %eax
callq 0x9060
jmp 0x13d35
movq 0x8(%r12), %rcx
leaq 0x3120c9(%rip), %rdi    # 0x326220
leaq 0xe0518(%rip), %rsi     # 0xf4676
jmp 0x13d26
cmpq $0x1, %rax
sete %dl
movl 0x1f0e64(%rip), %ecx    # 0x204fd4
cmpl $0x41, %ecx
sete %sil
andb %dl, %sil
movl 0x1ee778(%rip), %edx    # 0x2028f8
cmpl $0x47, %edx
sete %dil
andb %sil, %dil
cmpb $0x1, %dil
je 0x141c9
testb %sil, %sil
je 0x1419f
cmpl $0x47, %edx
je 0x141c9
cmpl $0x33, %edx
je 0x141c9
cmpl $0x41, %ecx
sete %dl
cmpq $0x1, %rax
sete %sil
cmpl $0x50, %ecx
sete %cl
testl $0x800009e4, %eax       # imm = 0x800009E4
jne 0x13f2d
orb %cl, %dl
andb %dl, %sil
jne 0x13f2d
movq 0x8(%r12), %rcx
leaq 0x31204b(%rip), %rdi    # 0x326220
leaq 0xe046b(%rip), %rsi     # 0xf4647
jmp 0x13d26
cmpl $0x6, %r15d
je 0x1408b
movq 0x8(%r12), %rcx
cmpq $0x80000, %rax          # imm = 0x80000
je 0x13d9b
jmp 0x141ce