// File: /workspace/github_cpp_makefile_star2_O2/sundale[P]gcode/rs274ngc/nurbs_additional_functions.cc
// Function: nurbs_point(double, unsigned int, std::vector<CONTROL_POINT, std::allocator<CONTROL_POINT>>, std::vector<unsigned int, std::allocator<unsigned int>>)
PLANE_POINT nurbs_point(double u, unsigned int k, 
                  std::vector<CONTROL_POINT> nurbs_control_points,
                  std::vector<unsigned int> knot_vector) {

    unsigned int i;
    PLANE_POINT point;
    point.X = 0;
    point.Y = 0;
    for (i=0; i<(nurbs_control_points.size()); i++) {
        point.X = point.X + nurbs_control_points[i].X*Nmix(i,k,u,knot_vector)
	*nurbs_control_points[i].W/Rden(u,k,nurbs_control_points,knot_vector);
        point.Y = point.Y + nurbs_control_points[i].Y*Nmix(i,k,u,knot_vector)
	*nurbs_control_points[i].W/Rden(u,k,nurbs_control_points,knot_vector);
    }
    return point;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdx, -0x40(%rbp)
movl %edi, %r13d
movsd %xmm0, -0x38(%rbp)
xorl %r12d, %r12d
xorpd %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
leaq -0xc0(%rbp), %rax
movq %rax, -0x48(%rbp)
movsd %xmm0, -0x50(%rbp)
movq %rsi, -0x60(%rbp)
movl %edi, -0x2c(%rbp)
movl %r12d, %r12d
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
subq %rcx, %rax
cqto
pushq $0x18
popq %rdi
idivq %rdi
cmpq %r12, %rax
jbe 0x2aea1
imulq $0x18, %r12, %rbx
movsd (%rcx,%rbx), %xmm0
movsd %xmm0, -0x70(%rbp)
leaq -0xc0(%rbp), %r15
movq %r15, %rdi
movq -0x40(%rbp), %rsi
callq 0xb270
movl %r12d, %edi
movl %r13d, %esi
leaq -0xa8(%rbp), %r13
movsd -0x38(%rbp), %xmm0
movq %r15, %rdx
callq 0xc760
movsd -0x70(%rbp), %xmm1
mulsd %xmm0, %xmm1
movq -0x60(%rbp), %rsi
movq (%rsi), %rax
mulsd 0x10(%rax,%rbx), %xmm1
movsd %xmm1, -0x70(%rbp)
movq %r13, %rdi
callq 0xb620
leaq -0x108(%rbp), %r14
movq %r14, %rdi
movq -0x40(%rbp), %rsi
callq 0xb270
movsd -0x38(%rbp), %xmm0
movl -0x2c(%rbp), %r13d
movl %r13d, %edi
leaq -0xa8(%rbp), %r15
movq %r15, %rsi
movq %r14, %rdx
callq 0xba70
movsd %xmm0, -0x78(%rbp)
movq %r14, %rdi
callq 0xb560
movq %r15, %rdi
callq 0xb180
leaq -0xc0(%rbp), %rdi
callq 0xb560
movq -0x60(%rbp), %r15
movq (%r15), %rax
movsd 0x8(%rax,%rbx), %xmm0
movsd %xmm0, -0x68(%rbp)
leaq -0x90(%rbp), %r14
movq %r14, %rdi
movq -0x40(%rbp), %rsi
callq 0xb270
movl %r12d, %edi
movl %r13d, %esi
movsd -0x38(%rbp), %xmm0
movq %r14, %rdx
callq 0xc760
leaq -0xf0(%rbp), %r14
movsd -0x68(%rbp), %xmm1
mulsd %xmm0, %xmm1
movq (%r15), %rax
mulsd 0x10(%rax,%rbx), %xmm1
movsd %xmm1, -0x68(%rbp)
movq %r14, %rdi
movq %r15, %rsi
callq 0xb620
leaq -0xd8(%rbp), %r15
movq %r15, %rdi
movq -0x40(%rbp), %rsi
callq 0xb270
movsd -0x38(%rbp), %xmm0
movl -0x2c(%rbp), %r13d
movl %r13d, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0xba70
movsd -0x70(%rbp), %xmm2
divsd -0x78(%rbp), %xmm2
movsd -0x58(%rbp), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, -0x58(%rbp)
movsd -0x68(%rbp), %xmm1
divsd %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
movq %r15, %rdi
callq 0xb560
movq %r14, %rdi
callq 0xb180
leaq -0x90(%rbp), %rdi
callq 0xb560
incl %r12d
movq -0x60(%rbp), %rsi
jmp 0x2acf1
movsd -0x58(%rbp), %xmm0
movsd -0x50(%rbp), %xmm1
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x2aef3
movq %rax, %r14
leaq -0xd8(%rbp), %rdi
callq 0xb560
jmp 0x2aed6
movq %rax, %r14
leaq -0xf0(%rbp), %rdi
callq 0xb180
jmp 0x2af04
movq %rax, %r14
leaq -0x108(%rbp), %rdi
callq 0xb560
leaq -0xa8(%rbp), %rdi
callq 0xb180
jmp 0x2af14
movq %rax, %r14
leaq -0x90(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x2af14
movq %rax, %r14
movq -0x48(%rbp), %rdi
callq 0xb560
movq %r14, %rdi
callq 0xc520