// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rbx
subq $0x48, %rsp
movsd %xmm7, -0x48(%rbp)
movsd %xmm6, -0x40(%rbp)
movsd %xmm5, -0x38(%rbp)
movsd %xmm4, -0x18(%rbp)
movl %esi, %ebx
movsd %xmm3, -0x20(%rbp)
movsd %xmm2, -0x30(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd %xmm0, -0x28(%rbp)
movq 0x7da7(%rip), %rdi      # 0xe2f0
movl 0x6c5d(%rip), %edx      # 0xd1ac
leal 0x1(%rdx), %eax
movl %eax, 0x6c54(%rip)      # 0xd1ac
leaq 0x2cc1(%rip), %rsi      # 0x9220
xorl %eax, %eax
callq 0x4240
callq 0x5504
movq 0x7d7e(%rip), %rdi      # 0xe2f0
leaq 0x2fb4(%rip), %rsi      # 0x952d
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
movsd -0x20(%rbp), %xmm3
movl %ebx, %edx
movsd -0x18(%rbp), %xmm4
movsd -0x38(%rbp), %xmm5
movsd -0x40(%rbp), %xmm6
movsd -0x48(%rbp), %xmm7
movb $0x8, %al
callq 0x4240
movsd -0x28(%rbp), %xmm0
subsd -0x30(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
subsd -0x20(%rbp), %xmm1
callq 0x4080
movsd %xmm0, -0x20(%rbp)
testl %ebx, %ebx
jle 0x65eb
movq 0x7d1d(%rip), %rcx      # 0xe2f0
leaq 0x2f91(%rip), %rdi      # 0x956b
movl $0x14, %esi
movl $0x1, %edx
callq 0x42f0
jmp 0x65f1
js 0x66d2
movq 0x7cf8(%rip), %rdi      # 0xe2f0
movsd 0x95f0(%rip), %xmm0     # 0xfbf0
movsd 0x95f8(%rip), %xmm1     # 0xfc00
movsd 0x9600(%rip), %xmm2     # 0xfc10
leaq 0x2f75(%rip), %rsi      # 0x958c
movb $0x3, %al
callq 0x4240
movl 0x6b90(%rip), %eax      # 0xd1b4
cmpl $0x1, %eax
je 0x6642
cmpl $0x2, %eax
movsd -0x28(%rbp), %xmm2
jne 0x6653
movsd -0x18(%rbp), %xmm0
movaps %xmm2, %xmm1
movsd -0x10(%rbp), %xmm2
jmp 0x665d
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
movsd -0x18(%rbp), %xmm2
jmp 0x665d
movsd -0x10(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
movsd %xmm0, 0x958b(%rip)     # 0xfbf0
movsd %xmm1, 0x9593(%rip)     # 0xfc00
movsd %xmm2, 0x959b(%rip)     # 0xfc10
movq 0x7c74(%rip), %rdi      # 0xe2f0
leaq 0x2f2b(%rip), %rsi      # 0x95ae
movb $0x3, %al
callq 0x4240
movq 0x7c5f(%rip), %rdi      # 0xe2f0
leaq 0x2f36(%rip), %rsi      # 0x95ce
movsd -0x20(%rbp), %xmm0
movb $0x1, %al
callq 0x4240
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x956f(%rip)     # 0xfc20
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x9572(%rip)     # 0xfc30
movsd -0x48(%rbp), %xmm0
movsd %xmm0, 0x9575(%rip)     # 0xfc40
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
movq 0x7c17(%rip), %rcx      # 0xe2f0
leaq 0x2ea0(%rip), %rdi      # 0x9580
movl $0xb, %esi
jmp 0x65df