// File: sundale[P]gcode/rs274ngc/interp_internal.cc
// Function: Interp::set_probe_data(setup_struct*)
int Interp::set_probe_data(setup_pointer settings)       //!< pointer to machine settings
{
  double a, b, c;
  refresh_actual_position(settings);
  settings->parameters[5061] = GET_EXTERNAL_PROBE_POSITION_X();
  settings->parameters[5062] = GET_EXTERNAL_PROBE_POSITION_Y();
  settings->parameters[5063] = GET_EXTERNAL_PROBE_POSITION_Z();

  a = GET_EXTERNAL_PROBE_POSITION_A();
  if(settings->a_axis_wrapped) {
      a = fmod(a, 360.0);
      if(a<0) a += 360.0;
  }
  settings->parameters[5064] = a;

  b = GET_EXTERNAL_PROBE_POSITION_B();
  if(settings->b_axis_wrapped) {
      b = fmod(b, 360.0);
      if(b<0) b += 360.0;
  }
  settings->parameters[5065] = b;

  c = GET_EXTERNAL_PROBE_POSITION_C();
  if(settings->c_axis_wrapped) {
      c = fmod(c, 360.0);
      if(c<0) c += 360.0;
  }
  settings->parameters[5066] = c;

  settings->parameters[5067] = GET_EXTERNAL_PROBE_POSITION_U();
  settings->parameters[5068] = GET_EXTERNAL_PROBE_POSITION_V();
  settings->parameters[5069] = GET_EXTERNAL_PROBE_POSITION_W();
  settings->parameters[5070] = (double) GET_EXTERNAL_PROBE_TRIPPED_VALUE();

  // was an undocumented feature?: settings->parameters[5067] = GET_EXTERNAL_PROBE_VALUE();
  return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x115e0
callq 0x10b70
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb5e8(%rax)
callq 0x102a0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb5f0(%rax)
callq 0x11650
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb5f8(%rax)
callq 0x10a90
movsd %xmm0, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1e6cc(%rax)
je 0x5bc4c
movsd -0x18(%rbp), %xmm0
movsd 0x1d214(%rip), %xmm1    # 0x78e38
callq 0x116b0
movsd %xmm0, -0x18(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x18(%rbp), %xmm0
jbe 0x5bc4a
movsd 0x1d1f8(%rip), %xmm0    # 0x78e38
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
jmp 0x5bc4c
movsd -0x18(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb600(%rax)
callq 0x12070
movsd %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1e6d0(%rax)
je 0x5bca9
movsd -0x20(%rbp), %xmm0
movsd 0x1d1b7(%rip), %xmm1    # 0x78e38
callq 0x116b0
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x20(%rbp), %xmm0
jbe 0x5bca7
movsd 0x1d19b(%rip), %xmm0    # 0x78e38
addsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x5bca9
movsd -0x20(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb608(%rax)
callq 0x104b0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1e6d4(%rax)
je 0x5bd06
movsd -0x28(%rbp), %xmm0
movsd 0x1d15a(%rip), %xmm1    # 0x78e38
callq 0x116b0
movsd %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x28(%rbp), %xmm0
jbe 0x5bd04
movsd 0x1d13e(%rip), %xmm0    # 0x78e38
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x5bd06
movsd -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb610(%rax)
callq 0x10f30
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb618(%rax)
callq 0x11a80
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb620(%rax)
callq 0x119d0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb628(%rax)
callq 0x11e90
cvtsi2sd %eax, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0xb630(%rax)
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)