#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 */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double **allocate2d(int, int);
int atoi(char *);
double *calloc(int, int);
int converge(double **, double **, int, int, int, int);
int /*<<< orphan*/ copy2d(double **, double **, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprint2d(char *, double **, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ init2d(double **, int, int);
int /*<<< orphan*/ jacobi(double **, double **, int, int, int, int);
int omp_get_thread_num();
int /*<<< orphan*/ omp_set_num_threads(int);
int /*<<< orphan*/ printf(char *, int, double, double);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int global[2], local;
  int global_padded[2];
  int grid;
  struct timeval tts, ttf;
  double **u_current, **u_previous;
  double **swap;
  if (argc != 4) {
    fprintf(stderr, "Usage: ./execname X Y P\n");
    exit(-1);
  } else {
    global[0] = atoi(argv[1]);
    global[1] = atoi(argv[2]);
    grid = atoi(argv[3]);
  }
  double time = 0;
  if (global[0] % grid == 0) {
    local = global[0] / grid;
    global_padded[0] = global[0];
    global_padded[1] = global[1];
  } else {
    local = (global[0] / grid) + 1;
    global_padded[0] = local * grid;
    global_padded[1] = global[1];
  }
  u_previous = allocate2d(global_padded[0], global_padded[1]);
  init2d(u_previous, global[0], global[1]);
  u_current = allocate2d(global_padded[0], global_padded[1]);
  copy2d(u_current, u_previous, global[0], global[1]);
  int nthreads = grid;
  omp_set_num_threads(nthreads);
  double compTime = 0;
  double *comps = calloc(nthreads, sizeof(double));
  int converged = 1;
  int globalConv = 0;
  int iter = 0;
#pragma omp parallel
  {
    int tid = omp_get_thread_num();
    int i = (global_padded[0] / grid) * (tid % grid);
    int endi = ((i + local) < global[0]) ? i + local : global[0] - 1;
    int j, conv;
    struct timeval tcs, tcf;
    conv = 1;
    i += (i == 0);
    while (!globalConv) {
#pragma omp single
      {
        ++iter;
        gettimeofday(&tts, NULL);
      }
      gettimeofday(&tcs, NULL);
      for (j = 1; j < global[1] - 1; j++) {
        jacobi(u_previous, u_current, i, endi, j, j + 1);
      }
      gettimeofday(&tcf, NULL);
      comps[tid] +=
          (tcf.tv_sec - tcs.tv_sec) + (tcf.tv_usec - tcs.tv_usec) * 0.000001;
      if ((iter % 100) == 0) {
        conv = 1;
        for (j = 1; j < global[1] - 1; j++) {
          conv &= converge(u_previous, u_current, i, endi - 1, j, j);
        }
#pragma omp atomic
        converged += conv;
      }
#pragma omp barrier
      if ((iter % 100 == 0) && (tid == 0)) {
        if (converged == nthreads) {
          globalConv = 1;
        }
      }
#pragma omp single
      {
        converged = 0;
        swap = u_previous;
        u_previous = u_current;
        u_current = swap;
        gettimeofday(&ttf, NULL);
        time +=
            (ttf.tv_sec - tts.tv_sec) + (ttf.tv_usec - tts.tv_usec) * 0.000001;
      }
    }
  }
  for (converged = 0; converged < nthreads; ++converged) {
    compTime = (compTime > comps[converged]) ? compTime : comps[converged];
  }
  printf("Tiled Jacobi\tIters: %d Time: %.3lf \t Computation: %.3lf\n", iter,
         time, compTime);
  fprint2d("testtiled.out", u_current, global[0], global[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1222 <main+0x42>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
lea    0xdf5(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x28(%rbp)
cmp    $0x0,%edx
jne    1285 <main+0xa5>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x28(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    12a2 <main+0xc2>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x28(%rbp)
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1070 <allocate2d@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   10a0 <init2d@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1070 <allocate2d@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   10c0 <copy2d@plt>
mov    -0x28(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x6c(%rbp),%edi
call   10d0 <omp_set_num_threads@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x6c(%rbp),%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,-0x80(%rbp)
movl   $0x1,-0x84(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0x0,-0x8c(%rbp)
mov    $0x0,%al
call   1040 <omp_get_thread_num@plt>
mov    %eax,-0x90(%rbp)
mov    -0x24(%rbp),%eax
cltd
idivl  -0x28(%rbp)
mov    %eax,-0xc4(%rbp)
mov    -0x90(%rbp),%eax
cltd
idivl  -0x28(%rbp)
mov    -0xc4(%rbp),%eax
imul   %edx,%eax
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%eax
add    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1380 <main+0x1a0>
mov    -0x94(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0xc8(%rbp)
jmp    138c <main+0x1ac>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc8(%rbp)
mov    -0xc8(%rbp),%eax
mov    %eax,-0x98(%rbp)
movl   $0x1,-0xa0(%rbp)
cmpl   $0x0,-0x94(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0x94(%rbp),%eax
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x88(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    13d6 <main+0x1f6>
jmp    15f9 <main+0x419>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
lea    -0x38(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
lea    -0xb0(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
movl   $0x1,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    145f <main+0x27f>
mov    -0x58(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x94(%rbp),%edx
mov    -0x98(%rbp),%ecx
mov    -0x9c(%rbp),%r8d
mov    -0x9c(%rbp),%r9d
add    $0x1,%r9d
call   1030 <jacobi@plt>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    140c <main+0x22c>
lea    -0xc0(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0xb8(%rbp),%rax
sub    -0xa8(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
subsd  -0xb0(%rbp),%xmm0
ff
movsd  0xb66(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x80(%rbp),%rax
movslq -0x90(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1552 <main+0x372>
movl   $0x1,-0xa0(%rbp)
movl   $0x1,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1540 <main+0x360>
mov    -0x58(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x94(%rbp),%edx
mov    -0x98(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x9c(%rbp),%r8d
mov    -0x9c(%rbp),%r9d
call   10b0 <converge@plt>
and    -0xa0(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    14e2 <main+0x302>
mov    -0xa0(%rbp),%eax
add    -0x84(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x8c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1594 <main+0x3b4>
cmpl   $0x0,-0x90(%rbp)
jne    1594 <main+0x3b4>
mov    -0x84(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jne    158f <main+0x3af>
movl   $0x1,-0x88(%rbp)
jmp    1594 <main+0x3b4>
movl   $0x0,-0x84(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x60(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x48(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x40(%rbp),%rax
sub    -0x30(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  0xa1e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    13bd <main+0x1dd>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x6c(%rbp),%eax
jge    1678 <main+0x498>
movsd  -0x78(%rbp),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x84(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    163f <main+0x45f>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
jmp    1657 <main+0x477>
mov    -0x80(%rbp),%rax
movslq -0x84(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x78(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1603 <main+0x423>
mov    -0x8c(%rbp),%esi
movsd  -0x68(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
lea    0x992(%rip),%rdi
call   1050 <printf@plt>
mov    -0x50(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0x9b5(%rip),%rdi
call   10e0 <fprint2d@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
cmp    $0x4,%edi
jne    15d2 <main+0x3f2>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   10f0 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   10f0 <atoi@plt>
mov    %eax,%r14d
mov    0x18(%rbx),%rdi
call   10f0 <atoi@plt>
mov    %eax,%r12d
mov    %rbp,%rbx
mov    %ebx,%eax
cltd
idiv   %r12d
lea    0x1(%rax),%r13d
mov    %r13d,%r15d
imul   %r12d,%r15d
test   %edx,%edx
cmove  %ebx,%r15d
mov    %rbp,0x18(%rsp)
cmove  %eax,%r13d
mov    %r15d,%edi
mov    %r14d,%ebp
mov    %r14d,%esi
call   1070 <allocate2d@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   10a0 <init2d@plt>
mov    %r15d,%edi
mov    %ebp,%esi
mov    %ebp,%ebx
call   1070 <allocate2d@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r14,%rsi
mov    0x18(%rsp),%rdx
mov    %ebx,%ecx
call   10c0 <copy2d@plt>
mov    %r12d,%edi
call   10d0 <omp_set_num_threads@plt>
mov    %r12d,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
call   1040 <omp_get_thread_num@plt>
mov    %eax,%ecx
mov    %r15d,%eax
cltd
idiv   %r12d
mov    %eax,%esi
mov    %ecx,%eax
cltd
mov    %r12d,0x20(%rsp)
idiv   %r12d
mov    %edx,%r12d
imul   %esi,%r12d
add    %r12d,%r13d
mov    0x18(%rsp),%rdx
lea    -0x1(%rdx),%eax
cmp    %edx,%r13d
cmovl  %r13d,%eax
cmp    $0x1,%r12d
adc    $0x0,%r12d
movslq %ecx,%rcx
mov    %rax,0x48(%rsp)
add    $0xffffffff,%eax
mov    %eax,0x30(%rsp)
mov    %rcx,0x40(%rsp)
test   %ecx,%ecx
sete   0xb(%rsp)
mov    $0x2,%eax
mov    %ebx,0xc(%rsp)
sub    %ebx,%eax
mov    %rax,0x38(%rsp)
xorpd  %xmm0,%xmm0
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,0x24(%rsp)
movsd  %xmm0,0x50(%rsp)
mov    %r14,%r15
mov    %rbp,%r14
mov    0x10(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x10(%rsp)
lea    0x88(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
lea    0x68(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0xc(%rsp),%ebx
cmp    $0x3,%ebx
mov    0x48(%rsp),%r13
jl     138f <main+0x1af>
mov    $0x2,%ebp
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbp),%r8d
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12d,%edx
mov    %r13d,%ecx
mov    %ebp,%r9d
call   1030 <jacobi@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1370 <main+0x190>
xor    %r13d,%r13d
lea    0x58(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x60(%rsp),%rax
sub    0x70(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x58(%rsp),%xmm1
subsd  0x68(%rsp),%xmm1
mulsd  0xc3c(%rip),%xmm1
addsd  %xmm0,%xmm1
mov    0x28(%rsp),%rax
mov    0x40(%rsp),%rcx
addsd  (%rax,%rcx,8),%xmm1
movsd  %xmm1,(%rax,%rcx,8)
imul   $0xc28f5c29,0x10(%rsp),%eax
c2
ror    $0x2,%eax
cmp    $0x28f5c28,%eax
jbe    1400 <main+0x220>
mov    0x24(%rsp),%ebx
jmp    1480 <main+0x2a0>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%ebx
cmpl   $0x3,0xc(%rsp)
mov    0x30(%rsp),%ecx
mov    %r15,%rdx
mov    0x38(%rsp),%rsi
jl     1472 <main+0x292>
mov    $0x1,%ebx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,0x34(%rsp)
mov    %rdx,%r13
mov    %rdx,%rdi
mov    %rsi,%rbx
mov    %r14,%rsi
mov    %r12d,%edx
mov    %ecx,%r15d
mov    %ebp,%r8d
mov    %ebp,%r9d
call   10b0 <converge@plt>
mov    %rbx,%rsi
mov    0x34(%rsp),%ebx
mov    %r13,%rdx
and    %eax,%ebx
lea    (%rsi,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
mov    %r15d,%ecx
cmp    $0x1,%eax
jne    1430 <main+0x250>
add    0x24(%rsp),%ebx
mov    0xb(%rsp),%al
mov    %eax,%r13d
mov    %rdx,%r15
lea    0x78(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x80(%rsp),%rax
sub    0x90(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x78(%rsp),%xmm1
subsd  0x88(%rsp),%xmm1
mulsd  0xb45(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0x50(%rsp),%xmm0
addsd  %xmm1,%xmm0
mov    $0x0,%eax
mov    %r15,%rbp
test   %r13b,%r13b
je     1320 <main+0x140>
mov    $0x0,%eax
mov    %r15,%rbp
cmp    0x20(%rsp),%ebx
jne    1320 <main+0x140>
mov    0x20(%rsp),%eax
test   %eax,%eax
jle    1521 <main+0x341>
mov    %eax,%ecx
lea    -0x1(%rcx),%rdx
mov    %ecx,%eax
and    $0x3,%eax
cmp    $0x3,%rdx
jae    1536 <main+0x356>
xorpd  %xmm1,%xmm1
xor    %edx,%edx
mov    0x18(%rsp),%rbp
mov    0xc(%rsp),%r14d
mov    0x10(%rsp),%rsi
mov    0x28(%rsp),%rdi
jmp    1580 <main+0x3a0>
xorpd  %xmm1,%xmm1
mov    0x18(%rsp),%rbp
mov    0xc(%rsp),%r14d
mov    0x10(%rsp),%rsi
jmp    159e <main+0x3be>
and    $0xfffffffc,%ecx
xorpd  %xmm1,%xmm1
xor    %edx,%edx
mov    0x18(%rsp),%rbp
mov    0xc(%rsp),%r14d
mov    0x10(%rsp),%rsi
mov    0x28(%rsp),%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
maxsd  (%rdi,%rdx,8),%xmm1
maxsd  0x8(%rdi,%rdx,8),%xmm1
maxsd  0x10(%rdi,%rdx,8),%xmm1
maxsd  0x18(%rdi,%rdx,8),%xmm1
add    $0x4,%rdx
cmp    %rdx,%rcx
jne    1560 <main+0x380>
test   %rax,%rax
je     159e <main+0x3be>
lea    (%rdi,%rdx,8),%rcx
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
maxsd  (%rcx,%rdx,8),%xmm1
add    $0x1,%rdx
cmp    %rdx,%rax
jne    1590 <main+0x3b0>
lea    0xa7c(%rip),%rdi
call   1050 <printf@plt>
lea    0xaa9(%rip),%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
call   10e0 <fprint2d@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a07(%rip),%rax
mov    (%rax),%edi
lea    0xa26(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>

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

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
@stderr = global i32 0
@.str = [25 x i8] c"Usage: ./execname X Y P\0A\00"
@.str.1 = [57 x i8] c"Tiled Jacobi\09Iters: %d Time: %.3lf \09 Computation: %.3lf\0A\00"
@.str.2 = [14 x i8] c"testtiled.out\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = bitcast %struct.timeval* %3 to i8*
%8 = bitcast %struct.timeval* %4 to i8*
%9 = icmp eq i32 %0, 4
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 3
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
%24 = srem i32 %17, %23
%25 = icmp eq i32 %24, 0
%26 = sdiv i32 %17, %23
%27 = add nsw i32 %26, 1
%28 = mul nsw i32 %27, %23
%29 = select i1 %25, i32 %17, i32 %28
%30 = select i1 %25, i32 %26, i32 %27
%31 = tail call double** @allocate2d(i32 %29, i32 %20)
%32 = tail call i32 @init2d(double** %31, i32 %17, i32 %20)
%33 = tail call double** @allocate2d(i32 %29, i32 %20)
%34 = tail call i32 @copy2d(double** %33, double** %31, i32 %17, i32 %20)
%35 = tail call i32 @omp_set_num_threads(i32 %23)
%36 = tail call double* @calloc(i32 %23, i32 8)
%37 = tail call i32 (...) @omp_get_thread_num()
%38 = sdiv i32 %29, %23
%39 = srem i32 %37, %23
%40 = mul nsw i32 %39, %38
%41 = add nsw i32 %40, %30
%42 = icmp slt i32 %41, %17
%43 = add nsw i32 %17, -1
%44 = select i1 %42, i32 %41, i32 %43
%45 = bitcast %struct.timeval* %5 to i8*
%46 = bitcast %struct.timeval* %6 to i8*
%47 = icmp eq i32 %40, 0
%48 = zext i1 %47 to i32
%49 = add nsw i32 %40, %48
%50 = add i32 %20, -1
%51 = icmp sgt i32 %20, 2
%52 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 1
%53 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%54 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 0
%55 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%56 = sext i32 %37 to i64
%57 = getelementptr inbounds double, double* %36, i64 %56
%58 = add nsw i32 %44, -1
%59 = icmp eq i32 %37, 0
%60 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
%61 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%62 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%63 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
br label %64
64: ; preds = %14, %103
%65 = phi i32 [ 0, %14 ], [ %70, %103 ]
%66 = phi i32 [ 1, %14 ], [ 0, %103 ]
%67 = phi double** [ %33, %14 ], [ %69, %103 ]
%68 = phi double [ 0.000000e+00, %14 ], [ %118, %103 ]
%69 = phi double** [ %31, %14 ], [ %67, %103 ]
%70 = add nuw nsw i32 %65, 1
%71 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%72 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
br i1 %51, label %73, label %78
73: ; preds = %64, %73
%74 = phi i32 [ %75, %73 ], [ 1, %64 ]
%75 = add nuw nsw i32 %74, 1
%76 = tail call i32 @jacobi(double** %69, double** %67, i32 %49, i32 %44, i32 %74, i32 %75)
%77 = icmp eq i32 %75, %50
br i1 %77, label %78, label %73
78: ; preds = %73, %64
%79 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%80 = load i64, i64* %52
%81 = load i64, i64* %53
%82 = sub nsw i64 %80, %81
%83 = sitofp i64 %82 to double
%84 = load double, double* %54
%85 = load double, double* %55
%86 = fsub double %84, %85
%87 = tail call double @llvm.fmuladd.f64(double %86, double 0x3EB0C6F7A0B5ED8D, double %83)
%88 = load double, double* %57
%89 = fadd double %88, %87
store double %89, double* %57
%90 = urem i32 %70, 100
%91 = icmp eq i32 %90, 0
br i1 %91, label %92, label %103
92: ; preds = %78
br i1 %51, label %93, label %100
93: ; preds = %92, %93
%94 = phi i32 [ %97, %93 ], [ 1, %92 ]
%95 = phi i32 [ %98, %93 ], [ 1, %92 ]
%96 = tail call i32 @converge(double** %69, double** %67, i32 %49, i32 %58, i32 %95, i32 %95)
%97 = and i32 %96, %94
%98 = add nuw nsw i32 %95, 1
%99 = icmp eq i32 %98, %50
br i1 %99, label %100, label %93
100: ; preds = %93, %92
%101 = phi i32 [ 1, %92 ], [ %97, %93 ]
%102 = add nsw i32 %101, %66
br label %103
103: ; preds = %100, %78
%104 = phi i1 [ %59, %100 ], [ false, %78 ]
%105 = phi i32 [ %102, %100 ], [ %66, %78 ]
%106 = icmp ne i32 %105, %23
%107 = xor i1 %104, true
%108 = select i1 %107, i1 true, i1 %106
%109 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%110 = load i64, i64* %60
%111 = load i64, i64* %61
%112 = sub nsw i64 %110, %111
%113 = sitofp i64 %112 to double
%114 = load double, double* %62
%115 = load double, double* %63
%116 = fsub double %114, %115
%117 = tail call double @llvm.fmuladd.f64(double %116, double 0x3EB0C6F7A0B5ED8D, double %113)
%118 = fadd double %68, %117
br i1 %108, label %64, label %119
119: ; preds = %103
%120 = icmp sgt i32 %23, 0
br i1 %120, label %121, label %170
121: ; preds = %119
%122 = zext i32 %23 to i64
%123 = add nsw i64 %122, -1
%124 = and i64 %122, 3
%125 = icmp ult i64 %123, 3
br i1 %125, label %154, label %126
126: ; preds = %121
%127 = and i64 %122, 4294967292
br label %128
128: ; preds = %128, %126
%129 = phi i64 [ 0, %126 ], [ %151, %128 ]
%130 = phi double [ 0.000000e+00, %126 ], [ %150, %128 ]
%131 = phi i64 [ 0, %126 ], [ %152, %128 ]
%132 = getelementptr inbounds double, double* %36, i64 %129
%133 = load double, double* %132
%134 = fcmp ogt double %130, %133
%135 = select i1 %134, double %130, double %133
%136 = or i64 %129, 1
%137 = getelementptr inbounds double, double* %36, i64 %136
%138 = load double, double* %137
%139 = fcmp ogt double %135, %138
%140 = select i1 %139, double %135, double %138
%141 = or i64 %129, 2
%142 = getelementptr inbounds double, double* %36, i64 %141
%143 = load double, double* %142
%144 = fcmp ogt double %140, %143
%145 = select i1 %144, double %140, double %143
%146 = or i64 %129, 3
%147 = getelementptr inbounds double, double* %36, i64 %146
%148 = load double, double* %147
%149 = fcmp ogt double %145, %148
%150 = select i1 %149, double %145, double %148
%151 = add nuw nsw i64 %129, 4
%152 = add i64 %131, 4
%153 = icmp eq i64 %152, %127
br i1 %153, label %154, label %128
154: ; preds = %128, %121
%155 = phi double [ undef, %121 ], [ %150, %128 ]
%156 = phi i64 [ 0, %121 ], [ %151, %128 ]
%157 = phi double [ 0.000000e+00, %121 ], [ %150, %128 ]
%158 = icmp eq i64 %124, 0
br i1 %158, label %170, label %159
159: ; preds = %154, %159
%160 = phi i64 [ %167, %159 ], [ %156, %154 ]
%161 = phi double [ %166, %159 ], [ %157, %154 ]
%162 = phi i64 [ %168, %159 ], [ 0, %154 ]
%163 = getelementptr inbounds double, double* %36, i64 %160
%164 = load double, double* %163
%165 = fcmp ogt double %161, %164
%166 = select i1 %165, double %161, double %164
%167 = add nuw nsw i64 %160, 1
%168 = add i64 %162, 1
%169 = icmp eq i64 %168, %124
br i1 %169, label %170, label %159
170: ; preds = %154, %159, %119
%171 = phi double [ 0.000000e+00, %119 ], [ %155, %154 ], [ %166, %159 ]
%172 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %70, double %118, double %171)
%173 = tail call i32 @fprint2d(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double** %69, i32 %17, i32 %20)
ret i32 0
}