// File: /workspace/github_cpp_makefile_star2_O2/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 0x2fd6e6(%rip), %rax    # 0x329d58
movl (%rax), %eax
movslq %eax, %rcx
imulq $0xe8, %rcx, %rcx
leaq 0x11b6ab(%rip), %rdx    # 0x147d30
movq (%rdx,%rcx), %rbx
leaq 0x2fcc50(%rip), %rcx    # 0x3292e0
movb $0x0, (%rcx)
cmpq $0x12, %rax
ja 0x2c7c5
leaq 0xc9938(%rip), %rcx     # 0xf5fdc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1d8b14(%rip), %rax    # 0x2051c8
leaq 0x1d8b05(%rip), %rcx    # 0x2051c0
jmp 0x2c745
leaq 0xd25e4(%rip), %rbx     # 0xfecab
leaq 0x1d8aca(%rip), %rax    # 0x205198
leaq 0x1d8abb(%rip), %rcx    # 0x205190
jmp 0x2c745
leaq 0x1d8ada(%rip), %rax    # 0x2051b8
leaq 0x1d8acb(%rip), %rcx    # 0x2051b0
jmp 0x2c745
leaq 0x1d8aba(%rip), %rax    # 0x2051a8
leaq 0x1d8aab(%rip), %rcx    # 0x2051a0
jmp 0x2c745
leaq 0x1d8a8a(%rip), %rax    # 0x205188
leaq 0x1d8a7b(%rip), %rcx    # 0x205180
jmp 0x2c745
leaq 0x1d8ada(%rip), %rax    # 0x2051e8
leaq 0x1d8acb(%rip), %rcx    # 0x2051e0
jmp 0x2c745
leaq 0x1d8a5a(%rip), %rax    # 0x205178
leaq 0x1d8a4b(%rip), %rcx    # 0x205170
jmp 0x2c745
leaq 0x1d8aaa(%rip), %rax    # 0x2051d8
leaq 0x1d8a9b(%rip), %rcx    # 0x2051d0
jmp 0x2c745
leaq 0x1d8aba(%rip), %rax    # 0x2051f8
leaq 0x1d8aab(%rip), %rcx    # 0x2051f0
movsd (%rax), %xmm1
movsd (%rcx), %xmm0
leaq 0x2ca6f4(%rip), %rax    # 0x2f6e48
cmpb $0x0, (%rax)
je 0x2c762
leaq 0xd257b(%rip), %rsi     # 0xfecdb
jmp 0x2c79c
leaq 0x2fcb77(%rip), %rdi    # 0x3292e0
leaq 0xd25a6(%rip), %rsi     # 0xfed16
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 0xd2581(%rip), %rsi     # 0xfed1d
leaq 0x2f9a7d(%rip), %r14    # 0x326220
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 0x297a7
leaq 0x2f9a54(%rip), %r14    # 0x326220
leaq 0xd24dd(%rip), %rsi     # 0xfecb0
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9060
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x214df