// File: /workspace/github_cpp_makefile_star2_O3/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 $0xd8, %rsp
movl %edi, -0x2c(%rbp)
movsd %xmm0, -0x48(%rbp)
movq (%rsi), %rax
cmpq %rax, 0x8(%rsi)
je 0x2dd5b
movq %rdx, %rbx
movq %rsi, %r14
xorpd %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
xorl %r12d, %r12d
movsd %xmm0, -0x38(%rbp)
leaq (%r12,%r12,2), %r13
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, -0x58(%rbp)
movq %rbx, %rsi
leaq -0xa0(%rbp), %rdi
movl -0x2c(%rbp), %r15d
callq 0xa240
movq %r12, -0x60(%rbp)
movl %r12d, %edi
movl %r15d, %r12d
movl %r15d, %esi
movsd -0x48(%rbp), %xmm0
leaq -0xa0(%rbp), %rdx
callq 0xb5f0
movsd -0x58(%rbp), %xmm1
mulsd %xmm0, %xmm1
movq (%r14), %rax
mulsd 0x10(%rax,%r13,8), %xmm1
movsd %xmm1, -0x58(%rbp)
leaq -0x88(%rbp), %rdi
movq %r14, %rsi
callq 0xa5e0
leaq -0x100(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xa240
movsd -0x48(%rbp), %xmm0
movl %r12d, %edi
leaq -0x88(%rbp), %rsi
movq %r15, %rdx
callq 0xa9c0
movsd %xmm0, -0x70(%rbp)
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x2dbf0
movq -0xf0(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x2dc08
movq -0x78(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
je 0x2dc23
movq -0x90(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
movq (%r14), %rax
movsd 0x8(%rax,%r13,8), %xmm0
movsd %xmm0, -0x50(%rbp)
leaq -0xe8(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xa240
movq -0x60(%rbp), %rdi
movl -0x2c(%rbp), %esi
movsd -0x48(%rbp), %xmm0
movq %r15, %rdx
callq 0xb5f0
leaq -0xd0(%rbp), %r15
movsd -0x50(%rbp), %xmm1
mulsd %xmm0, %xmm1
movq (%r14), %rax
mulsd 0x10(%rax,%r13,8), %xmm1
movsd %xmm1, -0x50(%rbp)
movq %r15, %rdi
movq %r14, %rsi
callq 0xa5e0
leaq -0xb8(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0xa240
movsd -0x48(%rbp), %xmm0
movl -0x2c(%rbp), %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0xa9c0
movsd %xmm0, -0x68(%rbp)
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x2dcc7
movq -0xa8(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x2dce2
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
movq -0xe8(%rbp), %rdi
testq %rdi, %rdi
je 0x2dcfd
movq -0xd8(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
movsd -0x58(%rbp), %xmm1
divsd -0x70(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x50(%rbp), %xmm1
divsd -0x68(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x60(%rbp), %r12
incl %r12d
movq (%r14), %rax
movq 0x8(%r14), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %r12, %rcx
ja 0x2db40
jmp 0x2dd69
xorpd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movsd %xmm0, -0x40(%rbp)
movsd -0x38(%rbp), %xmm0
movsd -0x40(%rbp), %xmm1
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2dda8
movq %rax, %rbx
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x2dda8
movq -0xf0(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
movq -0x88(%rbp), %rdi
testq %rdi, %rdi
je 0x2de05
movq -0x78(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
jmp 0x2de05
movq %rax, %rbx
jmp 0x2dde5
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
testq %rdi, %rdi
je 0x2dde5
movq -0xa8(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
movq -0xd0(%rbp), %rdi
testq %rdi, %rdi
je 0x2de1d
movq -0xc0(%rbp), %rsi
subq %rdi, %rsi
callq 0xaae0
jmp 0x2de1d
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
testq %rdi, %rdi
leaq -0x90(%rbp), %rax
jne 0x2de30
jmp 0x2de3b
movq %rax, %rbx
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
testq %rdi, %rdi
je 0x2de3b
movq (%rax), %rsi
subq %rdi, %rsi
callq 0xaae0
movq %rbx, %rdi
callq 0xb3b0