void boundaryvalues(int imax, int jmax, double **U, double **V) {
  int i, j;
  if (imax == jmax) {
    for (i = 1; i < imax + 1; i++) {
      U[i][0] = -U[i][1];
      U[i][imax + 1] = 2.0 - U[i][imax];
      U[0][i] = 0;
      U[imax][i] = 0;
      V[i][0] = 0;
      V[i][imax] = 0;
      V[0][i] = -V[1][i];
      V[imax + 1][i] = -V[imax][i];
    }
  } else {
    for (i = 1; i < imax + 1; i++) {
      U[i][0] = -U[i][1];
      U[i][jmax + 1] = 2.0 - U[i][jmax];
      V[i][0] = 0;
      V[i][jmax] = 0;
    }
    for (j = 1; j < jmax + 1; j++) {
      U[0][j] = 0;
      U[imax][j] = 0;
      V[0][j] = -V[1][j];
      V[imax + 1][j] = -V[imax][j];
    }
  }
}


x86 assembly (clang, -O0):
<boundaryvalues>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    128c <boundaryvalues+0x18c>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1287 <boundaryvalues+0x187>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4(%rbp),%rcx
movsd  0xe7a(%rip),%xmm0
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1125 <boundaryvalues+0x25>
jmp    1420 <boundaryvalues+0x320>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    134c <boundaryvalues+0x24c>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
movsd  0xd0c(%rip),%xmm0
subsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1293 <boundaryvalues+0x193>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    141b <boundaryvalues+0x31b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1353 <boundaryvalues+0x253>
jmp    1420 <boundaryvalues+0x320>
pop    %rbp
ret

