// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/saicanon.cc
// Function: STRAIGHT_PROBE(int, double, double, double, double, double, double, double, double, double, unsigned char)
void STRAIGHT_PROBE(int line_number,
 double x, double y, double z
 , double a /*AA*/
 , double b /*BB*/
 , double c /*CC*/
 , double u, double v, double w, unsigned char probe_type
)
{
  double distance;
  double dx, dy, dz;
  double backoff;

  dx = (_program_position_x - x);
  dy = (_program_position_y - y);
  dz = (_program_position_z - z);
  distance = sqrt((dx * dx) + (dy * dy) + (dz * dz));

  fprintf(_outfile, "%5d ", _line_number++);
  print_nc_line_number();
  fprintf(_outfile, "STRAIGHT_PROBE(%.4f, %.4f, %.4f"
         ", %.4f" /*AA*/
         ", %.4f" /*BB*/
         ", %.4f" /*CC*/
         ")\n", x, y, z
         , a /*AA*/
         , b /*BB*/
         , c /*CC*/
         );
  _probe_position_x = x;
  _probe_position_y = y;
  _probe_position_z = z;
  _probe_position_a = a; /*AA*/
  _probe_position_b = b; /*BB*/
  _probe_position_c = c; /*CC*/
  if (distance == 0)
    {
      _program_position_x = _program_position_x;
      _program_position_y = _program_position_y;
      _program_position_z = _program_position_z;
    }
  else
    {
      backoff = ((_length_unit_type == CANON_UNITS_MM) ? 0.254 : 0.01);
      _program_position_x = (x + (backoff * (dx / distance)));
      _program_position_y = (y + (backoff * (dy / distance)));
      _program_position_z = (z + (backoff * (dz / distance)));
    }
  _program_position_a = a; /*AA*/
  _program_position_b = b; /*BB*/
  _program_position_c = c; /*CC*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movsd %xmm5, -0x30(%rbp)
movsd %xmm4, -0x28(%rbp)
movsd %xmm3, -0x20(%rbp)
movsd %xmm2, -0x8(%rbp)
movapd %xmm1, %xmm3
movsd %xmm1, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd 0x9699(%rip), %xmm1     # 0xfbf0
subsd %xmm0, %xmm1
movsd 0x969d(%rip), %xmm0     # 0xfc00
subsd %xmm3, %xmm0
movsd 0x96a1(%rip), %xmm3     # 0xfc10
subsd %xmm2, %xmm3
movsd %xmm0, -0x40(%rbp)
mulsd %xmm0, %xmm0
movsd %xmm1, -0x48(%rbp)
mulsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movsd %xmm3, -0x38(%rbp)
movapd %xmm3, %xmm0
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd %xmm0, -0x50(%rbp)
movq 0x7d46(%rip), %rdi      # 0xe2f0
movl 0x6bfc(%rip), %edx      # 0xd1ac
leal 0x1(%rdx), %eax
movl %eax, 0x6bf3(%rip)      # 0xd1ac
leaq 0x2c58(%rip), %rsi      # 0x9218
xorl %eax, %eax
callq 0x4240
callq 0x5320
movq 0x7d1d(%rip), %rdi      # 0xe2f0
leaq 0x3030(%rip), %rsi      # 0x960a
movsd -0x18(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
movsd -0x8(%rbp), %xmm2
movsd -0x20(%rbp), %xmm3
movsd -0x28(%rbp), %xmm4
movsd -0x30(%rbp), %xmm5
movb $0x6, %al
callq 0x4240
movsd -0x50(%rbp), %xmm10
movsd -0x18(%rbp), %xmm8
movsd -0x10(%rbp), %xmm5
movsd -0x8(%rbp), %xmm4
movsd -0x20(%rbp), %xmm3
movsd -0x28(%rbp), %xmm2
movsd -0x30(%rbp), %xmm1
movsd %xmm8, 0x9643(%rip)     # 0xfc70
movsd %xmm5, 0x9643(%rip)     # 0xfc78
movsd %xmm4, 0x9643(%rip)     # 0xfc80
movsd %xmm3, 0x9643(%rip)     # 0xfc88
movsd %xmm2, 0x9643(%rip)     # 0xfc90
movsd %xmm1, 0x9643(%rip)     # 0xfc98
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm10
jne 0x6662
jnp 0x66cf
movsd -0x48(%rbp), %xmm9
movsd -0x40(%rbp), %xmm7
movsd -0x38(%rbp), %xmm6
cmpb $0x0, 0x95d7(%rip)      # 0xfc50
jne 0x6685
movsd 0x2b75(%rip), %xmm0     # 0x91f8
jmp 0x668d
movsd 0x2b63(%rip), %xmm0     # 0x91f0
divsd %xmm10, %xmm9
mulsd %xmm0, %xmm9
addsd %xmm8, %xmm9
movsd %xmm9, 0x954b(%rip)     # 0xfbf0
divsd %xmm10, %xmm7
mulsd %xmm0, %xmm7
addsd %xmm5, %xmm7
movsd %xmm7, 0x9546(%rip)     # 0xfc00
divsd %xmm10, %xmm6
mulsd %xmm0, %xmm6
addsd %xmm4, %xmm6
movsd %xmm6, 0x9541(%rip)     # 0xfc10
movsd %xmm3, 0x9549(%rip)     # 0xfc20
movsd %xmm2, 0x9551(%rip)     # 0xfc30
movsd %xmm1, 0x9559(%rip)     # 0xfc40
addq $0x50, %rsp
popq %rbp
retq