// File: /workspace/github_cpp_makefile_star2_O3/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 0x9480(%rip), %xmm1     # 0xfbf0
subsd %xmm0, %xmm1
movsd 0x9484(%rip), %xmm0     # 0xfc00
subsd %xmm3, %xmm0
movsd 0x9488(%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 0x7b2d(%rip), %rdi      # 0xe2f0
movl 0x69db(%rip), %edx      # 0xd1a4
leal 0x1(%rdx), %eax
movl %eax, 0x69d2(%rip)      # 0xd1a4
leaq 0x2a3f(%rip), %rsi      # 0x9218
xorl %eax, %eax
callq 0x4230
callq 0x54d0
movq 0x7b04(%rip), %rdi      # 0xe2f0
leaq 0x2e17(%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 0x4230
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, 0x942a(%rip)     # 0xfc70
movsd %xmm5, 0x942a(%rip)     # 0xfc78
movsd %xmm4, 0x942a(%rip)     # 0xfc80
movsd %xmm3, 0x942a(%rip)     # 0xfc88
movsd %xmm2, 0x942a(%rip)     # 0xfc90
movsd %xmm1, 0x942a(%rip)     # 0xfc98
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm10
jne 0x687b
jnp 0x68e8
movsd -0x48(%rbp), %xmm9
movsd -0x40(%rbp), %xmm7
movsd -0x38(%rbp), %xmm6
cmpb $0x0, 0x93be(%rip)      # 0xfc50
jne 0x689e
movsd 0x295c(%rip), %xmm0     # 0x91f8
jmp 0x68a6
movsd 0x294a(%rip), %xmm0     # 0x91f0
divsd %xmm10, %xmm9
mulsd %xmm0, %xmm9
addsd %xmm8, %xmm9
movsd %xmm9, 0x9332(%rip)     # 0xfbf0
divsd %xmm10, %xmm7
mulsd %xmm0, %xmm7
addsd %xmm5, %xmm7
movsd %xmm7, 0x932d(%rip)     # 0xfc00
divsd %xmm10, %xmm6
mulsd %xmm0, %xmm6
addsd %xmm4, %xmm6
movsd %xmm6, 0x9328(%rip)     # 0xfc10
movsd %xmm3, 0x9330(%rip)     # 0xfc20
movsd %xmm2, 0x9338(%rip)     # 0xfc30
movsd %xmm1, 0x9340(%rip)     # 0xfc40
addq $0x50, %rsp
popq %rbp
retq