void kernel_jacobi_2d(int tsteps, int n, double A[1300 + 0][1300 + 0],
                      double B[1300 + 0][1300 + 0]) {
  int t, i, j;
#pragma scop
  for (t = 0; t < tsteps; t++) {
    for (i = 1; i < n - 1; i++)
      for (j = 1; j < n - 1; j++)
        B[i][j] = 0.2 * (A[i][j] + A[i][j - 1] + A[i][1 + j] + A[1 + i][j] +
                         A[i - 1][j]);
    for (i = 1; i < n - 1; i++)
      for (j = 1; j < n - 1; j++)
        A[i][j] = 0.2 * (B[i][j] + B[i][j - 1] + B[i][1 + j] + B[1 + i][j] +
                         B[i - 1][j]);
  }
#pragma endscop
}


x86 assembly (clang, -O0):
<kernel_jacobi_2d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    135e <kernel_jacobi_2d+0x25e>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1238 <kernel_jacobi_2d+0x138>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1225 <kernel_jacobi_2d+0x125>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xe08(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1144 <kernel_jacobi_2d+0x44>
jmp    122a <kernel_jacobi_2d+0x12a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112c <kernel_jacobi_2d+0x2c>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    134b <kernel_jacobi_2d+0x24b>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1338 <kernel_jacobi_2d+0x238>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  0xcf5(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x28a0,%rcx,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1257 <kernel_jacobi_2d+0x157>
jmp    133d <kernel_jacobi_2d+0x23d>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    123f <kernel_jacobi_2d+0x13f>
jmp    1350 <kernel_jacobi_2d+0x250>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1119 <kernel_jacobi_2d+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_jacobi_2d>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,-0x50(%rsp)
mov    %edi,-0x44(%rsp)
test   %edi,%edi
jle    14fe <kernel_jacobi_2d+0x3fe>
mov    -0x50(%rsp),%rax
add    $0xffffffff,%eax
lea    -0x1(%rax),%r8
mov    %r8,%r9
and    $0xfffffffffffffffc,%r9
lea    0x1(%r9),%rsi
mov    %rsi,-0x30(%rsp)
lea    0x5158(%rdx),%rsi
mov    %rsi,-0x10(%rsp)
lea    0x28b8(%rcx),%rsi
mov    %rsi,-0x18(%rsp)
lea    0x28a0(%rcx),%rsi
mov    %rsi,-0x38(%rsp)
lea    0x28a0(%rdx),%rsi
mov    %rsi,-0x40(%rsp)
lea    0x5158(%rcx),%rsi
mov    %rsi,-0x20(%rsp)
lea    0x28b8(%rdx),%rsi
mov    %rsi,-0x28(%rsp)
xor    %esi,%esi
movsd  0xe87(%rip),%xmm0
movapd 0xe6f(%rip),%xmm1
jmp    11b2 <kernel_jacobi_2d+0xb2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x8(%rsp),%rsi
add    $0x1,%esi
cmp    -0x44(%rsp),%esi
je     14fe <kernel_jacobi_2d+0x3fe>
mov    %rsi,-0x8(%rsp)
cmpl   $0x3,-0x50(%rsp)
jl     11a0 <kernel_jacobi_2d+0xa0>
mov    $0x1,%esi
mov    -0x40(%rsp),%rbx
mov    -0x38(%rsp),%r15
mov    -0x18(%rsp),%rbp
mov    -0x10(%rsp),%r14
xor    %r13d,%r13d
jmp    120c <kernel_jacobi_2d+0x10c>
nopl   0x0(%rax)
add    $0x1,%r13
add    $0x28a0,%r14
add    $0x28a0,%rbp
add    $0x28a0,%r15
add    $0x28a0,%rbx
mov    %r12,%rsi
cmp    %rax,%r12
je     1360 <kernel_jacobi_2d+0x260>
lea    0x1(%rsi),%r12
mov    $0x1,%edi
cmp    $0x4,%r8
jb     1320 <kernel_jacobi_2d+0x220>
imul   $0x28a0,%r13,%r10
lea    (%rdx,%r10,1),%rdi
lea    (%rdi,%rax,8),%rdi
add    $0x5140,%rdi
imul   $0x28a0,%rsi,%rsi
lea    (%rcx,%rsi,1),%r11
add    $0x8,%r11
cmp    %rdi,%r11
jae    1265 <kernel_jacobi_2d+0x165>
add    %rdx,%r10
add    $0x8,%r10
add    %rcx,%rsi
lea    (%rsi,%rax,8),%rsi
mov    $0x1,%edi
cmp    %rsi,%r10
jb     1320 <kernel_jacobi_2d+0x220>
xor    %r10d,%r10d
nopl   0x0(%rax,%rax,1)
movupd -0x28b0(%r14,%r10,8),%xmm2
d7 ff ff
movupd -0x28a0(%r14,%r10,8),%xmm3
d7 ff ff
movupd -0x28b8(%r14,%r10,8),%xmm4
d7 ff ff
addpd  %xmm2,%xmm4
movupd -0x28a8(%r14,%r10,8),%xmm2
d7 ff ff
addpd  %xmm2,%xmm3
movupd -0x2898(%r14,%r10,8),%xmm5
d7 ff ff
addpd  %xmm3,%xmm5
addpd  %xmm2,%xmm4
movupd -0x10(%r14,%r10,8),%xmm2
addpd  %xmm4,%xmm2
movupd (%r14,%r10,8),%xmm3
addpd  %xmm5,%xmm3
movupd -0x5150(%r14,%r10,8),%xmm4
ae ff ff
addpd  %xmm2,%xmm4
movupd -0x5140(%r14,%r10,8),%xmm2
ae ff ff
addpd  %xmm3,%xmm2
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm2
movupd %xmm4,-0x10(%rbp,%r10,8)
movupd %xmm2,0x0(%rbp,%r10,8)
add    $0x4,%r10
cmp    %r10,%r9
jne    1270 <kernel_jacobi_2d+0x170>
mov    -0x30(%rsp),%rdi
cmp    %r9,%r8
je     11e0 <kernel_jacobi_2d+0xe0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rbx,%rdi,8),%xmm2
addsd  -0x8(%rbx,%rdi,8),%xmm2
addsd  0x8(%rbx,%rdi,8),%xmm2
addsd  0x28a0(%rbx,%rdi,8),%xmm2
addsd  -0x28a0(%rbx,%rdi,8),%xmm2
ff ff
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%r15,%rdi,8)
lea    0x1(%rdi),%rsi
mov    %rsi,%rdi
cmp    %rsi,%rax
jne    1320 <kernel_jacobi_2d+0x220>
jmp    11e0 <kernel_jacobi_2d+0xe0>
xchg   %ax,%ax
cmpl   $0x3,-0x50(%rsp)
jl     11a0 <kernel_jacobi_2d+0xa0>
mov    $0x1,%esi
mov    -0x38(%rsp),%rbx
mov    -0x40(%rsp),%r14
mov    -0x28(%rsp),%r15
mov    -0x20(%rsp),%rbp
xor    %r13d,%r13d
jmp    13bc <kernel_jacobi_2d+0x2bc>
nopl   0x0(%rax)
add    $0x1,%r13
add    $0x28a0,%rbp
add    $0x28a0,%r15
add    $0x28a0,%r14
add    $0x28a0,%rbx
mov    %r12,%rsi
cmp    %rax,%r12
je     11a0 <kernel_jacobi_2d+0xa0>
lea    0x1(%rsi),%r12
mov    $0x1,%edi
cmp    $0x4,%r8
jb     14c0 <kernel_jacobi_2d+0x3c0>
imul   $0x28a0,%r13,%r10
lea    (%rcx,%r10,1),%rdi
lea    (%rdi,%rax,8),%r11
add    $0x5140,%r11
imul   $0x28a0,%rsi,%rsi
lea    (%rdx,%rsi,1),%rdi
add    $0x8,%rdi
cmp    %r11,%rdi
jae    1415 <kernel_jacobi_2d+0x315>
add    %rcx,%r10
add    $0x8,%r10
add    %rdx,%rsi
lea    (%rsi,%rax,8),%rsi
mov    $0x1,%edi
cmp    %rsi,%r10
jb     14c0 <kernel_jacobi_2d+0x3c0>
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movupd -0x28b0(%rbp,%rdi,8),%xmm2
ff ff
movupd -0x28a0(%rbp,%rdi,8),%xmm3
ff ff
movupd -0x28b8(%rbp,%rdi,8),%xmm4
ff ff
addpd  %xmm2,%xmm4
movupd -0x28a8(%rbp,%rdi,8),%xmm2
ff ff
addpd  %xmm2,%xmm3
movupd -0x2898(%rbp,%rdi,8),%xmm5
ff ff
addpd  %xmm3,%xmm5
addpd  %xmm2,%xmm4
movupd -0x10(%rbp,%rdi,8),%xmm2
addpd  %xmm4,%xmm2
movupd 0x0(%rbp,%rdi,8),%xmm3
addpd  %xmm5,%xmm3
movupd -0x5150(%rbp,%rdi,8),%xmm4
ff ff
addpd  %xmm2,%xmm4
movupd -0x5140(%rbp,%rdi,8),%xmm2
ff ff
addpd  %xmm3,%xmm2
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm2
movupd %xmm4,-0x10(%r15,%rdi,8)
movupd %xmm2,(%r15,%rdi,8)
add    $0x4,%rdi
cmp    %rdi,%r9
jne    1420 <kernel_jacobi_2d+0x320>
mov    -0x30(%rsp),%rdi
cmp    %r9,%r8
je     1390 <kernel_jacobi_2d+0x290>
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rdi,8),%xmm2
addsd  -0x8(%rbx,%rdi,8),%xmm2
addsd  0x8(%rbx,%rdi,8),%xmm2
addsd  0x28a0(%rbx,%rdi,8),%xmm2
addsd  -0x28a0(%rbx,%rdi,8),%xmm2
ff ff
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%r14,%rdi,8)
lea    0x1(%rdi),%rsi
mov    %rsi,%rdi
cmp    %rsi,%rax
jne    14c0 <kernel_jacobi_2d+0x3c0>
jmp    1390 <kernel_jacobi_2d+0x290>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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