// File: 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 $0x90, %rsp
movb %sil, %al
movsd 0x10(%rbp), %xmm8
movl %edi, -0x4(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x20(%rbp)
movsd %xmm3, -0x28(%rbp)
movsd %xmm4, -0x30(%rbp)
movsd %xmm5, -0x38(%rbp)
movsd %xmm6, -0x40(%rbp)
movsd %xmm7, -0x48(%rbp)
movb %al, -0x49(%rbp)
movsd 0xa496(%rip), %xmm0     # 0x11c10
subsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd 0xa494(%rip), %xmm0     # 0x11c20
subsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0xa492(%rip), %xmm0     # 0x11c30
subsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x60(%rbp), %xmm1
movsd -0x60(%rbp), %xmm2
movsd -0x68(%rbp), %xmm0
mulsd -0x68(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x4130
movsd %xmm0, -0x58(%rbp)
movq 0x8b29(%rip), %rdi      # 0x10310
movl 0x79c7(%rip), %edx      # 0xf1b4
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x79bc(%rip)      # 0xf1b4
leaq 0x3a39(%rip), %rsi      # 0xb238
movb $0x0, %al
callq 0x4260
callq 0x60d0
movq 0x8afe(%rip), %rdi      # 0x10310
movsd -0x10(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
movsd -0x20(%rbp), %xmm2
movsd -0x28(%rbp), %xmm3
movsd -0x30(%rbp), %xmm4
movsd -0x38(%rbp), %xmm5
leaq 0x3df3(%rip), %rsi      # 0xb62a
movb $0x6, %al
callq 0x4260
movsd -0x10(%rbp), %xmm0
movsd %xmm0, 0xa44d(%rip)     # 0x11c98
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0xa448(%rip)     # 0x11ca0
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0xa443(%rip)     # 0x11ca8
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0xa43e(%rip)     # 0x11cb0
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0xa439(%rip)     # 0x11cb8
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0xa434(%rip)     # 0x11cc0
movsd -0x58(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x78d1
jp 0x78d1
movsd 0xa36c(%rip), %xmm0     # 0x11c10
movsd %xmm0, 0xa364(%rip)     # 0x11c10
movsd 0xa36c(%rip), %xmm0     # 0x11c20
movsd %xmm0, 0xa364(%rip)     # 0x11c20
movsd 0xa36c(%rip), %xmm0     # 0x11c30
movsd %xmm0, 0xa364(%rip)     # 0x11c30
jmp 0x797c
movl 0x78e1(%rip), %eax      # 0xf1b8
movsd 0x3939(%rip), %xmm0     # 0xb218
movsd 0x3939(%rip), %xmm1     # 0xb220
movsd %xmm1, -0x88(%rbp)
cmpl $0x2, %eax
movsd %xmm0, -0x80(%rbp)
je 0x7906
movsd -0x88(%rbp), %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x10(%rbp), %xmm1
movsd -0x78(%rbp), %xmm0
movsd -0x60(%rbp), %xmm2
divsd -0x58(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xa2dc(%rip)     # 0x11c10
movsd -0x18(%rbp), %xmm1
movsd -0x78(%rbp), %xmm0
movsd -0x68(%rbp), %xmm2
divsd -0x58(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xa2c8(%rip)     # 0x11c20
movsd -0x20(%rbp), %xmm1
movsd -0x78(%rbp), %xmm0
movsd -0x70(%rbp), %xmm2
divsd -0x58(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xa2b4(%rip)     # 0x11c30
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0xa2b7(%rip)     # 0x11c40
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0xa2ba(%rip)     # 0x11c50
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0xa2bd(%rip)     # 0x11c60
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)