#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ findNURBSbasisFunIso4xScCP(int, int, double, double, int,
                                              double *, double, double, int,
                                              int, double *, int, int, double *,
                                              double *, double *, double *,
                                              double *, double *, double *,
                                              double *, double *, double *);
void NURBSsurfaceBasisX16ScMax(int degU, int degV, double *cp, int ncp, int kcp,
                               double *knotU, double *knotV, double *us,
                               double *usX1max, double *basisVals,
                               double *leftU, double *rightU, double *NU,
                               double *leftV, double *rightV, double *NV) {
  int i, j, ii, jj, nus, orderU, orderV;
  double uv[2], stepU, stepV, uScale, vScale, uScale2, vScale2;
  orderU = degU + 1;
  orderV = degV + 1;
  nus = 0;
  for (ii = 0; ii <= (kcp - 2); ii++) {
    stepV = 0.1 * (knotV[ii + 1 + orderV] - knotV[ii]);
    for (jj = 0; jj <= (ncp - 2); jj++) {
      stepU = 0.1 * (knotU[jj + 1 + orderU] - knotU[jj]);
      vScale = 0.125;
      for (i = 0; i < 4; i++) {
        vScale2 = 1.0 - vScale;
        uScale = 0.125;
        for (j = 0; j < 4; j++) {
          uScale2 = 1.0 - uScale;
          uv[0] = vScale2 * (uScale2 * usX1max[2 * (ii * ncp + jj)] +
                             uScale * usX1max[2 * (ii * ncp + jj + 1)]) +
                  vScale * (uScale2 * usX1max[2 * ((ii + 1) * ncp + jj)] +
                            uScale * usX1max[2 * ((ii + 1) * ncp + jj + 1)]);
          uv[1] =
              vScale2 * (uScale2 * usX1max[2 * (ii * ncp + jj) + 1] +
                         uScale * usX1max[2 * (ii * ncp + jj + 1) + 1]) +
              vScale * (uScale2 * usX1max[2 * ((ii + 1) * ncp + jj) + 1] +
                        uScale * usX1max[2 * ((ii + 1) * ncp + jj + 1) + 1]);
          findNURBSbasisFunIso4xScCP(ii, jj, vScale2, uScale2, 12, uv, stepU,
                                     stepV, degU, degV, cp, ncp, kcp, knotU,
                                     knotV, usX1max, basisVals, leftU, rightU,
                                     NU, leftV, rightV, NV);
          us[2 * nus] = uv[0];
          us[2 * nus + 1] = uv[1];
          nus++;
          uScale += 0.25;
        }
        vScale += 0.25;
      }
    }
  }
}


