// File: sundale[P]gcode/saicanon.cc
// Function: ARC_FEED(int, double, double, double, double, int, double, double, double, double, double, double, double)
void ARC_FEED(int line_number,
 double first_end, double second_end,
 double first_axis, double second_axis, int rotation, double axis_end_point
 , double a /*AA*/
 , double b /*BB*/
 , double c /*CC*/
 , double u, double v, double w
)
{
	double radius = 0.0f;

  fprintf(_outfile, "%5d ", _line_number++);
  print_nc_line_number();
  fprintf(_outfile, "ARC_FEED(%.4f, %.4f, %.4f, %.4f, %d, %.4f"
         ", %.4f" /*AA*/
         ", %.4f" /*BB*/
         ", %.4f" /*CC*/
         ")\n", first_end, second_end, first_axis, second_axis,
         rotation, axis_end_point
         , a /*AA*/
         , b /*BB*/
         , c /*CC*/
         );
	radius = hypot(first_end - first_axis, second_end - second_axis);
	if(rotation > 0)
	{
		fprintf(_outfile, "\t\tcounter clockwise\n");
	}
	else if(rotation < 0)
	{
		fprintf(_outfile, "\t\clockwise\n");
	}
	else if(rotation == 0)
	{
		
	}
	fprintf(_outfile, "\t\tstart (x=%.4f, y=%.4f, z=%.4f)\n", _program_position_x, _program_position_y, _program_position_z);
  if (_active_plane == CANON_PLANE_XY)
    {
      _program_position_x = first_end;
      _program_position_y = second_end;
      _program_position_z = axis_end_point;
    }
  else if (_active_plane == CANON_PLANE_YZ)
    {
      _program_position_x = axis_end_point;
      _program_position_y = first_end;
      _program_position_z = second_end;
    }
  else /* if (_active_plane == CANON_PLANE_XZ) */
    {
      _program_position_x = second_end;
      _program_position_y = axis_end_point;
      _program_position_z = first_end;
    }
  fprintf(_outfile, "\t\tend (x=%.4f, y=%.4f, z=%.4f)\n", _program_position_x, _program_position_y, _program_position_z);
  fprintf(_outfile, "\t\tradius (%.4f)\n", radius);
  _program_position_a = a; /*AA*/
  _program_position_b = b; /*BB*/
  _program_position_c = c; /*CC*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movsd 0x20(%rbp), %xmm8
movsd 0x18(%rbp), %xmm8
movsd 0x10(%rbp), %xmm8
movl %edi, -0x4(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x20(%rbp)
movsd %xmm3, -0x28(%rbp)
movl %esi, -0x2c(%rbp)
movsd %xmm4, -0x38(%rbp)
movsd %xmm5, -0x40(%rbp)
movsd %xmm6, -0x48(%rbp)
movsd %xmm7, -0x50(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movq 0x8f29(%rip), %rdi      # 0x10310
movl 0x7dc7(%rip), %edx      # 0xf1b4
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x7dbc(%rip)      # 0xf1b4
leaq 0x3e39(%rip), %rsi      # 0xb238
movb $0x0, %al
callq 0x4260
callq 0x60d0
movq 0x8efe(%rip), %rdi      # 0x10310
movsd -0x10(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
movsd -0x20(%rbp), %xmm2
movsd -0x28(%rbp), %xmm3
movl -0x2c(%rbp), %edx
movsd -0x38(%rbp), %xmm4
movsd -0x40(%rbp), %xmm5
movsd -0x48(%rbp), %xmm6
movsd -0x50(%rbp), %xmm7
leaq 0x4101(%rip), %rsi      # 0xb545
movb $0x8, %al
callq 0x4260
movsd -0x10(%rbp), %xmm0
subsd -0x20(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
subsd -0x28(%rbp), %xmm1
callq 0x4080
movsd %xmm0, -0x58(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x7486
movq 0x8e9a(%rip), %rdi      # 0x10310
leaq 0x4106(%rip), %rsi      # 0xb583
movb $0x0, %al
callq 0x4260
jmp 0x74af
cmpl $0x0, -0x2c(%rbp)
jge 0x74a3
movq 0x8e7d(%rip), %rdi      # 0x10310
leaq 0x40fe(%rip), %rsi      # 0xb598
movb $0x0, %al
callq 0x4260
jmp 0x74ad
cmpl $0x0, -0x2c(%rbp)
jne 0x74ab
jmp 0x74ab
jmp 0x74ad
jmp 0x74af
movq 0x8e5a(%rip), %rdi      # 0x10310
movsd 0xa752(%rip), %xmm0     # 0x11c10
movsd 0xa75a(%rip), %xmm1     # 0x11c20
movsd 0xa762(%rip), %xmm2     # 0x11c30
leaq 0x40cf(%rip), %rsi      # 0xb5a4
movb $0x3, %al
callq 0x4260
cmpl $0x1, 0x7ce9(%rip)      # 0xf1cc
jne 0x750e
movsd -0x10(%rbp), %xmm0
movsd %xmm0, 0xa71e(%rip)     # 0x11c10
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0xa721(%rip)     # 0x11c20
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0xa724(%rip)     # 0x11c30
jmp 0x7569
cmpl $0x2, 0x7cb7(%rip)      # 0xf1cc
jne 0x7540
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0xa6ec(%rip)     # 0x11c10
movsd -0x10(%rbp), %xmm0
movsd %xmm0, 0xa6ef(%rip)     # 0x11c20
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0xa6f2(%rip)     # 0x11c30
jmp 0x7567
movsd -0x18(%rbp), %xmm0
movsd %xmm0, 0xa6c3(%rip)     # 0x11c10
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0xa6c6(%rip)     # 0x11c20
movsd -0x10(%rbp), %xmm0
movsd %xmm0, 0xa6c9(%rip)     # 0x11c30
jmp 0x7569
movq 0x8da0(%rip), %rdi      # 0x10310
movsd 0xa698(%rip), %xmm0     # 0x11c10
movsd 0xa6a0(%rip), %xmm1     # 0x11c20
movsd 0xa6a8(%rip), %xmm2     # 0x11c30
leaq 0x4037(%rip), %rsi      # 0xb5c6
movb $0x3, %al
callq 0x4260
movq 0x8d73(%rip), %rdi      # 0x10310
movsd -0x58(%rbp), %xmm0
leaq 0x403d(%rip), %rsi      # 0xb5e6
movb $0x1, %al
callq 0x4260
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0xa683(%rip)     # 0x11c40
movsd -0x48(%rbp), %xmm0
movsd %xmm0, 0xa686(%rip)     # 0x11c50
movsd -0x50(%rbp), %xmm0
movsd %xmm0, 0xa689(%rip)     # 0x11c60
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)