#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*/ findNURBSbasisFunIso4xCP(int, int, int, double *, double,
                                            double, int, int, double *, int,
                                            int, double *, double *, double *,
                                            double *, double *, double *,
                                            double *, double *, double *,
                                            double *);
void NURBSsurfaceBasisX4Max(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 ii, jj, nus, orderU, orderV;
  double uv[2], stepU, stepV;
  orderU = degU + 1;
  orderV = degV + 1;
  nus = 0;
  for (ii = 0; ii <= (kcp - 2); ii++) {
    for (jj = 0; jj <= (ncp - 2); jj++) {
      uv[0] = 0.25 *
              (usX1max[2 * (ii * ncp + jj)] + usX1max[2 * (ii * ncp + jj + 1)] +
               usX1max[2 * ((ii + 1) * ncp + jj)] +
               usX1max[2 * ((ii + 1) * ncp + jj + 1)]);
      uv[1] = 0.25 * (usX1max[2 * (ii * ncp + jj) + 1] +
                      usX1max[2 * (ii * ncp + jj + 1) + 1] +
                      usX1max[2 * ((ii + 1) * ncp + jj) + 1] +
                      usX1max[2 * ((ii + 1) * ncp + jj + 1) + 1]);
      stepU = 0.1 * (knotU[jj + 1 + orderU] - knotU[jj]);
      stepV = 0.1 * (knotV[ii + 1 + orderV] - knotV[ii]);
      findNURBSbasisFunIso4xCP(ii, jj, 6, 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++;
    }
  }
}


x86 assembly (clang, -O0):
<NURBSsurfaceBasisX4Max>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%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,-0x58(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     1451 <NURBSsurfaceBasisX4Max+0x341>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x3c(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jg     143e <NURBSsurfaceBasisX4Max+0x32e>
mov    0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x50(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x50(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
imul   -0x3c(%rbp),%ecx
add    -0x50(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
imul   -0x3c(%rbp),%ecx
add    -0x50(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xde6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x50(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0x3c(%rbp),%ecx
add    -0x50(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
imul   -0x3c(%rbp),%ecx
add    -0x50(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    0x20(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
imul   -0x3c(%rbp),%ecx
add    -0x50(%rbp),%ecx
add    $0x1,%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xd59(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    $0x1,%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x48(%rbp),%rax
movslq -0x50(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xd1e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
add    $0x1,%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm1
movsd  0xceb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x50(%rbp),%esi
lea    -0x70(%rbp),%rcx
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0x38(%rbp),%rax
mov    -0x3c(%rbp),%edx
mov    %edx,-0xa0(%rbp)
mov    -0x40(%rbp),%edx
mov    %edx,-0x9c(%rbp)
mov    -0x48(%rbp),%rdx
mov    %rdx,-0x98(%rbp)
mov    0x10(%rbp),%rdx
mov    %rdx,-0x90(%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,-0x88(%rbp)
mov    $0x6,%edx
mov    %rax,(%rsp)
mov    -0xa0(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0x9c(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0x98(%rbp),%rax
mov    %rax,0x18(%rsp)
mov    -0x90(%rbp),%rax
mov    %rax,0x20(%rsp)
mov    -0x88(%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 <findNURBSbasisFunIso4xCP@plt>
movsd  -0x70(%rbp),%xmm0
mov    0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x68(%rbp),%xmm0
mov    0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1199 <NURBSsurfaceBasisX4Max+0x89>
jmp    1443 <NURBSsurfaceBasisX4Max+0x333>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1181 <NURBSsurfaceBasisX4Max+0x71>
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<NURBSsurfaceBasisX4Max>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rcx,(%rsp)
mov    %rdx,0x70(%rsp)
mov    %r8,0x10(%rsp)
cmp    $0x2,%r8d
jge    1147 <NURBSsurfaceBasisX4Max+0x37>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r9,%r10
mov    0x118(%rsp),%r13
mov    0x110(%rsp),%r12
lea    0x1(%rsi),%eax
movslq %edi,%rbx
mov    (%rsp),%rdx
lea    -0x1(%rdx),%r8d
movslq %eax,%rbp
mov    %rbp,0x40(%rsp)
mov    0x10(%rsp),%rax
lea    -0x1(%rax),%r11d
lea    (%rdx,%rdx,1),%eax
add    %r8,%r8
lea    (%r9,%rbx,8),%r14
add    $0x10,%r14
movapd 0xe71(%rip),%xmm3
movsd  0xe79(%rip),%xmm4
xor    %r9d,%r9d
mov    %r9,0x18(%rsp)
lea    0x20(%rsp),%rcx
mov    %rax,%r9
xor    %ebp,%ebp
xor    %ebx,%ebx
mov    %edi,0xc(%rsp)
mov    %rsi,0x68(%rsp)
mov    %r8,0x60(%rsp)
mov    %r11,0x38(%rsp)
mov    %rax,0x30(%rsp)
mov    %r14,0x58(%rsp)
jmp    11e9 <NURBSsurfaceBasisX4Max+0xd9>
nopw   0x0(%rax,%rax,1)
add    %rax,0x18(%rsp)
add    %rax,%r9
mov    0x50(%rsp),%rdx
mov    %rdx,%rbp
cmp    %r11,%rdx
je     1135 <NURBSsurfaceBasisX4Max+0x25>
lea    0x1(%rbp),%r15
cmpl   $0x2,(%rsp)
mov    %r15,0x50(%rsp)
jl     11d0 <NURBSsurfaceBasisX4Max+0xc0>
mov    %rbp,0x88(%rsp)
mov    0x40(%rsp),%rbp
lea    (%r15,%rbp,1),%rax
mov    %rax,0x90(%rsp)
mov    %rbx,0x48(%rsp)
lea    (%rbx,%rbx,1),%eax
mov    %rax,0x78(%rsp)
xor    %r14d,%r14d
xor    %r15d,%r15d
mov    %r9,0x80(%rsp)
nopl   0x0(%rax)
mov    0x18(%rsp),%rax
add    %r15,%rax
cltq
lea    0x2(%rax),%edx
movslq %edx,%rbx
lea    (%r9,%r15,1),%rdx
movslq %edx,%rdx
lea    0x2(%rdx),%esi
lea    0x1(%rax),%edi
movslq %edi,%rdi
lea    0x3(%rax),%ebp
mov    0xe0(%rsp),%r11
movsd  (%r11,%rax,8),%xmm0
movhpd (%r11,%rdi,8),%xmm0
movslq %ebp,%rax
movsd  (%r11,%rbx,8),%xmm1
movhpd (%r11,%rax,8),%xmm1
movslq %esi,%rax
addpd  %xmm0,%xmm1
lea    0x1(%rdx),%esi
movslq %esi,%rsi
movsd  (%r11,%rdx,8),%xmm0
movhpd (%r11,%rsi,8),%xmm0
lea    0x3(%rdx),%edx
movslq %edx,%rdx
movsd  (%r11,%rax,8),%xmm2
movhpd (%r11,%rdx,8),%xmm2
addpd  %xmm1,%xmm0
addpd  %xmm0,%xmm2
mulpd  %xmm3,%xmm2
movapd %xmm2,0x20(%rsp)
mov    0x58(%rsp),%rax
movsd  (%rax,%r15,4),%xmm0
subsd  (%r10,%r15,4),%xmm0
mulsd  %xmm4,%xmm0
mov    0x90(%rsp),%rax
mov    0xd0(%rsp),%rbp
movsd  0x0(%rbp,%rax,8),%xmm1
mov    0x88(%rsp),%rdi
subsd  0x0(%rbp,%rdi,8),%xmm1
mulsd  %xmm4,%xmm1
sub    $0x8,%rsp
mov    %r14d,%esi
mov    $0x6,%edx
mov    0x14(%rsp),%r8d
mov    0x70(%rsp),%r9
push   %r13
push   %r12
push   0x120(%rsp)
push   0x120(%rsp)
push   0x120(%rsp)
push   0x120(%rsp)
push   0x120(%rsp)
push   %r11
push   %rbp
push   %r10
mov    0x68(%rsp),%rax
push   %rax
mov    0x60(%rsp),%rax
push   %rax
mov    0xd8(%rsp),%rax
push   %rax
mov    %r10,%rbp
mov    %r13,%r12
call   1030 <findNURBSbasisFunIso4xCP@plt>
mov    0xf0(%rsp),%r9
lea    0x90(%rsp),%rcx
movsd  0xca6(%rip),%xmm4
movapd 0xc8e(%rip),%xmm3
mov    0xd0(%rsp),%r8
mov    0x180(%rsp),%r12
mov    %rbp,%r10
add    $0x70,%rsp
movsd  0x20(%rsp),%xmm0
mov    0x78(%rsp),%rax
add    %r15,%rax
cltq
mov    0xd8(%rsp),%rdx
movsd  %xmm0,(%rdx,%rax,8)
movsd  0x28(%rsp),%xmm0
add    $0x1,%eax
cltq
movsd  %xmm0,(%rdx,%rax,8)
add    $0x2,%r15
add    $0x1,%r14d
cmp    %r15,%r8
jne    1230 <NURBSsurfaceBasisX4Max+0x120>
mov    0x48(%rsp),%rbx
add    %r14d,%ebx
mov    0x38(%rsp),%r11
mov    0x30(%rsp),%rax
jmp    11d0 <NURBSsurfaceBasisX4Max+0xc0>

LLVM IR (-O0):
define void @NURBSsurfaceBasisX4Max(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 [2 x double]
%39 = alloca double
%40 = 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
%41 = load i32, i32* %17
%42 = add nsw i32 %41, 1
store i32 %42, i32* %36
%43 = load i32, i32* %18
%44 = add nsw i32 %43, 1
store i32 %44, i32* %37
store i32 0, i32* %35
store i32 0, i32* %33
br label %45
45: ; preds = %231, %16
%46 = load i32, i32* %33
%47 = load i32, i32* %21
%48 = sub nsw i32 %47, 2
%49 = icmp sle i32 %46, %48
br i1 %49, label %50, label %234
50: ; preds = %45
store i32 0, i32* %34
br label %51
51: ; preds = %227, %50
%52 = load i32, i32* %34
%53 = load i32, i32* %20
%54 = sub nsw i32 %53, 2
%55 = icmp sle i32 %52, %54
br i1 %55, label %56, label %230
56: ; preds = %51
%57 = load double*, double** %25
%58 = load i32, i32* %33
%59 = load i32, i32* %20
%60 = mul nsw i32 %58, %59
%61 = load i32, i32* %34
%62 = add nsw i32 %60, %61
%63 = mul nsw i32 2, %62
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds double, double* %57, i64 %64
%66 = load double, double* %65
%67 = load double*, double** %25
%68 = load i32, i32* %33
%69 = load i32, i32* %20
%70 = mul nsw i32 %68, %69
%71 = load i32, i32* %34
%72 = add nsw i32 %70, %71
%73 = add nsw i32 %72, 1
%74 = mul nsw i32 2, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %67, i64 %75
%77 = load double, double* %76
%78 = fadd double %66, %77
%79 = load double*, double** %25
%80 = load i32, i32* %33
%81 = add nsw i32 %80, 1
%82 = load i32, i32* %20
%83 = mul nsw i32 %81, %82
%84 = load i32, i32* %34
%85 = add nsw i32 %83, %84
%86 = mul nsw i32 2, %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %79, i64 %87
%89 = load double, double* %88
%90 = fadd double %78, %89
%91 = load double*, double** %25
%92 = load i32, i32* %33
%93 = add nsw i32 %92, 1
%94 = load i32, i32* %20
%95 = mul nsw i32 %93, %94
%96 = load i32, i32* %34
%97 = add nsw i32 %95, %96
%98 = add nsw i32 %97, 1
%99 = mul nsw i32 2, %98
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds double, double* %91, i64 %100
%102 = load double, double* %101
%103 = fadd double %90, %102
%104 = fmul double 2.500000e-01, %103
%105 = getelementptr inbounds [2 x double], [2 x double]* %38, i64 0, i64 0
store double %104, double* %105
%106 = load double*, double** %25
%107 = load i32, i32* %33
%108 = load i32, i32* %20
%109 = mul nsw i32 %107, %108
%110 = load i32, i32* %34
%111 = add nsw i32 %109, %110
%112 = mul nsw i32 2, %111
%113 = add nsw i32 %112, 1
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %106, i64 %114
%116 = load double, double* %115
%117 = load double*, double** %25
%118 = load i32, i32* %33
%119 = load i32, i32* %20
%120 = mul nsw i32 %118, %119
%121 = load i32, i32* %34
%122 = add nsw i32 %120, %121
%123 = add nsw i32 %122, 1
%124 = mul nsw i32 2, %123
%125 = add nsw i32 %124, 1
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %117, i64 %126
%128 = load double, double* %127
%129 = fadd double %116, %128
%130 = load double*, double** %25
%131 = load i32, i32* %33
%132 = add nsw i32 %131, 1
%133 = load i32, i32* %20
%134 = mul nsw i32 %132, %133
%135 = load i32, i32* %34
%136 = add nsw i32 %134, %135
%137 = mul nsw i32 2, %136
%138 = add nsw i32 %137, 1
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %130, i64 %139
%141 = load double, double* %140
%142 = fadd double %129, %141
%143 = load double*, double** %25
%144 = load i32, i32* %33
%145 = add nsw i32 %144, 1
%146 = load i32, i32* %20
%147 = mul nsw i32 %145, %146
%148 = load i32, i32* %34
%149 = add nsw i32 %147, %148
%150 = add nsw i32 %149, 1
%151 = mul nsw i32 2, %150
%152 = add nsw i32 %151, 1
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %143, i64 %153
%155 = load double, double* %154
%156 = fadd double %142, %155
%157 = fmul double 2.500000e-01, %156
%158 = getelementptr inbounds [2 x double], [2 x double]* %38, i64 0, i64 1
store double %157, double* %158
%159 = load double*, double** %22
%160 = load i32, i32* %34
%161 = add nsw i32 %160, 1
%162 = load i32, i32* %36
%163 = add nsw i32 %161, %162
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %159, i64 %164
%166 = load double, double* %165
%167 = load double*, double** %22
%168 = load i32, i32* %34
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
%171 = load double, double* %170
%172 = fsub double %166, %171
%173 = fmul double 1.000000e-01, %172
store double %173, double* %39
%174 = load double*, double** %23
%175 = load i32, i32* %33
%176 = add nsw i32 %175, 1
%177 = load i32, i32* %37
%178 = add nsw i32 %176, %177
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double, double* %174, i64 %179
%181 = load double, double* %180
%182 = load double*, double** %23
%183 = load i32, i32* %33
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
%186 = load double, double* %185
%187 = fsub double %181, %186
%188 = fmul double 1.000000e-01, %187
store double %188, double* %40
%189 = load i32, i32* %33
%190 = load i32, i32* %34
%191 = getelementptr inbounds [2 x double], [2 x double]* %38, i64 0, i64 0
%192 = load double, double* %39
%193 = load double, double* %40
%194 = load i32, i32* %17
%195 = load i32, i32* %18
%196 = load double*, double** %19
%197 = load i32, i32* %20
%198 = load i32, i32* %21
%199 = load double*, double** %22
%200 = load double*, double** %23
%201 = load double*, double** %25
%202 = load double*, double** %26
%203 = load double*, double** %27
%204 = load double*, double** %28
%205 = load double*, double** %29
%206 = load double*, double** %30
%207 = load double*, double** %31
%208 = load double*, double** %32
%209 = call i32 @findNURBSbasisFunIso4xCP(i32 %189, i32 %190, i32 6, double* %191, double %192, double %193, i32 %194, i32 %195, double* %196, i32 %197, i32 %198, double* %199, double* %200, double* %201, double* %202, double* %203, double* %204, double* %205, double* %206, double* %207, double* %208)
%210 = getelementptr inbounds [2 x double], [2 x double]* %38, i64 0, i64 0
%211 = load double, double* %210
%212 = load double*, double** %24
%213 = load i32, i32* %35
%214 = mul nsw i32 2, %213
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds double, double* %212, i64 %215
store double %211, double* %216
%217 = getelementptr inbounds [2 x double], [2 x double]* %38, i64 0, i64 1
%218 = load double, double* %217
%219 = load double*, double** %24
%220 = load i32, i32* %35
%221 = mul nsw i32 2, %220
%222 = add nsw i32 %221, 1
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds double, double* %219, i64 %223
store double %218, double* %224
%225 = load i32, i32* %35
%226 = add nsw i32 %225, 1
store i32 %226, i32* %35
br label %227
227: ; preds = %56
%228 = load i32, i32* %34
%229 = add nsw i32 %228, 1
store i32 %229, i32* %34
br label %51
230: ; preds = %51
br label %231
231: ; preds = %230
%232 = load i32, i32* %33
%233 = add nsw i32 %232, 1
store i32 %233, i32* %33
br label %45
234: ; preds = %45
ret void
}

LLVM IR (-O2):
define void @NURBSsurfaceBasisX4Max(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 %125, 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 %32
32: ; preds = %20, %122
%33 = phi i64 [ 0, %20 ], [ %35, %122 ]
%34 = phi i32 [ 0, %20 ], [ %123, %122 ]
%35 = add nuw nsw i64 %33, 1
br i1 %23, label %122, label %36
36: ; preds = %32
%37 = add nsw i64 %35, %28
%38 = getelementptr inbounds double, double* %6, i64 %37
%39 = getelementptr inbounds double, double* %6, i64 %33
%40 = zext i32 %34 to i64
%41 = trunc i64 %33 to i32
%42 = mul i32 %41, %3
%43 = trunc i64 %35 to i32
%44 = mul i32 %43, %3
%45 = trunc i64 %33 to i32
br label %46
46: ; preds = %36, %46
%47 = phi i64 [ %40, %36 ], [ %118, %46 ]
%48 = phi i64 [ 0, %36 ], [ %96, %46 ]
%49 = trunc i64 %48 to i32
%50 = add nsw i32 %42, %49
%51 = shl nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %8, i64 %52
%54 = load double, double* %53
%55 = add i32 %51, 2
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %8, i64 %56
%58 = load double, double* %57
%59 = add nsw i32 %44, %49
%60 = shl nsw i32 %59, 1
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds double, double* %8, i64 %61
%63 = load double, double* %62
%64 = add i32 %60, 2
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %8, i64 %65
%67 = load double, double* %66
%68 = or i32 %51, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %8, i64 %69
%71 = load double, double* %70
%72 = add i32 %51, 3
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %8, i64 %73
%75 = load double, double* %74
%76 = insertelement <2 x double> poison, double %54, i64 0
%77 = insertelement <2 x double> %76, double %71, i64 1
%78 = insertelement <2 x double> poison, double %58, i64 0
%79 = insertelement <2 x double> %78, double %75, i64 1
%80 = fadd <2 x double> %77, %79
%81 = or i32 %60, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %8, i64 %82
%84 = load double, double* %83
%85 = insertelement <2 x double> poison, double %63, i64 0
%86 = insertelement <2 x double> %85, double %84, i64 1
%87 = fadd <2 x double> %80, %86
%88 = add i32 %60, 3
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %8, i64 %89
%91 = load double, double* %90
%92 = insertelement <2 x double> poison, double %67, i64 0
%93 = insertelement <2 x double> %92, double %91, i64 1
%94 = fadd <2 x double> %87, %93
%95 = fmul <2 x double> %94, <double 2.500000e-01, double 2.500000e-01>
store <2 x double> %95, <2 x double>* %17
%96 = add nuw nsw i64 %48, 1
%97 = add nsw i64 %96, %26
%98 = getelementptr inbounds double, double* %5, i64 %97
%99 = load double, double* %98
%100 = getelementptr inbounds double, double* %5, i64 %48
%101 = load double, double* %100
%102 = fsub double %99, %101
%103 = fmul double %102, 1.000000e-01
%104 = load double, double* %38
%105 = load double, double* %39
%106 = fsub double %104, %105
%107 = fmul double %106, 1.000000e-01
%108 = call i32 @findNURBSbasisFunIso4xCP(i32 %45, i32 %49, i32 6, double* %24, double %103, double %107, 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)
%109 = load double, double* %24
%110 = trunc i64 %47 to i32
%111 = shl nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %7, i64 %112
store double %109, double* %113
%114 = load double, double* %25
%115 = or i32 %111, 1
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds double, double* %7, i64 %116
store double %114, double* %117
%118 = add i64 %47, 1
%119 = icmp eq i64 %96, %31
br i1 %119, label %120, label %46
120: ; preds = %46
%121 = trunc i64 %118 to i32
br label %122
122: ; preds = %32, %120
%123 = phi i32 [ %121, %120 ], [ %34, %32 ]
%124 = icmp eq i64 %35, %30
br i1 %124, label %125, label %32
125: ; preds = %122, %16
ret void
}