x86 assembly (clang, -O0):
<NURBSsurfaceBasisX16ScMax>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x2c(%rbp)
mov    %esi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
mov    %ecx,-0x3c(%rbp)
mov    %r8d,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     15b0 <NURBSsurfaceBasisX16ScMax+0x4a0>
mov    0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
add    -0x64(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x10(%rbp),%rax
movslq -0x54(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xe44(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    -0x3c(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     159d <NURBSsurfaceBasisX16ScMax+0x48d>
mov    -0x48(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x1,%ecx
add    -0x60(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x48(%rbp),%rax
movslq -0x58(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xdf6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xdea(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0x0,-0x4c(%rbp)
cmpl   $0x4,-0x4c(%rbp)
jge    158a <NURBSsurfaceBasisX16ScMax+0x47a>
movsd  0xdd1(%rip),%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xdb1(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movl   $0x0,-0x50(%rbp)
cmpl   $0x4,-0x50(%rbp)
jge    1564 <NURBSsurfaceBasisX16ScMax+0x454>
movsd  0xd98(%rip),%xmm0
subsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x58(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0x98(%rbp),%xmm1
ff
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x58(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm3
ff
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
imul   -0x3c(%rbp),%ecx
add    -0x58(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm5
movsd  -0x98(%rbp),%xmm4
ff
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
imul   -0x3c(%rbp),%ecx
add    -0x58(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm2
ff
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x58(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0x98(%rbp),%xmm1
ff
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x58(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm3
ff
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
imul   -0x3c(%rbp),%ecx
add    -0x58(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm5
movsd  -0x98(%rbp),%xmm4
ff
mov    0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
imul   -0x3c(%rbp),%ecx
add    -0x58(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x54(%rbp),%edi
mov    -0x58(%rbp),%esi
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0xa8(%rbp),%xmm1
ff
lea    -0x80(%rbp),%rcx
movsd  -0x88(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm3
ff
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0x38(%rbp),%rax
mov    -0x3c(%rbp),%edx
mov    %edx,-0xd0(%rbp)
mov    -0x40(%rbp),%edx
mov    %edx,-0xcc(%rbp)
mov    -0x48(%rbp),%rdx
mov    %rdx,-0xc8(%rbp)
mov    0x10(%rbp),%rdx
mov    %rdx,-0xc0(%rbp)
mov    0x20(%rbp),%r13
mov    0x28(%rbp),%r12
mov    0x30(%rbp),%r15
mov    0x38(%rbp),%r14
mov    0x40(%rbp),%rbx
mov    0x48(%rbp),%r11
mov    0x50(%rbp),%r10
mov    0x58(%rbp),%rdx
mov    %rdx,-0xb8(%rbp)
mov    $0xc,%edx
mov    %rax,(%rsp)
mov    -0xd0(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0xcc(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0xc8(%rbp),%rax
mov    %rax,0x18(%rsp)
mov    -0xc0(%rbp),%rax
mov    %rax,0x20(%rsp)
mov    -0xb8(%rbp),%rax
mov    %r13,0x28(%rsp)
mov    %r12,0x30(%rsp)
mov    %r15,0x38(%rsp)
mov    %r14,0x40(%rsp)
mov    %rbx,0x48(%rsp)
mov    %r11,0x50(%rsp)
mov    %r10,0x58(%rsp)
mov    %rax,0x60(%rsp)
call   1030 <findNURBSbasisFunIso4xScCP@plt>
movsd  -0x80(%rbp),%xmm0
mov    0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x78(%rbp),%xmm0
mov    0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
movsd  0xad2(%rip),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1266 <NURBSsurfaceBasisX16ScMax+0x156>
movsd  0xaac(%rip),%xmm0
addsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    122d <NURBSsurfaceBasisX16ScMax+0x11d>
jmp    158f <NURBSsurfaceBasisX16ScMax+0x47f>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    11cf <NURBSsurfaceBasisX16ScMax+0xbf>
jmp    15a2 <NURBSsurfaceBasisX16ScMax+0x492>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1181 <NURBSsurfaceBasisX16ScMax+0x71>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<NURBSsurfaceBasisX16ScMax>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
cmp    $0x2,%r8d
jge    1139 <NURBSsurfaceBasisX16ScMax+0x29>
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r9,%rbx
mov    %r8d,%ebp
mov    %ecx,%r10d
mov    %rdx,%r11
mov    0x1a8(%rsp),%r12
mov    0x1a0(%rsp),%r14
mov    0x198(%rsp),%r13
lea    0x1(%rsi),%edx
lea    0x1(%rdi),%ecx
movslq %ecx,%rcx
mov    %rcx,0x38(%rsp)
lea    -0x1(%r10),%ecx
mov    %rcx,0x30(%rsp)
movslq %edx,%r9
lea    -0x1(%rbp),%eax
xor    %r8d,%r8d
movsd  0xe8b(%rip),%xmm1
xor    %r15d,%r15d
mov    %rdi,0x68(%rsp)
mov    %rsi,0x60(%rsp)
mov    %r9,0x20(%rsp)
mov    %rax,0x8(%rsp)
jmp    11ce <NURBSsurfaceBasisX16ScMax+0xbe>
xchg   %ax,%ax
mov    0x8(%rsp),%rax
cmp    %rax,%r8
jne    11ce <NURBSsurfaceBasisX16ScMax+0xbe>
jmp    1127 <NURBSsurfaceBasisX16ScMax+0x17>
nop
sub    (%rsp),%ecx
mov    %ecx,%r15d
mov    0x20(%rsp),%r9
mov    0x8(%rsp),%rax
mov    0x28(%rsp),%r8
cmp    %rax,%r8
je     1127 <NURBSsurfaceBasisX16ScMax+0x17>
mov    %r8,%rdx
add    $0x1,%r8
lea    0x1(%rdx,%r9,1),%rcx
mov    0x160(%rsp),%rax
movsd  (%rax,%rcx,8),%xmm3
subsd  (%rax,%rdx,8),%xmm3
mulsd  0xe0c(%rip),%xmm3
cmp    $0x2,%r10d
jl     11a0 <NURBSsurfaceBasisX16ScMax+0x90>
mov    %rdx,0x78(%rsp)
imul   %r10d,%edx
mov    %rdx,0x48(%rsp)
mov    %r8,0x28(%rsp)
imul   %r10d,%r8d
mov    %r8,0x40(%rsp)
xor    %r9d,%r9d
movsd  %xmm3,0x70(%rsp)
nop
lea    0x1(%r9),%rcx
mov    %rcx,0x50(%rsp)
mov    0x38(%rsp),%rcx
add    %r9,%rcx
add    $0x1,%rcx
movsd  (%rbx,%rcx,8),%xmm6
subsd  (%rbx,%r9,8),%xmm6
mulsd  0xdb8(%rip),%xmm6
mov    0x48(%rsp),%rcx
lea    (%rcx,%r9,1),%r8d
lea    (%r8,%r8,1),%edx
movslq %edx,%rcx
mov    %rcx,0xb8(%rsp)
lea    0x2(%r8,%r8,1),%edx
movslq %edx,%rcx
mov    %rcx,0xb0(%rsp)
mov    0x40(%rsp),%rcx
lea    (%rcx,%r9,1),%eax
lea    (%rax,%rax,1),%ecx
movslq %ecx,%rcx
mov    %rcx,0xa8(%rsp)
lea    0x2(%rax,%rax,1),%ecx
movslq %ecx,%rcx
mov    %rcx,0xa0(%rsp)
lea    0x1(%r8,%r8,1),%ecx
movslq %ecx,%rcx
mov    %rcx,0x98(%rsp)
lea    0x3(%r8,%r8,1),%ecx
movslq %ecx,%rdx
lea    0x1(%rax,%rax,1),%ecx
movslq %ecx,%r8
lea    (%rax,%rax,1),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %rcx,0x80(%rsp)
xor    %eax,%eax
movsd  0xd38(%rip),%xmm0
mov    %r9,0xc8(%rsp)
movsd  %xmm6,0xc0(%rsp)
mov    %rdx,0x90(%rsp)
mov    %r8,0x88(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,0x4(%rsp)
mov    %r15d,%eax
subsd  %xmm0,%xmm1
movapd %xmm1,0x110(%rsp)
unpcklpd %xmm1,%xmm1
movapd %xmm1,0x100(%rsp)
movapd %xmm0,0xe0(%rsp)
unpcklpd %xmm0,%xmm0
movapd %xmm0,0xf0(%rsp)
mov    %rax,0x58(%rsp)
lea    (%rax,%rax,1),%r15d
movl   $0x0,(%rsp)
movsd  0xcb9(%rip),%xmm0
nop
movapd %xmm0,0xd0(%rsp)
movsd  0xcaf(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd 0xd0(%rsp),%xmm0
unpcklpd %xmm0,%xmm0
mov    0x170(%rsp),%rax
mov    0xb0(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movhpd (%rax,%rdx,8),%xmm2
mulpd  %xmm0,%xmm2
movapd %xmm1,%xmm5
mov    0xb8(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    0x98(%rsp),%rcx
movhpd (%rax,%rcx,8),%xmm4
unpcklpd %xmm1,%xmm5
mulpd  %xmm5,%xmm4
addpd  %xmm2,%xmm4
mulpd  0x100(%rsp),%xmm4
mov    0xa0(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    0x80(%rsp),%rcx
movhpd (%rax,%rcx,8),%xmm2
mulpd  %xmm0,%xmm2
mov    0xa8(%rsp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movhpd (%rax,%r8,8),%xmm0
mulpd  %xmm5,%xmm0
addpd  %xmm2,%xmm0
mulpd  0xf0(%rsp),%xmm0
addpd  %xmm4,%xmm0
movapd %xmm0,0x10(%rsp)
sub    $0x8,%rsp
mov    0x80(%rsp),%rdi
mov    %r9d,%esi
movaps 0x118(%rsp),%xmm0
mov    $0xc,%edx
lea    0x18(%rsp),%rcx
movapd %xmm6,%xmm2
mov    0x70(%rsp),%r8
mov    0x68(%rsp),%r9
push   %r12
push   %r14
push   %r13
push   0x1b0(%rsp)
push   0x1b0(%rsp)
push   0x1b0(%rsp)
push   0x1b0(%rsp)
push   %rax
push   0x1a8(%rsp)
push   %rbx
push   %rbp
push   %r10
push   %r11
mov    %r10,%r13
mov    %r12,%r14
mov    %r11,%r12
call   1030 <findNURBSbasisFunIso4xScCP@plt>
mov    0xf8(%rsp),%r8
mov    0x100(%rsp),%rdx
movsd  0x130(%rsp),%xmm6
mov    0x138(%rsp),%r9
movsd  0xe0(%rsp),%xmm3
movsd  0xb6a(%rip),%xmm2
movsd  0xb5a(%rip),%xmm1
mov    0x1d8(%rsp),%rcx
mov    %r12,%r11
mov    %r14,%r12
mov    0x210(%rsp),%r14
mov    %r13,%r10
mov    0x208(%rsp),%r13
add    $0x70,%rsp
movsd  0x10(%rsp),%xmm0
movslq %r15d,%r15
movsd  %xmm0,(%rcx,%r15,8)
movsd  0x18(%rsp),%xmm0
lea    0x1(%r15),%eax
cltq
movsd  %xmm0,(%rcx,%rax,8)
movapd 0xd0(%rsp),%xmm0
addsd  %xmm2,%xmm0
add    $0x2,%r15d
mov    (%rsp),%eax
add    $0xffffffff,%eax
mov    %eax,(%rsp)
cmp    $0xfffffffc,%eax
jne    1350 <NURBSsurfaceBasisX16ScMax+0x240>
mov    0x58(%rsp),%rcx
mov    %ecx,%r15d
sub    (%rsp),%r15d
movapd 0xe0(%rsp),%xmm0
addsd  %xmm2,%xmm0
mov    0x4(%rsp),%eax
add    $0x1,%eax
cmp    $0x4,%eax
jne    1300 <NURBSsurfaceBasisX16ScMax+0x1f0>
mov    %ecx,%r15d
sub    (%rsp),%r15d
mov    0x50(%rsp),%r9
cmp    0x30(%rsp),%r9
jne    1220 <NURBSsurfaceBasisX16ScMax+0x110>
jmp    11b0 <NURBSsurfaceBasisX16ScMax+0xa0>

LLVM IR (-O0):
define void @NURBSsurfaceBasisX16ScMax(i32 %0, i32 %1, double* %2, i32 %3, i32 %4, double* %5, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15) {
%17 = alloca i32
%18 = alloca i32
%19 = alloca double*
%20 = alloca i32
%21 = alloca i32
%22 = alloca double*
%23 = alloca double*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca double*
%31 = alloca double*
%32 = alloca double*
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca i32
%39 = alloca i32
%40 = alloca [2 x double]
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca double
%45 = alloca double
%46 = alloca double
store i32 %0, i32* %17
store i32 %1, i32* %18
store double* %2, double** %19
store i32 %3, i32* %20
store i32 %4, i32* %21
store double* %5, double** %22
store double* %6, double** %23
store double* %7, double** %24
store double* %8, double** %25
store double* %9, double** %26
store double* %10, double** %27
store double* %11, double** %28
store double* %12, double** %29
store double* %13, double** %30
store double* %14, double** %31
store double* %15, double** %32
%47 = load i32, i32* %17
%48 = add nsw i32 %47, 1
store i32 %48, i32* %38
%49 = load i32, i32* %18
%50 = add nsw i32 %49, 1
store i32 %50, i32* %39
store i32 0, i32* %37
store i32 0, i32* %35
br label %51
51: ; preds = %279, %16
%52 = load i32, i32* %35
%53 = load i32, i32* %21
%54 = sub nsw i32 %53, 2
%55 = icmp sle i32 %52, %54
br i1 %55, label %56, label %282
56: ; preds = %51
%57 = load double*, double** %23
%58 = load i32, i32* %35
%59 = add nsw i32 %58, 1
%60 = load i32, i32* %39
%61 = add nsw i32 %59, %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %57, i64 %62
%64 = load double, double* %63
%65 = load double*, double** %23
%66 = load i32, i32* %35
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
%69 = load double, double* %68
%70 = fsub double %64, %69
%71 = fmul double 1.000000e-01, %70
store double %71, double* %42
store i32 0, i32* %36
br label %72
72: ; preds = %275, %56
%73 = load i32, i32* %36
%74 = load i32, i32* %20
%75 = sub nsw i32 %74, 2
%76 = icmp sle i32 %73, %75
br i1 %76, label %77, label %278
77: ; preds = %72
%78 = load double*, double** %22
%79 = load i32, i32* %36
%80 = add nsw i32 %79, 1
%81 = load i32, i32* %38
%82 = add nsw i32 %80, %81
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %78, i64 %83
%85 = load double, double* %84
%86 = load double*, double** %22
%87 = load i32, i32* %36
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds double, double* %86, i64 %88
%90 = load double, double* %89
%91 = fsub double %85, %90
%92 = fmul double 1.000000e-01, %91
store double %92, double* %41
store double 1.250000e-01, double* %44
store i32 0, i32* %33
br label %93
93: ; preds = %271, %77
%94 = load i32, i32* %33
%95 = icmp slt i32 %94, 4
br i1 %95, label %96, label %274
96: ; preds = %93
%97 = load double, double* %44
%98 = fsub double 1.000000e+00, %97
store double %98, double* %46
store double 1.250000e-01, double* %43
store i32 0, i32* %34
br label %99
99: ; preds = %265, %96
%100 = load i32, i32* %34
%101 = icmp slt i32 %100, 4
br i1 %101, label %102, label %268
102: ; preds = %99
%103 = load double, double* %43
%104 = fsub double 1.000000e+00, %103
store double %104, double* %45
%105 = load double, double* %46
%106 = load double, double* %45
%107 = load double*, double** %25
%108 = load i32, i32* %35
%109 = load i32, i32* %20
%110 = mul nsw i32 %108, %109
%111 = load i32, i32* %36
%112 = add nsw i32 %110, %111
%113 = mul nsw i32 2, %112
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %107, i64 %114
%116 = load double, double* %115
%117 = load double, double* %43
%118 = load double*, double** %25
%119 = load i32, i32* %35
%120 = load i32, i32* %20
%121 = mul nsw i32 %119, %120
%122 = load i32, i32* %36
%123 = add nsw i32 %121, %122
%124 = add nsw i32 %123, 1
%125 = mul nsw i32 2, %124
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %118, i64 %126
%128 = load double, double* %127
%129 = fmul double %117, %128
%130 = call double @llvm.fmuladd.f64(double %106, double %116, double %129)
%131 = load double, double* %44
%132 = load double, double* %45
%133 = load double*, double** %25
%134 = load i32, i32* %35
%135 = add nsw i32 %134, 1
%136 = load i32, i32* %20
%137 = mul nsw i32 %135, %136
%138 = load i32, i32* %36
%139 = add nsw i32 %137, %138
%140 = mul nsw i32 2, %139
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double, double* %133, i64 %141
%143 = load double, double* %142
%144 = load double, double* %43
%145 = load double*, double** %25
%146 = load i32, i32* %35
%147 = add nsw i32 %146, 1
%148 = load i32, i32* %20
%149 = mul nsw i32 %147, %148
%150 = load i32, i32* %36
%151 = add nsw i32 %149, %150
%152 = add nsw i32 %151, 1
%153 = mul nsw i32 2, %152
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %145, i64 %154
%156 = load double, double* %155
%157 = fmul double %144, %156
%158 = call double @llvm.fmuladd.f64(double %132, double %143, double %157)
%159 = fmul double %131, %158
%160 = call double @llvm.fmuladd.f64(double %105, double %130, double %159)
%161 = getelementptr inbounds [2 x double], [2 x double]* %40, i64 0, i64 0
store double %160, double* %161
%162 = load double, double* %46
%163 = load double, double* %45
%164 = load double*, double** %25
%165 = load i32, i32* %35
%166 = load i32, i32* %20
%167 = mul nsw i32 %165, %166
%168 = load i32, i32* %36
%169 = add nsw i32 %167, %168
%170 = mul nsw i32 2, %169
%171 = add nsw i32 %170, 1
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds double, double* %164, i64 %172
%174 = load double, double* %173
%175 = load double, double* %43
%176 = load double*, double** %25
%177 = load i32, i32* %35
%178 = load i32, i32* %20
%179 = mul nsw i32 %177, %178
%180 = load i32, i32* %36
%181 = add nsw i32 %179, %180
%182 = add nsw i32 %181, 1
%183 = mul nsw i32 2, %182
%184 = add nsw i32 %183, 1
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds double, double* %176, i64 %185
%187 = load double, double* %186
%188 = fmul double %175, %187
%189 = call double @llvm.fmuladd.f64(double %163, double %174, double %188)
%190 = load double, double* %44
%191 = load double, double* %45
%192 = load double*, double** %25
%193 = load i32, i32* %35
%194 = add nsw i32 %193, 1
%195 = load i32, i32* %20
%196 = mul nsw i32 %194, %195
%197 = load i32, i32* %36
%198 = add nsw i32 %196, %197
%199 = mul nsw i32 2, %198
%200 = add nsw i32 %199, 1
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds double, double* %192, i64 %201
%203 = load double, double* %202
%204 = load double, double* %43
%205 = load double*, double** %25
%206 = load i32, i32* %35
%207 = add nsw i32 %206, 1
%208 = load i32, i32* %20
%209 = mul nsw i32 %207, %208
%210 = load i32, i32* %36
%211 = add nsw i32 %209, %210
%212 = add nsw i32 %211, 1
%213 = mul nsw i32 2, %212
%214 = add nsw i32 %213, 1
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds double, double* %205, i64 %215
%217 = load double, double* %216
%218 = fmul double %204, %217
%219 = call double @llvm.fmuladd.f64(double %191, double %203, double %218)
%220 = fmul double %190, %219
%221 = call double @llvm.fmuladd.f64(double %162, double %189, double %220)
%222 = getelementptr inbounds [2 x double], [2 x double]* %40, i64 0, i64 1
store double %221, double* %222
%223 = load i32, i32* %35
%224 = load i32, i32* %36
%225 = load double, double* %46
%226 = load double, double* %45
%227 = getelementptr inbounds [2 x double], [2 x double]* %40, i64 0, i64 0
%228 = load double, double* %41
%229 = load double, double* %42
%230 = load i32, i32* %17
%231 = load i32, i32* %18
%232 = load double*, double** %19
%233 = load i32, i32* %20
%234 = load i32, i32* %21
%235 = load double*, double** %22
%236 = load double*, double** %23
%237 = load double*, double** %25
%238 = load double*, double** %26
%239 = load double*, double** %27
%240 = load double*, double** %28
%241 = load double*, double** %29
%242 = load double*, double** %30
%243 = load double*, double** %31
%244 = load double*, double** %32
%245 = call i32 @findNURBSbasisFunIso4xScCP(i32 %223, i32 %224, double %225, double %226, i32 12, double* %227, double %228, double %229, i32 %230, i32 %231, double* %232, i32 %233, i32 %234, double* %235, double* %236, double* %237, double* %238, double* %239, double* %240, double* %241, double* %242, double* %243, double* %244)
%246 = getelementptr inbounds [2 x double], [2 x double]* %40, i64 0, i64 0
%247 = load double, double* %246
%248 = load double*, double** %24
%249 = load i32, i32* %37
%250 = mul nsw i32 2, %249
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds double, double* %248, i64 %251
store double %247, double* %252
%253 = getelementptr inbounds [2 x double], [2 x double]* %40, i64 0, i64 1
%254 = load double, double* %253
%255 = load double*, double** %24
%256 = load i32, i32* %37
%257 = mul nsw i32 2, %256
%258 = add nsw i32 %257, 1
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds double, double* %255, i64 %259
store double %254, double* %260
%261 = load i32, i32* %37
%262 = add nsw i32 %261, 1
store i32 %262, i32* %37
%263 = load double, double* %43
%264 = fadd double %263, 2.500000e-01
store double %264, double* %43
br label %265
265: ; preds = %102
%266 = load i32, i32* %34
%267 = add nsw i32 %266, 1
store i32 %267, i32* %34
br label %99
268: ; preds = %99
%269 = load double, double* %44
%270 = fadd double %269, 2.500000e-01
store double %270, double* %44
br label %271
271: ; preds = %268
%272 = load i32, i32* %33
%273 = add nsw i32 %272, 1
store i32 %273, i32* %33
br label %93
274: ; preds = %93
br label %275
275: ; preds = %274
%276 = load i32, i32* %36
%277 = add nsw i32 %276, 1
store i32 %277, i32* %36
br label %72
278: ; preds = %72
br label %279
279: ; preds = %278
%280 = load i32, i32* %35
%281 = add nsw i32 %280, 1
store i32 %281, i32* %35
br label %51
282: ; preds = %51
ret void
}

LLVM IR (-O2):
define void @NURBSsurfaceBasisX16ScMax(i32 %0, i32 %1, double* %2, i32 %3, i32 %4, double* %5, double* %6, double* nocapture writeonly %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15) {
%17 = alloca <2 x double>
%18 = bitcast <2 x double>* %17 to i8*
%19 = icmp slt i32 %4, 2
br i1 %19, label %155, label %20
20: ; preds = %16
%21 = add nsw i32 %1, 1
%22 = add nsw i32 %0, 1
%23 = icmp slt i32 %3, 2
%24 = getelementptr inbounds <2 x double>, <2 x double>* %17, i64 0, i64 0
%25 = getelementptr inbounds <2 x double>, <2 x double>* %17, i64 0, i64 1
%26 = sext i32 %22 to i64
%27 = add i32 %3, -1
%28 = sext i32 %21 to i64
%29 = add nsw i32 %4, -1
%30 = zext i32 %29 to i64
%31 = zext i32 %27 to i64
br label %37
32: ; preds = %54
%33 = trunc i64 %146 to i32
br label %34
34: ; preds = %32, %37
%35 = phi i32 [ %39, %37 ], [ %33, %32 ]
%36 = icmp eq i64 %40, %30
br i1 %36, label %155, label %37
37: ; preds = %20, %34
%38 = phi i64 [ 0, %20 ], [ %40, %34 ]
%39 = phi i32 [ 0, %20 ], [ %35, %34 ]
%40 = add nuw nsw i64 %38, 1
%41 = add nsw i64 %40, %28
%42 = getelementptr inbounds double, double* %6, i64 %41
%43 = load double, double* %42
%44 = getelementptr inbounds double, double* %6, i64 %38
%45 = load double, double* %44
%46 = fsub double %43, %45
%47 = fmul double %46, 1.000000e-01
br i1 %23, label %34, label %48
48: ; preds = %37
%49 = trunc i64 %38 to i32
%50 = mul i32 %49, %3
%51 = trunc i64 %40 to i32
%52 = mul i32 %51, %3
%53 = trunc i64 %38 to i32
br label %57
54: ; preds = %150
%55 = trunc i64 %146 to i32
%56 = icmp eq i64 %61, %31
br i1 %56, label %32, label %57
57: ; preds = %48, %54
%58 = phi i64 [ 0, %48 ], [ %61, %54 ]
%59 = phi i32 [ %39, %48 ], [ %55, %54 ]
%60 = trunc i64 %58 to i32
%61 = add nuw nsw i64 %58, 1
%62 = add nsw i64 %61, %26
%63 = getelementptr inbounds double, double* %5, i64 %62
%64 = load double, double* %63
%65 = getelementptr inbounds double, double* %5, i64 %58
%66 = load double, double* %65
%67 = fsub double %64, %66
%68 = fmul double %67, 1.000000e-01
%69 = add nsw i32 %50, %60
%70 = shl nsw i32 %69, 1
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %8, i64 %71
%73 = add i32 %70, 2
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %8, i64 %74
%76 = add nsw i32 %52, %60
%77 = shl nsw i32 %76, 1
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %8, i64 %78
%80 = add i32 %77, 2
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %8, i64 %81
%83 = or i32 %70, 1
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %8, i64 %84
%86 = add i32 %70, 3
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %8, i64 %87
%89 = or i32 %77, 1
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %8, i64 %90
%92 = add i32 %77, 3
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %8, i64 %93
br label %95
95: ; preds = %57, %150
%96 = phi i32 [ 0, %57 ], [ %153, %150 ]
%97 = phi double [ 1.250000e-01, %57 ], [ %152, %150 ]
%98 = phi i32 [ %59, %57 ], [ %151, %150 ]
%99 = fsub double 1.000000e+00, %97
%100 = zext i32 %98 to i64
%101 = insertelement <2 x double> poison, double %99, i64 0
%102 = shufflevector <2 x double> %101, <2 x double> poison, <2 x i32> zeroinitializer
%103 = insertelement <2 x double> poison, double %97, i64 0
%104 = shufflevector <2 x double> %103, <2 x double> poison, <2 x i32> zeroinitializer
br label %105
105: ; preds = %95, %105
%106 = phi i64 [ %100, %95 ], [ %146, %105 ]
%107 = phi i32 [ 0, %95 ], [ %148, %105 ]
%108 = phi double [ 1.250000e-01, %95 ], [ %147, %105 ]
%109 = fsub double 1.000000e+00, %108
%110 = load double, double* %72
%111 = load double, double* %75
%112 = load double, double* %79
%113 = load double, double* %82
%114 = load double, double* %85
%115 = load double, double* %88
%116 = insertelement <2 x double> poison, double %108, i64 0
%117 = shufflevector <2 x double> %116, <2 x double> poison, <2 x i32> zeroinitializer
%118 = insertelement <2 x double> poison, double %111, i64 0
%119 = insertelement <2 x double> %118, double %115, i64 1
%120 = fmul <2 x double> %117, %119
%121 = insertelement <2 x double> poison, double %109, i64 0
%122 = shufflevector <2 x double> %121, <2 x double> poison, <2 x i32> zeroinitializer
%123 = insertelement <2 x double> poison, double %110, i64 0
%124 = insertelement <2 x double> %123, double %114, i64 1
%125 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %122, <2 x double> %124, <2 x double> %120)
%126 = load double, double* %91
%127 = load double, double* %94
%128 = insertelement <2 x double> poison, double %113, i64 0
%129 = insertelement <2 x double> %128, double %127, i64 1
%130 = fmul <2 x double> %117, %129
%131 = insertelement <2 x double> poison, double %112, i64 0
%132 = insertelement <2 x double> %131, double %126, i64 1
%133 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %122, <2 x double> %132, <2 x double> %130)
%134 = fmul <2 x double> %104, %133
%135 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %102, <2 x double> %125, <2 x double> %134)
store <2 x double> %135, <2 x double>* %17
%136 = call i32 @findNURBSbasisFunIso4xScCP(i32 %53, i32 %60, double %99, double %109, i32 12, double* %24, double %68, double %47, i32 %0, i32 %1, double* %2, i32 %3, i32 %4, double* %5, double* %6, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, double* %14, double* %15)
%137 = load double, double* %24
%138 = trunc i64 %106 to i32
%139 = shl nsw i32 %138, 1
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %7, i64 %140
store double %137, double* %141
%142 = load double, double* %25
%143 = or i32 %139, 1
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %7, i64 %144
store double %142, double* %145
%146 = add i64 %106, 1
%147 = fadd double %108, 2.500000e-01
%148 = add nuw nsw i32 %107, 1
%149 = icmp eq i32 %148, 4
br i1 %149, label %150, label %105
150: ; preds = %105
%151 = trunc i64 %146 to i32
%152 = fadd double %97, 2.500000e-01
%153 = add nuw nsw i32 %96, 1
%154 = icmp eq i32 %153, 4
br i1 %154, label %54, label %95
155: ; preds = %34, %16
ret void
}