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


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)
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115e <boundaryvalues+0x5e>
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    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1119 <boundaryvalues+0x19>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     11aa <boundaryvalues+0xaa>
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    1165 <boundaryvalues+0x65>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1249 <boundaryvalues+0x149>
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    11b1 <boundaryvalues+0xb1>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     12d9 <boundaryvalues+0x1d9>
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  0xd54(%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    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1250 <boundaryvalues+0x150>
pop    %rbp
ret

x86 assembly (clang, -O2):
<boundaryvalues>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %edi,%r13d
movslq %edi,%r8
test   %esi,%esi
jle    12ef <boundaryvalues+0x1ef>
mov    (%rdx),%r10
mov    (%rdx,%r8,8),%r15
mov    %esi,%r11d
lea    0x1(%r11),%r9
mov    $0x1,%eax
cmp    $0x4,%esi
jb     125d <boundaryvalues+0x15d>
lea    0x8(%r10),%rdi
lea    (%r15,%r9,8),%rbx
cmp    %rbx,%rdi
jae    1152 <boundaryvalues+0x52>
lea    (%r10,%r9,8),%rdi
lea    0x8(%r15),%rbx
cmp    %rdi,%rbx
jb     125d <boundaryvalues+0x15d>
mov    %r11d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rdi
mov    %rdi,%r12
shr    $0x2,%r12
add    $0x1,%r12
mov    %r12d,%r14d
and    $0x3,%r14d
cmp    $0xc,%rdi
jae    117b <boundaryvalues+0x7b>
xor    %ebx,%ebx
jmp    120a <boundaryvalues+0x10a>
and    $0xfffffffffffffffc,%r12
xor    %ebx,%ebx
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movupd %xmm0,0x8(%r10,%rbx,8)
movupd %xmm0,0x18(%r10,%rbx,8)
movupd %xmm0,0x8(%r15,%rbx,8)
movupd %xmm0,0x18(%r15,%rbx,8)
movupd %xmm0,0x28(%r10,%rbx,8)
movupd %xmm0,0x38(%r10,%rbx,8)
movupd %xmm0,0x28(%r15,%rbx,8)
movupd %xmm0,0x38(%r15,%rbx,8)
movupd %xmm0,0x48(%r10,%rbx,8)
movupd %xmm0,0x58(%r10,%rbx,8)
movupd %xmm0,0x48(%r15,%rbx,8)
movupd %xmm0,0x58(%r15,%rbx,8)
movupd %xmm0,0x68(%r10,%rbx,8)
movupd %xmm0,0x78(%r10,%rbx,8)
movupd %xmm0,0x68(%r15,%rbx,8)
movupd %xmm0,0x78(%r15,%rbx,8)
add    $0x10,%rbx
add    $0xfffffffffffffffc,%r12
jne    1190 <boundaryvalues+0x90>
test   %r14,%r14
je     1250 <boundaryvalues+0x150>
xorpd  %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x0(,%rbx,8),%rdi
or     $0x8,%rdi
movupd %xmm0,(%r10,%rdi,1)
movupd %xmm0,0x10(%r10,%rdi,1)
movupd %xmm0,(%r15,%rdi,1)
movupd %xmm0,0x10(%r15,%rdi,1)
add    $0x4,%rbx
add    $0xffffffffffffffff,%r14
jne    1220 <boundaryvalues+0x120>
cmp    %rax,%r11
je     12ef <boundaryvalues+0x1ef>
or     $0x1,%rax
mov    %r9d,%ebx
sub    %eax,%ebx
mov    %rax,%r11
not    %r11
add    %r9,%r11
and    $0x3,%rbx
je     129a <boundaryvalues+0x19a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movq   $0x0,(%r10,%rax,8)
movq   $0x0,(%r15,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rbx
jne    1280 <boundaryvalues+0x180>
cmp    $0x3,%r11
jb     12ef <boundaryvalues+0x1ef>
movq   $0x0,(%r10,%rax,8)
movq   $0x0,(%r15,%rax,8)
movq   $0x0,0x8(%r10,%rax,8)
movq   $0x0,0x8(%r15,%rax,8)
movq   $0x0,0x10(%r10,%rax,8)
movq   $0x0,0x10(%r15,%rax,8)
movq   $0x0,0x18(%r10,%rax,8)
movq   $0x0,0x18(%r15,%rax,8)
add    $0x4,%rax
cmp    %rax,%r9
jne    12a0 <boundaryvalues+0x1a0>
movslq %esi,%r12
test   %r13d,%r13d
jle    13ae <boundaryvalues+0x2ae>
mov    %r13d,%eax
lea    -0x1(%rax),%rdi
mov    %eax,%r9d
and    $0x3,%r9d
mov    $0x1,%ebx
cmp    $0x3,%rdi
jb     137d <boundaryvalues+0x27d>
and    $0xfffffffc,%eax
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x8(%rcx,%rbx,8),%rdi
movq   $0x0,(%rdi)
movq   $0x0,(%rdi,%r12,8)
mov    0x10(%rcx,%rbx,8),%rdi
movq   $0x0,(%rdi)
movq   $0x0,(%rdi,%r12,8)
mov    0x18(%rcx,%rbx,8),%rdi
movq   $0x0,(%rdi)
movq   $0x0,(%rdi,%r12,8)
mov    0x20(%rcx,%rbx,8),%rdi
movq   $0x0,(%rdi)
movq   $0x0,(%rdi,%r12,8)
add    $0x4,%rbx
cmp    %rbx,%rax
jne    1320 <boundaryvalues+0x220>
add    $0x1,%rbx
test   %r9,%r9
je     13ae <boundaryvalues+0x2ae>
lea    (%rcx,%rbx,8),%rax
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
mov    (%rax,%rdi,8),%rbp
movq   $0x0,0x0(%rbp)
movq   $0x0,0x0(%rbp,%r12,8)
add    $0x1,%rdi
cmp    %rdi,%r9
jne    1390 <boundaryvalues+0x290>
test   %esi,%esi
js     164d <boundaryvalues+0x54d>
mov    (%rcx),%r9
mov    0x8(%rcx),%r10
mov    (%rcx,%r8,8),%r11
mov    0x8(%rcx,%r8,8),%r14
lea    0x1(%rsi),%r8d
cmp    $0x3,%esi
jae    13d6 <boundaryvalues+0x2d6>
xor    %ebx,%ebx
jmp    15b5 <boundaryvalues+0x4b5>
mov    %r13,-0x8(%rsp)
lea    (%r9,%r8,8),%rdi
lea    (%r14,%r8,8),%rbx
lea    (%r10,%r8,8),%rbp
lea    (%r11,%r8,8),%rcx
cmp    %rbx,%r9
setb   -0x9(%rsp)
cmp    %rdi,%r14
setb   -0xa(%rsp)
cmp    %rbp,%r9
setb   %al
cmp    %rdi,%r10
setb   -0xb(%rsp)
cmp    %rcx,%r9
setb   %r13b
cmp    %rdi,%r11
setb   %dil
cmp    %rbp,%r14
setb   %bpl
cmp    %rbx,%r10
setb   -0xc(%rsp)
cmp    %rcx,%r14
setb   %r15b
cmp    %rbx,%r11
setb   -0xd(%rsp)
xor    %ebx,%ebx
mov    -0xa(%rsp),%cl
test   %cl,-0x9(%rsp)
jne    15b0 <boundaryvalues+0x4b0>
and    -0xb(%rsp),%al
jne    15b0 <boundaryvalues+0x4b0>
and    %dil,%r13b
jne    15b0 <boundaryvalues+0x4b0>
and    -0xc(%rsp),%bpl
mov    -0x8(%rsp),%r13
jne    15b5 <boundaryvalues+0x4b5>
and    -0xd(%rsp),%r15b
jne    15b5 <boundaryvalues+0x4b5>
mov    %r8d,%ebx
and    $0xfffffffc,%ebx
lea    -0x4(%rbx),%rax
mov    %rax,%r15
shr    $0x2,%r15
add    $0x1,%r15
test   %rax,%rax
je     15a6 <boundaryvalues+0x4a6>
movabs $0x7ffffffffffffffc,%rax
ff ff 7f
or     $0x2,%rax
and    %r15,%rax
xor    %ecx,%ecx
movapd 0xb54(%rip),%xmm0
nopl   0x0(%rax)
movupd (%r10,%rcx,8),%xmm1
movupd 0x10(%r10,%rcx,8),%xmm2
xorpd  %xmm0,%xmm1
xorpd  %xmm0,%xmm2
movupd %xmm1,(%r9,%rcx,8)
movupd %xmm2,0x10(%r9,%rcx,8)
movupd (%r11,%rcx,8),%xmm1
movupd 0x10(%r11,%rcx,8),%xmm2
xorpd  %xmm0,%xmm1
xorpd  %xmm0,%xmm2
movupd %xmm1,(%r14,%rcx,8)
movupd %xmm2,0x10(%r14,%rcx,8)
movupd 0x20(%r10,%rcx,8),%xmm1
movupd 0x30(%r10,%rcx,8),%xmm2
xorpd  %xmm0,%xmm1
xorpd  %xmm0,%xmm2
movupd %xmm1,0x20(%r9,%rcx,8)
movupd %xmm2,0x30(%r9,%rcx,8)
movupd 0x20(%r11,%rcx,8),%xmm1
movupd 0x30(%r11,%rcx,8),%xmm2
xorpd  %xmm0,%xmm1
xorpd  %xmm0,%xmm2
movupd %xmm1,0x20(%r14,%rcx,8)
movupd %xmm2,0x30(%r14,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rax
jne    14b0 <boundaryvalues+0x3b0>
test   $0x1,%r15b
je     159c <boundaryvalues+0x49c>
movupd (%r10,%rcx,8),%xmm0
movupd 0x10(%r10,%rcx,8),%xmm1
movapd 0xa9b(%rip),%xmm2
xorpd  %xmm2,%xmm0
xorpd  %xmm2,%xmm1
movupd %xmm0,(%r9,%rcx,8)
movupd %xmm1,0x10(%r9,%rcx,8)
movupd (%r11,%rcx,8),%xmm0
movupd 0x10(%r11,%rcx,8),%xmm1
xorpd  %xmm2,%xmm0
xorpd  %xmm2,%xmm1
movupd %xmm0,(%r14,%rcx,8)
movupd %xmm1,0x10(%r14,%rcx,8)
cmp    %r8,%rbx
jne    15b5 <boundaryvalues+0x4b5>
jmp    164d <boundaryvalues+0x54d>
xor    %ecx,%ecx
test   $0x1,%r15b
jne    1550 <boundaryvalues+0x450>
jmp    159c <boundaryvalues+0x49c>
mov    -0x8(%rsp),%r13
mov    %rbx,%rax
not    %rax
test   $0x1,%r8b
je     15ed <boundaryvalues+0x4ed>
movsd  (%r10,%rbx,8),%xmm0
movapd 0xa31(%rip),%xmm1
xorpd  %xmm1,%xmm0
movlpd %xmm0,(%r9,%rbx,8)
movsd  (%r11,%rbx,8),%xmm0
xorpd  %xmm1,%xmm0
movlpd %xmm0,(%r14,%rbx,8)
or     $0x1,%rbx
add    %r8,%rax
je     164d <boundaryvalues+0x54d>
movapd 0xa06(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
movsd  (%r10,%rbx,8),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,(%r9,%rbx,8)
movsd  (%r11,%rbx,8),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,(%r14,%rbx,8)
movsd  0x8(%r10,%rbx,8),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,0x8(%r9,%rbx,8)
movsd  0x8(%r11,%rbx,8),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,0x8(%r14,%rbx,8)
add    $0x2,%rbx
cmp    %rbx,%r8
jne    1600 <boundaryvalues+0x500>
test   %r13d,%r13d
js     16fa <boundaryvalues+0x5fa>
add    $0x1,%esi
movslq %esi,%rcx
lea    0x1(%r13),%eax
test   %r13d,%r13d
je     1705 <boundaryvalues+0x605>
mov    %eax,%edi
and    $0xfffffffe,%edi
xor    %esi,%esi
movapd 0x988(%rip),%xmm0
movsd  0x990(%rip),%xmm1
mov    (%rdx,%rsi,8),%rbp
movsd  0x8(%rbp),%xmm2
xorpd  %xmm0,%xmm2
movlpd %xmm2,0x0(%rbp)
movapd %xmm1,%xmm2
subsd  0x0(%rbp,%r12,8),%xmm2
movsd  %xmm2,0x0(%rbp,%rcx,8)
mov    0x8(%rdx,%rsi,8),%rbp
movsd  0x8(%rbp),%xmm2
xorpd  %xmm0,%xmm2
movlpd %xmm2,0x0(%rbp)
movapd %xmm1,%xmm2
subsd  0x0(%rbp,%r12,8),%xmm2
movsd  %xmm2,0x0(%rbp,%rcx,8)
add    $0x2,%rsi
cmp    %rsi,%rdi
jne    1680 <boundaryvalues+0x580>
test   $0x1,%al
je     16fa <boundaryvalues+0x5fa>
mov    (%rdx,%rsi,8),%rax
movsd  0x8(%rax),%xmm0
xorps  0x91c(%rip),%xmm0
movlps %xmm0,(%rax)
movsd  0x921(%rip),%xmm0
subsd  (%rax,%r12,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%al
jne    16d4 <boundaryvalues+0x5d4>
jmp    16fa <boundaryvalues+0x5fa>

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
store i32 1, i32* %10
br label %11
11: ; preds = %30, %4
%12 = load i32, i32* %10
%13 = load i32, i32* %6
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %33
15: ; preds = %11
%16 = load double**, double*** %7
%17 = getelementptr inbounds double*, double** %16, i64 0
%18 = load double*, double** %17
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
store double 0.000000e+00, double* %21
%22 = load double**, double*** %7
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double*, double** %22, i64 %24
%26 = load double*, double** %25
%27 = load i32, i32* %10
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %26, i64 %28
store double 0.000000e+00, double* %29
br label %30
30: ; preds = %15
%31 = load i32, i32* %10
%32 = add nsw i32 %31, 1
store i32 %32, i32* %10
br label %11
33: ; preds = %11
store i32 1, i32* %9
br label %34
34: ; preds = %53, %33
%35 = load i32, i32* %9
%36 = load i32, i32* %5
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %56
38: ; preds = %34
%39 = load double**, double*** %8
%40 = load i32, i32* %9
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds double*, double** %39, i64 %41
%43 = load double*, double** %42
%44 = getelementptr inbounds double, double* %43, i64 0
store double 0.000000e+00, double* %44
%45 = load double**, double*** %8
%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* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
store double 0.000000e+00, double* %52
br label %53
53: ; preds = %38
%54 = load i32, i32* %9
%55 = add nsw i32 %54, 1
store i32 %55, i32* %9
br label %34
56: ; preds = %34
store i32 0, i32* %10
br label %57
57: ; preds = %95, %56
%58 = load i32, i32* %10
%59 = load i32, i32* %6
%60 = icmp sle i32 %58, %59
br i1 %60, label %61, label %98
61: ; preds = %57
%62 = load double**, double*** %8
%63 = getelementptr inbounds double*, double** %62, i64 1
%64 = load double*, double** %63
%65 = load i32, i32* %10
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
%68 = load double, double* %67
%69 = fneg double %68
%70 = load double**, double*** %8
%71 = getelementptr inbounds double*, double** %70, i64 0
%72 = load double*, double** %71
%73 = load i32, i32* %10
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %72, i64 %74
store double %69, double* %75
%76 = load double**, double*** %8
%77 = load i32, i32* %5
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double*, double** %76, i64 %78
%80 = load double*, double** %79
%81 = load i32, i32* %10
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
%84 = load double, double* %83
%85 = fneg double %84
%86 = load double**, double*** %8
%87 = load i32, i32* %5
%88 = add nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double*, double** %86, i64 %89
%91 = load double*, double** %90
%92 = load i32, i32* %10
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %91, i64 %93
store double %85, double* %94
br label %95
95: ; preds = %61
%96 = load i32, i32* %10
%97 = add nsw i32 %96, 1
store i32 %97, i32* %10
br label %57
98: ; preds = %57
store i32 0, i32* %9
br label %99
99: ; preds = %137, %98
%100 = load i32, i32* %9
%101 = load i32, i32* %5
%102 = icmp sle i32 %100, %101
br i1 %102, label %103, label %140
103: ; preds = %99
%104 = load double**, double*** %7
%105 = load i32, i32* %9
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double*, double** %104, i64 %106
%108 = load double*, double** %107
%109 = getelementptr inbounds double, double* %108, i64 1
%110 = load double, double* %109
%111 = fneg double %110
%112 = load double**, double*** %7
%113 = load i32, i32* %9
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double*, double** %112, i64 %114
%116 = load double*, double** %115
%117 = getelementptr inbounds double, double* %116, i64 0
store double %111, double* %117
%118 = load double**, double*** %7
%119 = load i32, i32* %9
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double*, double** %118, i64 %120
%122 = load double*, double** %121
%123 = load i32, i32* %6
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds double, double* %122, i64 %124
%126 = load double, double* %125
%127 = fsub double 2.000000e+00, %126
%128 = load double**, double*** %7
%129 = load i32, i32* %9
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double*, double** %128, i64 %130
%132 = load double*, double** %131
%133 = load i32, i32* %6
%134 = add nsw i32 %133, 1
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %132, i64 %135
store double %127, double* %136
br label %137
137: ; preds = %103
%138 = load i32, i32* %9
%139 = add nsw i32 %138, 1
store i32 %139, i32* %9
br label %99
140: ; preds = %99
ret void
}

LLVM IR (-O2):
define void @boundaryvalues(i32 %0, i32 %1, double** nocapture %2, double** nocapture %3) {
%5 = icmp slt i32 %1, 1
br i1 %5, label %113, label %6
6: ; preds = %4
%7 = load double*, double** %2
%8 = sext i32 %0 to i64
%9 = getelementptr inbounds double*, double** %2, i64 %8
%10 = load double*, double** %9
%11 = add nuw i32 %1, 1
%12 = zext i32 %11 to i64
%13 = add nsw i64 %12, -1
%14 = icmp ult i64 %13, 4
br i1 %14, label %95, label %15
15: ; preds = %6
%16 = getelementptr double, double* %7, i64 1
%17 = getelementptr double, double* %7, i64 %12
%18 = getelementptr double, double* %10, i64 1
%19 = getelementptr double, double* %10, i64 %12
%20 = icmp ult double* %16, %19
%21 = icmp ult double* %18, %17
%22 = and i1 %20, %21
br i1 %22, label %95, label %23
23: ; preds = %15
%24 = and i64 %13, -4
%25 = or i64 %24, 1
%26 = add nsw i64 %24, -4
%27 = lshr exact i64 %26, 2
%28 = add nuw nsw i64 %27, 1
%29 = and i64 %28, 3
%30 = icmp ult i64 %26, 12
br i1 %30, label %75, label %31
31: ; preds = %23
%32 = and i64 %28, 9223372036854775804
br label %33
33: ; preds = %33, %31
%34 = phi i64 [ 0, %31 ], [ %72, %33 ]
%35 = phi i64 [ 0, %31 ], [ %73, %33 ]
%36 = or i64 %34, 1
%37 = getelementptr inbounds double, double* %7, i64 %36
%38 = bitcast double* %37 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %38
%39 = getelementptr inbounds double, double* %37, i64 2
%40 = bitcast double* %39 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %40
%41 = getelementptr inbounds double, double* %10, i64 %36
%42 = bitcast double* %41 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %42
%43 = getelementptr inbounds double, double* %41, i64 2
%44 = bitcast double* %43 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %44
%45 = or i64 %34, 5
%46 = getelementptr inbounds double, double* %7, i64 %45
%47 = bitcast double* %46 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %47
%48 = getelementptr inbounds double, double* %46, i64 2
%49 = bitcast double* %48 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %49
%50 = getelementptr inbounds double, double* %10, i64 %45
%51 = bitcast double* %50 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %51
%52 = getelementptr inbounds double, double* %50, i64 2
%53 = bitcast double* %52 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %53
%54 = or i64 %34, 9
%55 = getelementptr inbounds double, double* %7, i64 %54
%56 = bitcast double* %55 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %56
%57 = getelementptr inbounds double, double* %55, i64 2
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %58
%59 = getelementptr inbounds double, double* %10, i64 %54
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %60
%61 = getelementptr inbounds double, double* %59, i64 2
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %62
%63 = or i64 %34, 13
%64 = getelementptr inbounds double, double* %7, i64 %63
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %65
%66 = getelementptr inbounds double, double* %64, i64 2
%67 = bitcast double* %66 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %67
%68 = getelementptr inbounds double, double* %10, i64 %63
%69 = bitcast double* %68 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %69
%70 = getelementptr inbounds double, double* %68, i64 2
%71 = bitcast double* %70 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %71
%72 = add nuw i64 %34, 16
%73 = add nuw i64 %35, 4
%74 = icmp eq i64 %73, %32
br i1 %74, label %75, label %33
75: ; preds = %33, %23
%76 = phi i64 [ 0, %23 ], [ %72, %33 ]
%77 = icmp eq i64 %29, 0
br i1 %77, label %93, label %78
78: ; preds = %75, %78
%79 = phi i64 [ %90, %78 ], [ %76, %75 ]
%80 = phi i64 [ %91, %78 ], [ 0, %75 ]
%81 = or i64 %79, 1
%82 = getelementptr inbounds double, double* %7, i64 %81
%83 = bitcast double* %82 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %83
%84 = getelementptr inbounds double, double* %82, i64 2
%85 = bitcast double* %84 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %85
%86 = getelementptr inbounds double, double* %10, i64 %81
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %87
%88 = getelementptr inbounds double, double* %86, i64 2
%89 = bitcast double* %88 to <2 x double>*
store <2 x double> zeroinitializer, <2 x double>* %89
%90 = add nuw i64 %79, 4
%91 = add i64 %80, 1
%92 = icmp eq i64 %91, %29
br i1 %92, label %93, label %78
93: ; preds = %78, %75
%94 = icmp eq i64 %13, %24
br i1 %94, label %113, label %95
95: ; preds = %15, %6, %93
%96 = phi i64 [ 1, %15 ], [ 1, %6 ], [ %25, %93 ]
%97 = sub nsw i64 %12, %96
%98 = xor i64 %96, -1
%99 = add nsw i64 %98, %12
%100 = and i64 %97, 3
%101 = icmp eq i64 %100, 0
br i1 %101, label %110, label %102
102: ; preds = %95, %102
%103 = phi i64 [ %107, %102 ], [ %96, %95 ]
%104 = phi i64 [ %108, %102 ], [ 0, %95 ]
%105 = getelementptr inbounds double, double* %7, i64 %103
store double 0.000000e+00, double* %105
%106 = getelementptr inbounds double, double* %10, i64 %103
store double 0.000000e+00, double* %106
%107 = add nuw nsw i64 %103, 1
%108 = add i64 %104, 1
%109 = icmp eq i64 %108, %100
br i1 %109, label %110, label %102
110: ; preds = %102, %95
%111 = phi i64 [ %96, %95 ], [ %107, %102 ]
%112 = icmp ult i64 %99, 3
br i1 %112, label %113, label %125
113: ; preds = %110, %125, %93, %4
%114 = icmp slt i32 %0, 1
br i1 %114, label %152, label %115
115: ; preds = %113
%116 = sext i32 %1 to i64
%117 = add nuw i32 %0, 1
%118 = zext i32 %117 to i64
%119 = add nsw i64 %118, -1
%120 = add nsw i64 %118, -2
%121 = and i64 %119, 3
%122 = icmp ult i64 %120, 3
br i1 %122, label %140, label %123
123: ; preds = %115
%124 = and i64 %119, -4
br label %305
125: ; preds = %110, %125
%126 = phi i64 [ %138, %125 ], [ %111, %110 ]
%127 = getelementptr inbounds double, double* %7, i64 %126
store double 0.000000e+00, double* %127
%128 = getelementptr inbounds double, double* %10, i64 %126
store double 0.000000e+00, double* %128
%129 = add nuw nsw i64 %126, 1
%130 = getelementptr inbounds double, double* %7, i64 %129
store double 0.000000e+00, double* %130
%131 = getelementptr inbounds double, double* %10, i64 %129
store double 0.000000e+00, double* %131
%132 = add nuw nsw i64 %126, 2
%133 = getelementptr inbounds double, double* %7, i64 %132
store double 0.000000e+00, double* %133
%134 = getelementptr inbounds double, double* %10, i64 %132
store double 0.000000e+00, double* %134
%135 = add nuw nsw i64 %126, 3
%136 = getelementptr inbounds double, double* %7, i64 %135
store double 0.000000e+00, double* %136
%137 = getelementptr inbounds double, double* %10, i64 %135
store double 0.000000e+00, double* %137
%138 = add nuw nsw i64 %126, 4
%139 = icmp eq i64 %138, %12
br i1 %139, label %113, label %125
140: ; preds = %305, %115
%141 = phi i64 [ 1, %115 ], [ %323, %305 ]
%142 = icmp eq i64 %121, 0
br i1 %142, label %152, label %143
143: ; preds = %140, %143
%144 = phi i64 [ %149, %143 ], [ %141, %140 ]
%145 = phi i64 [ %150, %143 ], [ 0, %140 ]
%146 = getelementptr inbounds double*, double** %3, i64 %144
%147 = load double*, double** %146
store double 0.000000e+00, double* %147
%148 = getelementptr inbounds double, double* %147, i64 %116
store double 0.000000e+00, double* %148
%149 = add nuw nsw i64 %144, 1
%150 = add i64 %145, 1
%151 = icmp eq i64 %150, %121
br i1 %151, label %152, label %143
152: ; preds = %140, %143, %113
%153 = icmp slt i32 %1, 0
br i1 %153, label %326, label %154
154: ; preds = %152
%155 = getelementptr inbounds double*, double** %3, i64 1
%156 = load double*, double** %155
%157 = load double*, double** %3
%158 = sext i32 %0 to i64
%159 = getelementptr inbounds double*, double** %3, i64 %158
%160 = load double*, double** %159
%161 = add nsw i32 %0, 1
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds double*, double** %3, i64 %162
%164 = load double*, double** %163
%165 = add nuw i32 %1, 1
%166 = zext i32 %165 to i64
%167 = icmp ult i32 %1, 3
br i1 %167, label %286, label %168
168: ; preds = %154
%169 = getelementptr double, double* %157, i64 %166
%170 = getelementptr double, double* %164, i64 %166
%171 = getelementptr double, double* %156, i64 %166
%172 = getelementptr double, double* %160, i64 %166
%173 = icmp ult double* %157, %170
%174 = icmp ult double* %164, %169
%175 = and i1 %173, %174
%176 = icmp ult double* %157, %171
%177 = icmp ult double* %156, %169
%178 = and i1 %176, %177
%179 = or i1 %175, %178
%180 = icmp ult double* %157, %172
%181 = icmp ult double* %160, %169
%182 = and i1 %180, %181
%183 = or i1 %179, %182
%184 = icmp ult double* %164, %171
%185 = icmp ult double* %156, %170
%186 = and i1 %184, %185
%187 = or i1 %183, %186
%188 = icmp ult double* %164, %172
%189 = icmp ult double* %160, %170
%190 = and i1 %188, %189
%191 = or i1 %187, %190
br i1 %191, label %286, label %192
192: ; preds = %168
%193 = and i64 %166, 4294967292
%194 = add nsw i64 %193, -4
%195 = lshr exact i64 %194, 2
%196 = add nuw nsw i64 %195, 1
%197 = and i64 %196, 1
%198 = icmp eq i64 %194, 0
br i1 %198, label %256, label %199
199: ; preds = %192
%200 = and i64 %196, 9223372036854775806
br label %201
201: ; preds = %201, %199
%202 = phi i64 [ 0, %199 ], [ %253, %201 ]
%203 = phi i64 [ 0, %199 ], [ %254, %201 ]
%204 = getelementptr inbounds double, double* %156, i64 %202
%205 = bitcast double* %204 to <2 x double>*
%206 = load <2 x double>, <2 x double>* %205
%207 = getelementptr inbounds double, double* %204, i64 2
%208 = bitcast double* %207 to <2 x double>*
%209 = load <2 x double>, <2 x double>* %208
%210 = fneg <2 x double> %206
%211 = fneg <2 x double> %209
%212 = getelementptr inbounds double, double* %157, i64 %202
%213 = bitcast double* %212 to <2 x double>*
store <2 x double> %210, <2 x double>* %213
%214 = getelementptr inbounds double, double* %212, i64 2
%215 = bitcast double* %214 to <2 x double>*
store <2 x double> %211, <2 x double>* %215
%216 = getelementptr inbounds double, double* %160, i64 %202
%217 = bitcast double* %216 to <2 x double>*
%218 = load <2 x double>, <2 x double>* %217
%219 = getelementptr inbounds double, double* %216, i64 2
%220 = bitcast double* %219 to <2 x double>*
%221 = load <2 x double>, <2 x double>* %220
%222 = fneg <2 x double> %218
%223 = fneg <2 x double> %221
%224 = getelementptr inbounds double, double* %164, i64 %202
%225 = bitcast double* %224 to <2 x double>*
store <2 x double> %222, <2 x double>* %225
%226 = getelementptr inbounds double, double* %224, i64 2
%227 = bitcast double* %226 to <2 x double>*
store <2 x double> %223, <2 x double>* %227
%228 = or i64 %202, 4
%229 = getelementptr inbounds double, double* %156, i64 %228
%230 = bitcast double* %229 to <2 x double>*
%231 = load <2 x double>, <2 x double>* %230
%232 = getelementptr inbounds double, double* %229, i64 2
%233 = bitcast double* %232 to <2 x double>*
%234 = load <2 x double>, <2 x double>* %233
%235 = fneg <2 x double> %231
%236 = fneg <2 x double> %234
%237 = getelementptr inbounds double, double* %157, i64 %228
%238 = bitcast double* %237 to <2 x double>*
store <2 x double> %235, <2 x double>* %238
%239 = getelementptr inbounds double, double* %237, i64 2
%240 = bitcast double* %239 to <2 x double>*
store <2 x double> %236, <2 x double>* %240
%241 = getelementptr inbounds double, double* %160, i64 %228
%242 = bitcast double* %241 to <2 x double>*
%243 = load <2 x double>, <2 x double>* %242
%244 = getelementptr inbounds double, double* %241, i64 2
%245 = bitcast double* %244 to <2 x double>*
%246 = load <2 x double>, <2 x double>* %245
%247 = fneg <2 x double> %243
%248 = fneg <2 x double> %246
%249 = getelementptr inbounds double, double* %164, i64 %228
%250 = bitcast double* %249 to <2 x double>*
store <2 x double> %247, <2 x double>* %250
%251 = getelementptr inbounds double, double* %249, i64 2
%252 = bitcast double* %251 to <2 x double>*
store <2 x double> %248, <2 x double>* %252
%253 = add nuw i64 %202, 8
%254 = add i64 %203, 2
%255 = icmp eq i64 %254, %200
br i1 %255, label %256, label %201
256: ; preds = %201, %192
%257 = phi i64 [ 0, %192 ], [ %253, %201 ]
%258 = icmp eq i64 %197, 0
br i1 %258, label %284, label %259
259: ; preds = %256
%260 = getelementptr inbounds double, double* %156, i64 %257
%261 = bitcast double* %260 to <2 x double>*
%262 = load <2 x double>, <2 x double>* %261
%263 = getelementptr inbounds double, double* %260, i64 2
%264 = bitcast double* %263 to <2 x double>*
%265 = load <2 x double>, <2 x double>* %264
%266 = fneg <2 x double> %262
%267 = fneg <2 x double> %265
%268 = getelementptr inbounds double, double* %157, i64 %257
%269 = bitcast double* %268 to <2 x double>*
store <2 x double> %266, <2 x double>* %269
%270 = getelementptr inbounds double, double* %268, i64 2
%271 = bitcast double* %270 to <2 x double>*
store <2 x double> %267, <2 x double>* %271
%272 = getelementptr inbounds double, double* %160, i64 %257
%273 = bitcast double* %272 to <2 x double>*
%274 = load <2 x double>, <2 x double>* %273
%275 = getelementptr inbounds double, double* %272, i64 2
%276 = bitcast double* %275 to <2 x double>*
%277 = load <2 x double>, <2 x double>* %276
%278 = fneg <2 x double> %274
%279 = fneg <2 x double> %277
%280 = getelementptr inbounds double, double* %164, i64 %257
%281 = bitcast double* %280 to <2 x double>*
store <2 x double> %278, <2 x double>* %281
%282 = getelementptr inbounds double, double* %280, i64 2
%283 = bitcast double* %282 to <2 x double>*
store <2 x double> %279, <2 x double>* %283
br label %284
284: ; preds = %256, %259
%285 = icmp eq i64 %193, %166
br i1 %285, label %326, label %286
286: ; preds = %168, %154, %284
%287 = phi i64 [ 0, %168 ], [ 0, %154 ], [ %193, %284 ]
%288 = xor i64 %287, -1
%289 = and i64 %166, 1
%290 = icmp eq i64 %289, 0
br i1 %290, label %301, label %291
291: ; preds = %286
%292 = getelementptr inbounds double, double* %156, i64 %287
%293 = load double, double* %292
%294 = fneg double %293
%295 = getelementptr inbounds double, double* %157, i64 %287
store double %294, double* %295
%296 = getelementptr inbounds double, double* %160, i64 %287
%297 = load double, double* %296
%298 = fneg double %297
%299 = getelementptr inbounds double, double* %164, i64 %287
store double %298, double* %299
%300 = or i64 %287, 1
br label %301
301: ; preds = %291, %286
%302 = phi i64 [ %287, %286 ], [ %300, %291 ]
%303 = sub nsw i64 0, %166
%304 = icmp eq i64 %288, %303
br i1 %304, label %326, label %338
305: ; preds = %305, %123
%306 = phi i64 [ 1, %123 ], [ %323, %305 ]
%307 = phi i64 [ 0, %123 ], [ %324, %305 ]
%308 = getelementptr inbounds double*, double** %3, i64 %306
%309 = load double*, double** %308
store double 0.000000e+00, double* %309
%310 = getelementptr inbounds double, double* %309, i64 %116
store double 0.000000e+00, double* %310
%311 = add nuw nsw i64 %306, 1
%312 = getelementptr inbounds double*, double** %3, i64 %311
%313 = load double*, double** %312
store double 0.000000e+00, double* %313
%314 = getelementptr inbounds double, double* %313, i64 %116
store double 0.000000e+00, double* %314
%315 = add nuw nsw i64 %306, 2
%316 = getelementptr inbounds double*, double** %3, i64 %315
%317 = load double*, double** %316
store double 0.000000e+00, double* %317
%318 = getelementptr inbounds double, double* %317, i64 %116
store double 0.000000e+00, double* %318
%319 = add nuw nsw i64 %306, 3
%320 = getelementptr inbounds double*, double** %3, i64 %319
%321 = load double*, double** %320
store double 0.000000e+00, double* %321
%322 = getelementptr inbounds double, double* %321, i64 %116
store double 0.000000e+00, double* %322
%323 = add nuw nsw i64 %306, 4
%324 = add i64 %307, 4
%325 = icmp eq i64 %324, %124
br i1 %325, label %140, label %305
326: ; preds = %301, %338, %284, %152
%327 = icmp slt i32 %0, 0
br i1 %327, label %397, label %328
328: ; preds = %326
%329 = sext i32 %1 to i64
%330 = add nsw i32 %1, 1
%331 = sext i32 %330 to i64
%332 = add nuw i32 %0, 1
%333 = zext i32 %332 to i64
%334 = and i64 %333, 1
%335 = icmp eq i32 %0, 0
br i1 %335, label %384, label %336
336: ; preds = %328
%337 = and i64 %333, 4294967294
br label %359
338: ; preds = %301, %338
%339 = phi i64 [ %357, %338 ], [ %302, %301 ]
%340 = getelementptr inbounds double, double* %156, i64 %339
%341 = load double, double* %340
%342 = fneg double %341
%343 = getelementptr inbounds double, double* %157, i64 %339
store double %342, double* %343
%344 = getelementptr inbounds double, double* %160, i64 %339
%345 = load double, double* %344
%346 = fneg double %345
%347 = getelementptr inbounds double, double* %164, i64 %339
store double %346, double* %347
%348 = add nuw nsw i64 %339, 1
%349 = getelementptr inbounds double, double* %156, i64 %348
%350 = load double, double* %349
%351 = fneg double %350
%352 = getelementptr inbounds double, double* %157, i64 %348
store double %351, double* %352
%353 = getelementptr inbounds double, double* %160, i64 %348
%354 = load double, double* %353
%355 = fneg double %354
%356 = getelementptr inbounds double, double* %164, i64 %348
store double %355, double* %356
%357 = add nuw nsw i64 %339, 2
%358 = icmp eq i64 %357, %166
br i1 %358, label %326, label %338
359: ; preds = %359, %336
%360 = phi i64 [ 0, %336 ], [ %381, %359 ]
%361 = phi i64 [ 0, %336 ], [ %382, %359 ]
%362 = getelementptr inbounds double*, double** %2, i64 %360
%363 = load double*, double** %362
%364 = getelementptr inbounds double, double* %363, i64 1
%365 = load double, double* %364
%366 = fneg double %365
store double %366, double* %363
%367 = getelementptr inbounds double, double* %363, i64 %329
%368 = load double, double* %367
%369 = fsub double 2.000000e+00, %368
%370 = getelementptr inbounds double, double* %363, i64 %331
store double %369, double* %370
%371 = or i64 %360, 1
%372 = getelementptr inbounds double*, double** %2, i64 %371
%373 = load double*, double** %372
%374 = getelementptr inbounds double, double* %373, i64 1
%375 = load double, double* %374
%376 = fneg double %375
store double %376, double* %373
%377 = getelementptr inbounds double, double* %373, i64 %329
%378 = load double, double* %377
%379 = fsub double 2.000000e+00, %378
%380 = getelementptr inbounds double, double* %373, i64 %331
store double %379, double* %380
%381 = add nuw nsw i64 %360, 2
%382 = add i64 %361, 2
%383 = icmp eq i64 %382, %337
br i1 %383, label %384, label %359
384: ; preds = %359, %328
%385 = phi i64 [ 0, %328 ], [ %381, %359 ]
%386 = icmp eq i64 %334, 0
br i1 %386, label %397, label %387
387: ; preds = %384
%388 = getelementptr inbounds double*, double** %2, i64 %385
%389 = load double*, double** %388
%390 = getelementptr inbounds double, double* %389, i64 1
%391 = load double, double* %390
%392 = fneg double %391
store double %392, double* %389
%393 = getelementptr inbounds double, double* %389, i64 %329
%394 = load double, double* %393
%395 = fsub double 2.000000e+00, %394
%396 = getelementptr inbounds double, double* %389, i64 %331
store double %395, double* %396
br label %397
397: ; preds = %387, %384, %326
ret void
}