// File: /workspace/github_cpp_makefile_star2_O3/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 0x310c10(%rip), %rax    # 0x33fd58
movl (%rax), %eax
movslq %eax, %rcx
imulq $0xe8, %rcx, %rcx
leaq 0x12ebd5(%rip), %rdx    # 0x15dd30
movq (%rdx,%rcx), %rbx
leaq 0x31017a(%rip), %rcx    # 0x33f2e0
movb $0x0, (%rcx)
cmpq $0x12, %rax
ja 0x2f29b
leaq 0xdcdea(%rip), %rcx     # 0x10bf64
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1ec03e(%rip), %rax    # 0x21b1c8
leaq 0x1ec02f(%rip), %rcx    # 0x21b1c0
jmp 0x2f21b
leaq 0xe5a8e(%rip), %rbx     # 0x114c2b
leaq 0x1ebff4(%rip), %rax    # 0x21b198
leaq 0x1ebfe5(%rip), %rcx    # 0x21b190
jmp 0x2f21b
leaq 0x1ec004(%rip), %rax    # 0x21b1b8
leaq 0x1ebff5(%rip), %rcx    # 0x21b1b0
jmp 0x2f21b
leaq 0x1ebfe4(%rip), %rax    # 0x21b1a8
leaq 0x1ebfd5(%rip), %rcx    # 0x21b1a0
jmp 0x2f21b
leaq 0x1ebfb4(%rip), %rax    # 0x21b188
leaq 0x1ebfa5(%rip), %rcx    # 0x21b180
jmp 0x2f21b
leaq 0x1ec004(%rip), %rax    # 0x21b1e8
leaq 0x1ebff5(%rip), %rcx    # 0x21b1e0
jmp 0x2f21b
leaq 0x1ebf84(%rip), %rax    # 0x21b178
leaq 0x1ebf75(%rip), %rcx    # 0x21b170
jmp 0x2f21b
leaq 0x1ebfd4(%rip), %rax    # 0x21b1d8
leaq 0x1ebfc5(%rip), %rcx    # 0x21b1d0
jmp 0x2f21b
leaq 0x1ebfe4(%rip), %rax    # 0x21b1f8
leaq 0x1ebfd5(%rip), %rcx    # 0x21b1f0
movsd (%rax), %xmm1
movsd (%rcx), %xmm0
leaq 0x2ddc1e(%rip), %rax    # 0x30ce48
cmpb $0x0, (%rax)
je 0x2f238
leaq 0xe5a25(%rip), %rsi     # 0x114c5b
jmp 0x2f272
leaq 0x3100a1(%rip), %rdi    # 0x33f2e0
leaq 0xe5a50(%rip), %rsi     # 0x114c96
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 0xe5a2b(%rip), %rsi     # 0x114c9d
leaq 0x30cfa7(%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 0x2bf98
leaq 0x30cf7e(%rip), %r14    # 0x33c220
leaq 0xe5987(%rip), %rsi     # 0x114c30
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x23027