// File: sundale[P]gcode/rs274ngc/interp_cycles.cc
// Function: Interp::cycle_feed(block_struct*, int, double, double, double)
int Interp::cycle_feed(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_FEED(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_FEED(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_FEED(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_FEED(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_FEED(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_FEED(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 0x3729d
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
movq 0x4fd18(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4fd0c(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4fd00(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movq 0x4fcf4(%rip), %rax     # 0x86f60
movsd 0x50(%rax), %xmm6
movq 0x4fce8(%rip), %rax     # 0x86f60
movsd 0x68(%rax), %xmm7
movq 0x4fcdc(%rip), %rax     # 0x86f60
movsd 0x80(%rax), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ac0
jmp 0x37510
cmpl $0x2, -0x14(%rbp)
jne 0x37318
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movsd -0x30(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
movsd -0x28(%rbp), %xmm2
movq 0x4fc9d(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4fc91(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4fc85(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movq 0x4fc79(%rip), %rax     # 0x86f60
movsd 0x50(%rax), %xmm6
movq 0x4fc6d(%rip), %rax     # 0x86f60
movsd 0x68(%rax), %xmm7
movq 0x4fc61(%rip), %rax     # 0x86f60
movsd 0x80(%rax), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ac0
jmp 0x3750e
cmpl $0x3, -0x14(%rbp)
jne 0x37393
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movsd -0x28(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x20(%rbp), %xmm2
movq 0x4fc22(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4fc16(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4fc0a(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movq 0x4fbfe(%rip), %rax     # 0x86f60
movsd 0x50(%rax), %xmm6
movq 0x4fbf2(%rip), %rax     # 0x86f60
movsd 0x68(%rax), %xmm7
movq 0x4fbe6(%rip), %rax     # 0x86f60
movsd 0x80(%rax), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ac0
jmp 0x3750c
cmpl $0x4, -0x14(%rbp)
jne 0x37414
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movq 0x4fbb6(%rip), %rax     # 0x86f60
movsd 0x600(%rax), %xmm0
movq 0x4fba7(%rip), %rax     # 0x86f60
movsd 0x608(%rax), %xmm1
movq 0x4fb98(%rip), %rax     # 0x86f60
movsd 0x610(%rax), %xmm2
movq 0x4fb89(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4fb7d(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4fb71(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movsd -0x20(%rbp), %xmm6
movsd -0x28(%rbp), %xmm7
movsd -0x30(%rbp), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ac0
jmp 0x3750a
cmpl $0x5, -0x14(%rbp)
jne 0x37492
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movq 0x4fb35(%rip), %rax     # 0x86f60
movsd 0x600(%rax), %xmm0
movq 0x4fb26(%rip), %rax     # 0x86f60
movsd 0x608(%rax), %xmm1
movq 0x4fb17(%rip), %rax     # 0x86f60
movsd 0x610(%rax), %xmm2
movq 0x4fb08(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4fafc(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4faf0(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movsd -0x30(%rbp), %xmm6
movsd -0x20(%rbp), %xmm7
movsd -0x28(%rbp), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ac0
jmp 0x37508
movq -0x10(%rbp), %rax
movl 0x1d0(%rax), %edi
movq 0x4fabd(%rip), %rax     # 0x86f60
movsd 0x600(%rax), %xmm0
movq 0x4faae(%rip), %rax     # 0x86f60
movsd 0x608(%rax), %xmm1
movq 0x4fa9f(%rip), %rax     # 0x86f60
movsd 0x610(%rax), %xmm2
movq 0x4fa90(%rip), %rax     # 0x86f60
movsd 0x8(%rax), %xmm3
movq 0x4fa84(%rip), %rax     # 0x86f60
movsd 0x20(%rax), %xmm4
movq 0x4fa78(%rip), %rax     # 0x86f60
movsd 0x38(%rax), %xmm5
movsd -0x28(%rbp), %xmm6
movsd -0x30(%rbp), %xmm7
movsd -0x20(%rbp), %xmm8
movsd %xmm8, (%rsp)
callq 0x10ac0
jmp 0x3750a
jmp 0x3750c
jmp 0x3750e
jmp 0x37510
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)