// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathui.cpp
// Function: edit_cal()
void edit_cal()
{
DATA_SIZE m, b;
char *s;

   // get a plot center line reference value
   s = plot[selected_plot].plot_id;
   edit_buffer[0] = 0;

   if     (selected_plot == TEMP)  { m=temp1_m; b=temp1_b; }
   else if(selected_plot == TC2)   { m=temp2_m; b=temp2_b; }
   else if(selected_plot == BATTI) { m=batti_m; b=batti_b; }
   else if(selected_plot == LEDI)  { m=ledi_m;  b=ledi_b; }
   else if(selected_plot == BATTV) { m=vcal_m;  b=vcal_b; s="VCAL"; }
   else if(selected_plot == LUX1)  { m=lux1_m;  b=lux1_b; }
   else if(selected_plot == LUX2)  { m=lux2_m;  b=lux2_b; }
   else if(selected_plot == AUXV)  { m=adc2_m;  b=adc2_b; }
   else if(selected_plot == CCT)   { m=rb_m;    b=rb_b; }
   else {
      sprintf(out, "%s does not have a calibration adjustment!", s);
      edit_error(out);
      return;
   }

   if(cal_mode) {
//    sprintf(edit_buffer, "%f  %f", m,b);
      edit_buffer[0] = 0;
      sprintf(out, "Enter reading1 actual1 reading2 actual2 for %s (m=%f b=%f)", s, m,b);
   }
   else {
      sprintf(edit_buffer, "%f  %f", m,b);
      sprintf(out, "Enter m and b cal factors for %s (m=%f b=%f)", s, m,b);
   }
   start_edit(CAL_CMD, out);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x310e34(%rip), %rax    # 0x33fd58
movl (%rax), %ecx
movslq %ecx, %rax
imulq $0xe8, %rax, %rax
leaq 0x12edf9(%rip), %rdx    # 0x15dd30
movq (%rdx,%rax), %rbx
leaq 0x31039e(%rip), %rax    # 0x33f2e0
movb $0x0, (%rax)
cmpq $0x12, %rcx
ja 0x2f07a
leaq 0xdd006(%rip), %rdx     # 0x10bf5c
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
leaq 0x1ec262(%rip), %rcx    # 0x21b1c8
leaq 0x1ec253(%rip), %rdx    # 0x21b1c0
jmp 0x2eff7
leaq 0xe5c1e(%rip), %rbx     # 0x114b97
leaq 0x1ec218(%rip), %rcx    # 0x21b198
leaq 0x1ec209(%rip), %rdx    # 0x21b190
jmp 0x2eff7
leaq 0x1ec228(%rip), %rcx    # 0x21b1b8
leaq 0x1ec219(%rip), %rdx    # 0x21b1b0
jmp 0x2eff7
leaq 0x1ec208(%rip), %rcx    # 0x21b1a8
leaq 0x1ec1f9(%rip), %rdx    # 0x21b1a0
jmp 0x2eff7
leaq 0x1ec1d8(%rip), %rcx    # 0x21b188
leaq 0x1ec1c9(%rip), %rdx    # 0x21b180
jmp 0x2eff7
leaq 0x1ec228(%rip), %rcx    # 0x21b1e8
leaq 0x1ec219(%rip), %rdx    # 0x21b1e0
jmp 0x2eff7
leaq 0x1ec1a8(%rip), %rcx    # 0x21b178
leaq 0x1ec199(%rip), %rdx    # 0x21b170
jmp 0x2eff7
leaq 0x1ec1f8(%rip), %rcx    # 0x21b1d8
leaq 0x1ec1e9(%rip), %rdx    # 0x21b1d0
jmp 0x2eff7
leaq 0x1ec208(%rip), %rcx    # 0x21b1f8
leaq 0x1ec1f9(%rip), %rdx    # 0x21b1f0
movsd (%rcx), %xmm1
movsd (%rdx), %xmm0
leaq 0x2dde42(%rip), %rcx    # 0x30ce48
cmpb $0x0, (%rcx)
je 0x2f017
movb $0x0, (%rax)
leaq 0xe5bb2(%rip), %rsi     # 0x114bc7
jmp 0x2f051
leaq 0x3102c2(%rip), %rdi    # 0x33f2e0
leaq 0xe5bdd(%rip), %rsi     # 0x114c02
movsd %xmm0, -0x18(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm1, -0x20(%rbp)
movsd -0x20(%rbp), %xmm1
movb $0x2, %al
callq 0x9060
movsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
leaq 0xe5bb8(%rip), %rsi     # 0x114c09
leaq 0x30d1c8(%rip), %r14    # 0x33c220
movq %r14, %rdi
movq %rbx, %rdx
movb $0x2, %al
callq 0x9060
movl $0x140, %edi            # imm = 0x140
movq %r14, %rsi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2bc51
leaq 0x30d19f(%rip), %r14    # 0x33c220
leaq 0xe5b14(%rip), %rsi     # 0x114b9c
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2326e