// File: sundale[P]gcode/rs274ngc/interp_find.cc
// Function: Interp::find_straight_length(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double)
double Interp::find_straight_length(double x2,   //!< X-coordinate of end point   
                                    double y2,   //!< Y-coordinate of end point   
                                    double z2,   //!< Z-coordinate of end point   
                                    double AA_2, //!< A-coordinate of end point    
                                    double BB_2, //!< B-coordinate of end point    
                                    double CC_2, //!< C-coordinate of end point    
                                    double u_2,
                                    double v_2,
                                    double w_2,
                                    double x1,   //!< X-coordinate of start point 
                                    double y1,   //!< Y-coordinate of start point 
                                    double z1,    //!< Z-coordinate of start point 
                                    double AA_1,        //!< A-coordinate of start point  
                                    double BB_1,        //!< B-coordinate of start point  
                                    double CC_1,        //!< C-coordinate of start point  
                                    double u_1,
                                    double v_1,
                                    double w_1
  )
{
#define tiny 1e-7
    if ( (fabs(x1-x2) > tiny) || (fabs(y1-y2) > tiny) || (fabs(z1-z2) > tiny) )
        return sqrt(pow((x2 - x1), 2) + pow((y2 - y1), 2) + pow((z2 - z1), 2));
    else if ( (fabs(u_1-u_2) > tiny) || (fabs(v_1-v_2) > tiny) || (fabs(w_1-w_2) > tiny) )
        return sqrt(pow((u_2 - u_1), 2) + pow((v_2 - v_1), 2) + pow((w_2 - w_1), 2));
    else
        return sqrt(pow((AA_2 - AA_1), 2) + pow((BB_2 - BB_1), 2) + pow((CC_2 - CC_1), 2));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movsd 0x58(%rbp), %xmm8
movsd 0x50(%rbp), %xmm8
movsd 0x48(%rbp), %xmm8
movsd 0x40(%rbp), %xmm8
movsd 0x38(%rbp), %xmm8
movsd 0x30(%rbp), %xmm8
movsd 0x28(%rbp), %xmm8
movsd 0x20(%rbp), %xmm8
movsd 0x18(%rbp), %xmm8
movsd 0x10(%rbp), %xmm8
movq %rdi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movsd %xmm2, -0x28(%rbp)
movsd %xmm3, -0x30(%rbp)
movsd %xmm4, -0x38(%rbp)
movsd %xmm5, -0x40(%rbp)
movsd %xmm6, -0x48(%rbp)
movsd %xmm7, -0x50(%rbp)
movsd 0x18(%rbp), %xmm0
subsd -0x18(%rbp), %xmm0
movaps 0x1d32c(%rip), %xmm1    # 0x77020
pand %xmm1, %xmm0
movsd 0x22d90(%rip), %xmm1    # 0x7ca90
ucomisd %xmm1, %xmm0
ja 0x59d4c
movsd 0x20(%rbp), %xmm0
subsd -0x20(%rbp), %xmm0
movaps 0x1d309(%rip), %xmm1    # 0x77020
pand %xmm1, %xmm0
movsd 0x22d6d(%rip), %xmm1    # 0x7ca90
ucomisd %xmm1, %xmm0
ja 0x59d4c
movsd 0x28(%rbp), %xmm0
subsd -0x28(%rbp), %xmm0
movaps 0x1d2e6(%rip), %xmm1    # 0x77020
pand %xmm1, %xmm0
movsd 0x22d4a(%rip), %xmm1    # 0x7ca90
ucomisd %xmm1, %xmm0
jbe 0x59db9
movsd -0x18(%rbp), %xmm0
subsd 0x18(%rbp), %xmm0
movl $0x2, %edi
callq 0x112e0
movsd %xmm0, -0x60(%rbp)
movsd -0x20(%rbp), %xmm0
subsd 0x20(%rbp), %xmm0
movl $0x2, %edi
callq 0x112e0
movaps %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movsd -0x28(%rbp), %xmm0
subsd 0x28(%rbp), %xmm0
movl $0x2, %edi
callq 0x112e0
movaps %xmm0, %xmm1
movsd -0x58(%rbp), %xmm0
addsd %xmm1, %xmm0
callq 0x10d70
movsd %xmm0, -0x8(%rbp)
jmp 0x59ef4
movsd 0x48(%rbp), %xmm0
subsd -0x48(%rbp), %xmm0
movaps 0x1d256(%rip), %xmm1    # 0x77020
pand %xmm1, %xmm0
movsd 0x22cba(%rip), %xmm1    # 0x7ca90
ucomisd %xmm1, %xmm0
ja 0x59e22
movsd 0x50(%rbp), %xmm0
subsd -0x50(%rbp), %xmm0
movaps 0x1d233(%rip), %xmm1    # 0x77020
pand %xmm1, %xmm0
movsd 0x22c97(%rip), %xmm1    # 0x7ca90
ucomisd %xmm1, %xmm0
ja 0x59e22
movsd 0x58(%rbp), %xmm0
subsd 0x10(%rbp), %xmm0
movaps 0x1d210(%rip), %xmm1    # 0x77020
pand %xmm1, %xmm0
movsd 0x22c74(%rip), %xmm1    # 0x7ca90
ucomisd %xmm1, %xmm0
jbe 0x59e8c
movsd -0x48(%rbp), %xmm0
subsd 0x48(%rbp), %xmm0
movl $0x2, %edi
callq 0x112e0
movsd %xmm0, -0x70(%rbp)
movsd -0x50(%rbp), %xmm0
subsd 0x50(%rbp), %xmm0
movl $0x2, %edi
callq 0x112e0
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movsd 0x10(%rbp), %xmm0
subsd 0x58(%rbp), %xmm0
movl $0x2, %edi
callq 0x112e0
movaps %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
addsd %xmm1, %xmm0
callq 0x10d70
movsd %xmm0, -0x8(%rbp)
jmp 0x59ef4
movsd -0x30(%rbp), %xmm0
subsd 0x30(%rbp), %xmm0
movl $0x2, %edi
callq 0x112e0
movsd %xmm0, -0x80(%rbp)
movsd -0x38(%rbp), %xmm0
subsd 0x38(%rbp), %xmm0
movl $0x2, %edi
callq 0x112e0
movaps %xmm0, %xmm1
movsd -0x80(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x40(%rbp), %xmm0
subsd 0x40(%rbp), %xmm0
movl $0x2, %edi
callq 0x112e0
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
addsd %xmm1, %xmm0
callq 0x10d70
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)