// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Polyline.cpp
// Function: gaps::R3Polyline::SetVertexParameter(int, double)
void R3Polyline::
SetVertexParameter(int k, RNScalar u)
{
  // Check number of points
  if (nvertices == 0) return;
  
  // Allocate vertex parameters
  if (!vertex_parameters) {
    vertex_parameters = new RNScalar [ nvertices ];
    for (int i = 0; i < k; i++) vertex_parameters[i] = (u*i)/k;
    vertex_parameters[k] = u;
    for (int i = k+1; i < nvertices; i++) vertex_parameters[i] = (i-k)+u;
  }
  else {
    // Set vertex parameter
    vertex_parameters[k] = u;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movslq 0x20(%rdi), %r15
testq %r15, %r15
je 0x50df0
movl %esi, %ebx
movq %rdi, %r14
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x50c2f
movslq %ebx, %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x50df0
leaq (,%r15,8), %rax
testl %r15d, %r15d
movq $-0x1, %rdi
cmovnsq %rax, %rdi
movsd %xmm0, 0x8(%rsp)
callq 0xe030
movsd 0x8(%rsp), %xmm9
movq %rax, 0x10(%r14)
testl %ebx, %ebx
jle 0x50d20
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movl %ebx, %edx
leal 0x1(%rbx), %ecx
andl $-0x2, %ecx
decq %rdx
movq %rdx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
movdqa 0x515f9(%rip), %xmm2    # 0xa2280
xorl %edx, %edx
movdqa 0x515ff(%rip), %xmm3    # 0xa2290
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movdqa 0x515ff(%rip), %xmm5    # 0xa22a0
movdqa %xmm2, %xmm6
pxor %xmm3, %xmm6
movdqa %xmm6, %xmm7
pcmpgtd %xmm1, %xmm7
pcmpeqd %xmm1, %xmm6
pshufd $0xf5, %xmm6, %xmm8     # xmm8 = xmm6[1,1,3,3]
pand %xmm7, %xmm8
pshufd $0xf5, %xmm7, %xmm6     # xmm6 = xmm7[1,1,3,3]
por %xmm8, %xmm6
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0x50ceb
xorps %xmm7, %xmm7
cvtsi2sd %edx, %xmm7
mulsd %xmm9, %xmm7
divsd %xmm0, %xmm7
movsd %xmm7, (%rax,%rdx,8)
pxor %xmm4, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0x50d13
leal 0x1(%rdx), %esi
xorps %xmm6, %xmm6
cvtsi2sd %esi, %xmm6
mulsd %xmm9, %xmm6
divsd %xmm0, %xmm6
movsd %xmm6, 0x8(%rax,%rdx,8)
addq $0x2, %rdx
paddq %xmm5, %xmm2
cmpq %rdx, %rcx
jne 0x50ca1
movslq %ebx, %rcx
movsd %xmm9, (%rax,%rcx,8)
leal 0x1(%rbx), %ecx
cmpl %r15d, %ecx
jge 0x50df0
movslq %ecx, %rdx
subl %ebx, %r15d
addl $-0x2, %r15d
leaq 0x2(%r15), %rcx
andq $-0x2, %rcx
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
leaq (%rax,%rdx,8), %rax
addq $0x8, %rax
xorl %edx, %edx
movdqa 0x5151d(%rip), %xmm1    # 0xa2280
movdqa 0x51525(%rip), %xmm2    # 0xa2290
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movq %rdx, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm1, %xmm4
pxor %xmm2, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm0, %xmm5
pcmpeqd %xmm0, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %esi
notl %esi
testb $0x1, %sil
je 0x50dc4
leal 0x1(%rdx), %esi
xorps %xmm5, %xmm5
cvtsi2sd %esi, %xmm5
addsd %xmm9, %xmm5
movsd %xmm5, -0x8(%rax,%rdx,8)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x50de7
leal 0x2(%rdx), %esi
xorps %xmm4, %xmm4
cvtsi2sd %esi, %xmm4
addsd %xmm9, %xmm4
movsd %xmm4, (%rax,%rdx,8)
addq $0x2, %rdx
cmpq %rdx, %rcx
jne 0x50d73
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq