// File: sundale[P]gcode/rs274ngc/interp_arc.cc
// Function: Interp::arc_data_comp_r(int, int, int, double, double, double, double, double, double, double*, double*, int*, double)
int Interp::arc_data_comp_r(int move,    //!< either G_2 (cw arc) or G_3 (ccw arc)
                            int plane,
                           int side,    //!< either RIGHT or LEFT
                           double tool_radius,  //!< radius of the tool
                           double current_x,    //!< first coordinate of current point
                           double current_y,    //!< second coordinate of current point
                           double end_x,        //!< first coordinate of arc end point
                           double end_y,        //!< second coordinate of arc end point
                           double big_radius,   //!< radius of arc
                           double *center_x,    //!< pointer to first coordinate of center of arc
                           double *center_y,    //!< pointer to second coordinate of center of arc
                           int *turn,           //!< pointer to number of full or partial circles CCW
                           double tolerance)    //!< tolerance of differing radii
{
  double abs_radius;            // absolute value of big_radius

  abs_radius = fabs(big_radius);
  CHKS(((abs_radius <= tool_radius) && (((side == LEFT) && (move == G_3)) ||
                                       ((side == RIGHT) && (move == G_2)))),
      NCE_TOOL_RADIUS_NOT_LESS_THAN_ARC_RADIUS_WITH_COMP);

  return arc_data_r(move, plane, current_x, current_y, end_x, end_y, big_radius, 
             center_x, center_y, turn, tolerance);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x30(%rbp)
movsd %xmm2, -0x38(%rbp)
movsd %xmm3, -0x40(%rbp)
movsd %xmm4, -0x48(%rbp)
movsd %xmm5, -0x50(%rbp)
movq %r8, -0x58(%rbp)
movq %r9, -0x60(%rbp)
movsd %xmm6, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movsd -0x50(%rbp), %xmm0
movaps 0x64485(%rip), %xmm1    # 0x77020
pand %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x70(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x12caa
cmpl $0x2, -0x1c(%rbp)
jne 0x12bc4
cmpl $0x1e, -0x14(%rbp)
je 0x12bd8
cmpl $0x1, -0x1c(%rbp)
jne 0x12caa
cmpl $0x14, -0x14(%rbp)
jne 0x12caa
jmp 0x12bda
leaq 0x64590(%rip), %rdi     # 0x77171
callq 0x10380
movq -0x78(%rbp), %rdi
movq %rax, %rsi
movb $0x0, %al
callq 0x10df0
movq 0x74365(%rip), %rax     # 0x86f60
movl $0x0, 0xd670(%rax)
movq 0x74354(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rax
movq 0x74346(%rip), %rdi     # 0x86f60
addq $0xc6d0, %rdi           # imm = 0xC6D0
imulq $0x50, %rax, %rax
addq %rax, %rdi
leaq 0x64587(%rip), %rsi     # 0x771b6
movl $0x50, %edx
callq 0x10840
movq 0x74320(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x74312(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, 0x4f(%rax)
movq 0x742fa(%rip), %rax     # 0x86f60
movl 0xd670(%rax), %ecx
addl $0x1, %ecx
movq 0x742ea(%rip), %rax     # 0x86f60
movl %ecx, 0xd670(%rax)
movq 0x742dd(%rip), %rax     # 0x86f60
movslq 0xd670(%rax), %rcx
movq 0x742cf(%rip), %rax     # 0x86f60
addq $0xc6d0, %rax           # imm = 0xC6D0
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl $0x5, -0x4(%rbp)
jmp 0x12ce8
jmp 0x12cac
movq -0x78(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movsd -0x30(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movsd -0x40(%rbp), %xmm2
movsd -0x48(%rbp), %xmm3
movsd -0x50(%rbp), %xmm4
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %r8
movq 0x10(%rbp), %r9
movsd -0x68(%rbp), %xmm5
callq 0x11400
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)