// File: sundale[P]gcode/rs274ngc/interp_cycles.cc
// Function: Interp::cycle_traverse(block_struct*, int, double, double, double)
int Interp::cycle_traverse(block_pointer block,
                           CANON_PLANE plane,    //!< currently selected plane 
                           double end1,  //!< first coordinate value   
                           double end2,  //!< second coordinate value  
                           double end3)  //!< third coordinate value   
{

    if (plane == CANON_PLANE_XY)
        STRAIGHT_TRAVERSE(block->line_number, end1, end2, end3,
                          _setup.AA_current, _setup.BB_current, _setup.CC_current,
                          _setup.u_current, _setup.v_current, _setup.w_current);
    else if (plane == CANON_PLANE_YZ)
        STRAIGHT_TRAVERSE(block->line_number, end3, end1, end2,
                          _setup.AA_current, _setup.BB_current, _setup.CC_current,
                          _setup.u_current, _setup.v_current, _setup.w_current);
    else if (plane == CANON_PLANE_XZ)
        STRAIGHT_TRAVERSE(block->line_number, end2, end3, end1,
                          _setup.AA_current, _setup.BB_current, _setup.CC_current,
                          _setup.u_current, _setup.v_current, _setup.w_current);
    else if (plane == CANON_PLANE_UV)
        STRAIGHT_TRAVERSE(block->line_number, _setup.current_x, _setup.current_y, _setup.current_z,
                          _setup.AA_current, _setup.BB_current, _setup.CC_current,
                          end1, end2, end3);
    else if (plane == CANON_PLANE_VW)
        STRAIGHT_TRAVERSE(block->line_number, _setup.current_x, _setup.current_y, _setup.current_z,
                          _setup.AA_current, _setup.BB_current, _setup.CC_current,
                          end3, end1, end2);
    else // (plane == CANON_PLANE_UW)
        STRAIGHT_TRAVERSE(block->line_number, _setup.current_x, _setup.current_y, _setup.current_z,
                          _setup.AA_current, _setup.BB_current, _setup.CC_current,
                          end2, end3, end1);
    return INTERP_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movsd %xmm0, -0x20(%rbp)
movsd %xmm1, -0x28(%rbp)
movsd %xmm2, -0x30(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0x375bd
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
movq 0x4f9f8(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4f9ec(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4f9e0(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movq 0x4f9d4(%rip), %rax     # 0x86f60
movsd 0x50(%rax), %xmm6
movq 0x4f9c8(%rip), %rax     # 0x86f60
movsd 0x68(%rax), %xmm7
movq 0x4f9bc(%rip), %rax     # 0x86f60
movsd 0x80(%rax), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ef0
jmp 0x37830
cmpl $0x2, -0x14(%rbp)
jne 0x37638
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movsd -0x30(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
movsd -0x28(%rbp), %xmm2
movq 0x4f97d(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4f971(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4f965(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movq 0x4f959(%rip), %rax     # 0x86f60
movsd 0x50(%rax), %xmm6
movq 0x4f94d(%rip), %rax     # 0x86f60
movsd 0x68(%rax), %xmm7
movq 0x4f941(%rip), %rax     # 0x86f60
movsd 0x80(%rax), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ef0
jmp 0x3782e
cmpl $0x3, -0x14(%rbp)
jne 0x376b3
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x20(%rbp), %xmm2
movq 0x4f902(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4f8f6(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4f8ea(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movq 0x4f8de(%rip), %rax     # 0x86f60
movsd 0x50(%rax), %xmm6
movq 0x4f8d2(%rip), %rax     # 0x86f60
movsd 0x68(%rax), %xmm7
movq 0x4f8c6(%rip), %rax     # 0x86f60
movsd 0x80(%rax), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ef0
jmp 0x3782c
cmpl $0x4, -0x14(%rbp)
jne 0x37734
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movq 0x4f896(%rip), %rax     # 0x86f60
movsd 0x600(%rax), %xmm0
movq 0x4f887(%rip), %rax     # 0x86f60
movsd 0x608(%rax), %xmm1
movq 0x4f878(%rip), %rax     # 0x86f60
movsd 0x610(%rax), %xmm2
movq 0x4f869(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4f85d(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4f851(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movsd -0x20(%rbp), %xmm6
movsd -0x28(%rbp), %xmm7
movsd -0x30(%rbp), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ef0
jmp 0x3782a
cmpl $0x5, -0x14(%rbp)
jne 0x377b2
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movq 0x4f815(%rip), %rax     # 0x86f60
movsd 0x600(%rax), %xmm0
movq 0x4f806(%rip), %rax     # 0x86f60
movsd 0x608(%rax), %xmm1
movq 0x4f7f7(%rip), %rax     # 0x86f60
movsd 0x610(%rax), %xmm2
movq 0x4f7e8(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4f7dc(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4f7d0(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movsd -0x30(%rbp), %xmm6
movsd -0x20(%rbp), %xmm7
movsd -0x28(%rbp), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ef0
jmp 0x37828
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movq 0x4f79d(%rip), %rax     # 0x86f60
movsd 0x600(%rax), %xmm0
movq 0x4f78e(%rip), %rax     # 0x86f60
movsd 0x608(%rax), %xmm1
movq 0x4f77f(%rip), %rax     # 0x86f60
movsd 0x610(%rax), %xmm2
movq 0x4f770(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4f764(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4f758(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movsd -0x28(%rbp), %xmm6
movsd -0x30(%rbp), %xmm7
movsd -0x20(%rbp), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ef0
jmp 0x3782a
jmp 0x3782c
jmp 0x3782e
jmp 0x37830
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)