x86 assembly (clang, -O2):
<boundaryvalues>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    %esi,%edi
jne    11da <boundaryvalues+0xda>
test   %edi,%edi
jle    13e3 <boundaryvalues+0x2e3>
mov    %edi,%eax
lea    0x1(%rax),%r8
mov    (%rdx),%r9
mov    (%rdx,%rax,8),%r10
mov    (%rcx),%r11
mov    0x8(%rcx),%r12
mov    (%rcx,%rax,8),%r14
mov    0x8(%rcx,%rax,8),%r15
lea    -0x8(,%rax,8),%r13
ff
xor    %ebx,%ebx
movapd 0xeb8(%rip),%xmm0
movsd  0xec0(%rip),%xmm1
mov    %r12,%rsi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x8(%rdx,%rbx,1),%rdi
movsd  0x8(%rdi),%xmm2
xorpd  %xmm0,%xmm2
movlpd %xmm2,(%rdi)
movapd %xmm1,%xmm2
subsd  (%rdi,%rax,8),%xmm2
movsd  %xmm2,(%rdi,%r8,8)
movq   $0x0,0x8(%r9,%rbx,1)
movq   $0x0,0x8(%r10,%rbx,1)
movq   $0x0,(%rsi)
movq   $0x0,(%rsi,%rax,8)
movsd  0x8(%r12,%rbx,1),%xmm2
xorpd  %xmm0,%xmm2
movlpd %xmm2,0x8(%r11,%rbx,1)
movsd  0x8(%r14,%rbx,1),%xmm2
xorpd  %xmm0,%xmm2
movlpd %xmm2,0x8(%r15,%rbx,1)
cmp    %rbx,%r13
je     13e3 <boundaryvalues+0x2e3>
mov    0x10(%rcx,%rbx,1),%rsi
add    $0x8,%rbx
jmp    1160 <boundaryvalues+0x60>
test   %edi,%edi
jle    12dc <boundaryvalues+0x1dc>
movslq %esi,%r9
lea    0x1(%rsi),%eax
movslq %eax,%r8
mov    %edi,%r10d
mov    $0x1,%eax
cmp    $0x1,%edi
je     129c <boundaryvalues+0x19c>
mov    %r10d,%r11d
and    $0xfffffffe,%r11d
neg    %r11
mov    $0x1,%eax
movapd 0xded(%rip),%xmm0
movsd  0xdf5(%rip),%xmm1
nopl   0x0(%rax,%rax,1)
mov    (%rdx,%rax,8),%rbx
movsd  0x8(%rbx),%xmm2
xorpd  %xmm0,%xmm2
movlpd %xmm2,(%rbx)
movapd %xmm1,%xmm2
subsd  (%rbx,%r9,8),%xmm2
movsd  %xmm2,(%rbx,%r8,8)
mov    (%rcx,%rax,8),%rbx
movq   $0x0,(%rbx)
movq   $0x0,(%rbx,%r9,8)
mov    0x8(%rdx,%rax,8),%rbx
movsd  0x8(%rbx),%xmm2
xorpd  %xmm0,%xmm2
movlpd %xmm2,(%rbx)
movapd %xmm1,%xmm2
subsd  (%rbx,%r9,8),%xmm2
movsd  %xmm2,(%rbx,%r8,8)
mov    0x8(%rcx,%rax,8),%rbx
movq   $0x0,(%rbx)
movq   $0x0,(%rbx,%r9,8)
lea    (%r11,%rax,1),%rbx
add    $0x2,%rbx
add    $0x2,%rax
cmp    $0x1,%rbx
jne    1220 <boundaryvalues+0x120>
test   $0x1,%r10b
je     12dc <boundaryvalues+0x1dc>
mov    (%rdx,%rax,8),%rbx
movsd  0x8(%rbx),%xmm0
xorps  0xd4e(%rip),%xmm0
movlps %xmm0,(%rbx)
movsd  0xd53(%rip),%xmm0
subsd  (%rbx,%r9,8),%xmm0
movsd  %xmm0,(%rbx,%r8,8)
mov    (%rcx,%rax,8),%rax
movq   $0x0,(%rax)
movq   $0x0,(%rax,%r9,8)
test   %esi,%esi
jle    13e3 <boundaryvalues+0x2e3>
mov    (%rdx),%rax
movslq %edi,%rbx
mov    (%rdx,%rbx,8),%rdx
mov    (%rcx),%r8
mov    0x8(%rcx),%rdi
mov    (%rcx,%rbx,8),%r9
mov    0x8(%rcx,%rbx,8),%r10
mov    %esi,%r11d
mov    $0x1,%ecx
cmp    $0x1,%esi
je     13a6 <boundaryvalues+0x2a6>
mov    %r11d,%esi
and    $0xfffffffe,%esi
neg    %rsi
mov    $0x1,%ecx
movapd 0xcdb(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movq   $0x0,(%rax,%rcx,8)
movq   $0x0,(%rdx,%rcx,8)
movsd  (%rdi,%rcx,8),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,(%r8,%rcx,8)
movsd  (%r9,%rcx,8),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,(%r10,%rcx,8)
movq   $0x0,0x8(%rax,%rcx,8)
movq   $0x0,0x8(%rdx,%rcx,8)
movsd  0x8(%rdi,%rcx,8),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,0x8(%r8,%rcx,8)
movsd  0x8(%r9,%rcx,8),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,0x8(%r10,%rcx,8)
lea    (%rsi,%rcx,1),%rbx
add    $0x2,%rbx
add    $0x2,%rcx
cmp    $0x1,%rbx
jne    1330 <boundaryvalues+0x230>
test   $0x1,%r11b
je     13e3 <boundaryvalues+0x2e3>
movq   $0x0,(%rax,%rcx,8)
movq   $0x0,(%rdx,%rcx,8)
movsd  (%rdi,%rcx,8),%xmm0
movapd 0xc37(%rip),%xmm1
xorpd  %xmm1,%xmm0
movlpd %xmm0,(%r8,%rcx,8)
movsd  (%r9,%rcx,8),%xmm0
xorpd  %xmm1,%xmm0
movlpd %xmm0,(%r10,%rcx,8)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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