// File: /workspace/github_cpp_makefile_star2_O2/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 0x80a5(%rip), %rdi      # 0xe2f0
movl 0x6f5b(%rip), %edx      # 0xd1ac
leal 0x1(%rdx), %eax
movl %eax, 0x6f52(%rip)      # 0xd1ac
leaq 0x2fb7(%rip), %rsi      # 0x9218
xorl %eax, %eax
callq 0x4240
callq 0x5320
movq 0x807c(%rip), %rdi      # 0xe2f0
leaq 0x32aa(%rip), %rsi      # 0x9525
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 0x62e9
movq 0x801b(%rip), %rcx      # 0xe2f0
leaq 0x3287(%rip), %rdi      # 0x9563
pushq $0x14
popq %rsi
pushq $0x1
popq %rdx
callq 0x42f0
jmp 0x62ef
js 0x63d0
movq 0x7ffa(%rip), %rdi      # 0xe2f0
movsd 0x98f2(%rip), %xmm0     # 0xfbf0
movsd 0x98fa(%rip), %xmm1     # 0xfc00
movsd 0x9902(%rip), %xmm2     # 0xfc10
leaq 0x326f(%rip), %rsi      # 0x9584
movb $0x3, %al
callq 0x4240
movl 0x6e92(%rip), %eax      # 0xd1b4
cmpl $0x1, %eax
je 0x6340
cmpl $0x2, %eax
movsd -0x28(%rbp), %xmm2
jne 0x6351
movsd -0x18(%rbp), %xmm0
movaps %xmm2, %xmm1
movsd -0x10(%rbp), %xmm2
jmp 0x635b
movsd -0x28(%rbp), %xmm0
movsd -0x10(%rbp), %xmm1
movsd -0x18(%rbp), %xmm2
jmp 0x635b
movsd -0x10(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
movsd %xmm0, 0x988d(%rip)     # 0xfbf0
movsd %xmm1, 0x9895(%rip)     # 0xfc00
movsd %xmm2, 0x989d(%rip)     # 0xfc10
movq 0x7f76(%rip), %rdi      # 0xe2f0
leaq 0x3225(%rip), %rsi      # 0x95a6
movb $0x3, %al
callq 0x4240
movq 0x7f61(%rip), %rdi      # 0xe2f0
leaq 0x3230(%rip), %rsi      # 0x95c6
movsd -0x20(%rbp), %xmm0
movb $0x1, %al
callq 0x4240
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x9871(%rip)     # 0xfc20
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x9874(%rip)     # 0xfc30
movsd -0x48(%rbp), %xmm0
movsd %xmm0, 0x9877(%rip)     # 0xfc40
addq $0x48, %rsp
popq %rbx
popq %rbp
retq
movq 0x7f19(%rip), %rcx      # 0xe2f0
leaq 0x319a(%rip), %rdi      # 0x9578
pushq $0xb
jmp 0x62de