#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ FreeGrid(double **, int);
double **InitGrid(int, int, int /*<<< orphan*/);
double JacobiOmpLoopV1(double **, double **, int, int, double, int, int, int *);
double JacobiOmpLoopV1err(double **, double **, int, int, double, int, int,
                          int *);
double JacobiOmpLoopV2(double **, double **, int, int, double, int, int, int *);
double JacobiOmpLoopV2err(double **, double **, int, int, double, int, int,
                          int *);
double JacobiOmpLoopV3(double **, double **, int, int, double, int, int, int *);
double JacobiOmpLoopV3err(double **, double **, int, int, double, int, int,
                          int *);
double JacobiOmpLoopV4(double **, double **, int, int, double, int, int, int *);
double JacobiOmpLoopV4err(double **, double **, int, int, double, int, int,
                          int *);
double JacobiSeqLoop(double **, double **, int, int, double, int, int, int *);
double JacobiSeqLoopErr(double **, double **, int, int, double, int, int,
                        int *);
double omp_get_wtime();
double Jacobi(double **u, int m, int n, double eps, int maxit, int omp,
              int sqrerr, int version, int iterations_print, int *iterations,
              double *wtime) {
  double **w;
  double err;
  w = InitGrid(m, n, 0);
  *iterations = 0;
  *wtime = omp_get_wtime();
  if (sqrerr == 0)
    if (omp == 0)
      err = JacobiSeqLoop(u, w, m, n, eps, maxit, iterations_print, iterations);
    else
      switch (version) {
      case 1:
        err = JacobiOmpLoopV1(u, w, m, n, eps, maxit, iterations_print,
                              iterations);
        break;
      case 2:
        err = JacobiOmpLoopV2(u, w, m, n, eps, maxit, iterations_print,
                              iterations);
        break;
      case 3:
        err = JacobiOmpLoopV3(u, w, m, n, eps, maxit, iterations_print,
                              iterations);
        break;
      case 4:
        err = JacobiOmpLoopV4(u, w, m, n, eps, maxit, iterations_print,
                              iterations);
        break;
      default:
        err = -1.0;
        break;
      }
  else if (omp == 0)
    err =
        JacobiSeqLoopErr(u, w, m, n, eps, maxit, iterations_print, iterations);
  else
    switch (version) {
    case 1:
      err = JacobiOmpLoopV1err(u, w, m, n, eps, maxit, iterations_print,
                               iterations);
      break;
    case 2:
      err = JacobiOmpLoopV2err(u, w, m, n, eps, maxit, iterations_print,
                               iterations);
      break;
    case 3:
      err = JacobiOmpLoopV3err(u, w, m, n, eps, maxit, iterations_print,
                               iterations);
      break;
    case 4:
      err = JacobiOmpLoopV4err(u, w, m, n, eps, maxit, iterations_print,
                               iterations);
      break;
    default:
      err = -1.0;
      break;
    }
  *wtime = omp_get_wtime() - *wtime;
  FreeGrid(w, m);
  return err;
}


x86 assembly (clang, -O0):
<Jacobi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
call   10b0 <InitGrid@plt>
mov    %rax,-0x30(%rbp)
mov    0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x0,-0x24(%rbp)
jne    1378 <Jacobi+0x1a8>
cmpl   $0x0,-0x20(%rbp)
jne    1270 <Jacobi+0xa0>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   1050 <JacobiSeqLoop@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    1373 <Jacobi+0x1a3>
mov    0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0x3,%eax
ja     1361 <Jacobi+0x191>
mov    -0x40(%rbp),%rax
lea    0xd88(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   10f0 <JacobiOmpLoopV1@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    136e <Jacobi+0x19e>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   1070 <JacobiOmpLoopV2@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    136e <Jacobi+0x19e>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   10e0 <JacobiOmpLoopV3@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    136e <Jacobi+0x19e>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   1060 <JacobiOmpLoopV4@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    136e <Jacobi+0x19e>
movsd  0xc97(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1373 <Jacobi+0x1a3>
jmp    14bc <Jacobi+0x2ec>
cmpl   $0x0,-0x20(%rbp)
jne    13b4 <Jacobi+0x1e4>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   10d0 <JacobiSeqLoopErr@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    14b7 <Jacobi+0x2e7>
mov    0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x3,%eax
ja     14a5 <Jacobi+0x2d5>
mov    -0x48(%rbp),%rax
lea    0xc34(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <JacobiOmpLoopV1err@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    14b2 <Jacobi+0x2e2>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   10c0 <JacobiOmpLoopV2err@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    14b2 <Jacobi+0x2e2>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   1090 <JacobiOmpLoopV3err@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    14b2 <Jacobi+0x2e2>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
mov    0x20(%rbp),%rax
mov    %rax,(%rsp)
call   10a0 <JacobiOmpLoopV4err@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    14b2 <Jacobi+0x2e2>
movsd  0xb53(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    14b7 <Jacobi+0x2e7>
jmp    14bc <Jacobi+0x2ec>
mov    $0x0,%al
call   1030 <omp_get_wtime@plt>
mov    0x28(%rbp),%rax
subsd  (%rax),%xmm0
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <FreeGrid@plt>
movsd  -0x38(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jacobi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,%r12d
mov    %r8d,%r15d
mov    %ecx,0x18(%rsp)
movsd  %xmm0,0x30(%rsp)
mov    %edx,%ebx
mov    %rdi,0x28(%rsp)
mov    0x88(%rsp),%r13
mov    0x80(%rsp),%rbp
mov    0x70(%rsp),%r14d
mov    %esi,0x14(%rsp)
mov    %esi,%edi
mov    %edx,%esi
xor    %edx,%edx
call   10b0 <InitGrid@plt>
mov    %rax,0x20(%rsp)
movl   $0x0,0x0(%rbp)
xor    %eax,%eax
call   1030 <omp_get_wtime@plt>
movsd  %xmm0,0x0(%r13)
test   %r12d,%r12d
je     1299 <Jacobi+0xc9>
test   %r15d,%r15d
je     12fb <Jacobi+0x12b>
add    $0xffffffff,%r14d
cmp    $0x3,%r14d
ja     1371 <Jacobi+0x1a1>
lea    0xdb3(%rip),%rax
movslq (%rax,%r14,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   1040 <JacobiOmpLoopV1err@plt>
jmp    14ec <Jacobi+0x31c>
test   %r15d,%r15d
je     1336 <Jacobi+0x166>
add    $0xffffffff,%r14d
cmp    $0x3,%r14d
ja     1371 <Jacobi+0x1a1>
lea    0xd61(%rip),%rax
movslq (%rax,%r14,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   10f0 <JacobiOmpLoopV1@plt>
jmp    14ec <Jacobi+0x31c>
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   10d0 <JacobiSeqLoopErr@plt>
jmp    14ec <Jacobi+0x31c>
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   1050 <JacobiSeqLoop@plt>
jmp    14ec <Jacobi+0x31c>
movsd  0xc87(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x88(%rsp),%rbx
mov    0x14(%rsp),%ebp
mov    0x20(%rsp),%r14
jmp    14fa <Jacobi+0x32a>
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   10c0 <JacobiOmpLoopV2err@plt>
jmp    14ec <Jacobi+0x31c>
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   1090 <JacobiOmpLoopV3err@plt>
jmp    14ec <Jacobi+0x31c>
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   10a0 <JacobiOmpLoopV4err@plt>
jmp    14ec <Jacobi+0x31c>
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   10e0 <JacobiOmpLoopV3@plt>
jmp    14ec <Jacobi+0x31c>
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   1060 <JacobiOmpLoopV4@plt>
jmp    14ec <Jacobi+0x31c>
mov    0x80(%rsp),%rax
mov    %rax,(%rsp)
mov    0x28(%rsp),%rdi
mov    0x20(%rsp),%r14
mov    %r14,%rsi
mov    0x14(%rsp),%ebp
mov    %ebp,%edx
mov    %ebx,%ecx
movsd  0x30(%rsp),%xmm0
mov    0x18(%rsp),%r8d
mov    0x78(%rsp),%r9d
call   1070 <JacobiOmpLoopV2@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x88(%rsp),%rbx
xor    %eax,%eax
call   1030 <omp_get_wtime@plt>
subsd  (%rbx),%xmm0
movsd  %xmm0,(%rbx)
mov    %r14,%rdi
mov    %ebp,%esi
call   1080 <FreeGrid@plt>
movsd  0x18(%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @Jacobi(double** %0, i32 %1, i32 %2, double %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32* %9, double* %10) {
%12 = alloca double**
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32*
%22 = alloca double*
%23 = alloca double**
%24 = alloca double
store double** %0, double*** %12
store i32 %1, i32* %13
store i32 %2, i32* %14
store double %3, double* %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32 %8, i32* %20
store i32* %9, i32** %21
store double* %10, double** %22
%25 = load i32, i32* %13
%26 = load i32, i32* %14
%27 = call double** @InitGrid(i32 %25, i32 %26, i32 0)
store double** %27, double*** %23
%28 = load i32*, i32** %21
store i32 0, i32* %28
%29 = call double (...) @omp_get_wtime()
%30 = load double*, double** %22
store double %29, double* %30
%31 = load i32, i32* %18
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %91
33: ; preds = %11
%34 = load i32, i32* %17
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %46
36: ; preds = %33
%37 = load double**, double*** %12
%38 = load double**, double*** %23
%39 = load i32, i32* %13
%40 = load i32, i32* %14
%41 = load double, double* %15
%42 = load i32, i32* %16
%43 = load i32, i32* %20
%44 = load i32*, i32** %21
%45 = call double @JacobiSeqLoop(double** %37, double** %38, i32 %39, i32 %40, double %41, i32 %42, i32 %43, i32* %44)
store double %45, double* %24
br label %90
46: ; preds = %33
%47 = load i32, i32* %19
switch i32 %47, label %88 [
i32 1, label %48
i32 2, label %58
i32 3, label %68
i32 4, label %78
]
48: ; preds = %46
%49 = load double**, double*** %12
%50 = load double**, double*** %23
%51 = load i32, i32* %13
%52 = load i32, i32* %14
%53 = load double, double* %15
%54 = load i32, i32* %16
%55 = load i32, i32* %20
%56 = load i32*, i32** %21
%57 = call double @JacobiOmpLoopV1(double** %49, double** %50, i32 %51, i32 %52, double %53, i32 %54, i32 %55, i32* %56)
store double %57, double* %24
br label %89
58: ; preds = %46
%59 = load double**, double*** %12
%60 = load double**, double*** %23
%61 = load i32, i32* %13
%62 = load i32, i32* %14
%63 = load double, double* %15
%64 = load i32, i32* %16
%65 = load i32, i32* %20
%66 = load i32*, i32** %21
%67 = call double @JacobiOmpLoopV2(double** %59, double** %60, i32 %61, i32 %62, double %63, i32 %64, i32 %65, i32* %66)
store double %67, double* %24
br label %89
68: ; preds = %46
%69 = load double**, double*** %12
%70 = load double**, double*** %23
%71 = load i32, i32* %13
%72 = load i32, i32* %14
%73 = load double, double* %15
%74 = load i32, i32* %16
%75 = load i32, i32* %20
%76 = load i32*, i32** %21
%77 = call double @JacobiOmpLoopV3(double** %69, double** %70, i32 %71, i32 %72, double %73, i32 %74, i32 %75, i32* %76)
store double %77, double* %24
br label %89
78: ; preds = %46
%79 = load double**, double*** %12
%80 = load double**, double*** %23
%81 = load i32, i32* %13
%82 = load i32, i32* %14
%83 = load double, double* %15
%84 = load i32, i32* %16
%85 = load i32, i32* %20
%86 = load i32*, i32** %21
%87 = call double @JacobiOmpLoopV4(double** %79, double** %80, i32 %81, i32 %82, double %83, i32 %84, i32 %85, i32* %86)
store double %87, double* %24
br label %89
88: ; preds = %46
store double -1.000000e+00, double* %24
br label %89
89: ; preds = %88, %78, %68, %58, %48
br label %90
90: ; preds = %89, %36
br label %149
91: ; preds = %11
%92 = load i32, i32* %17
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %104
94: ; preds = %91
%95 = load double**, double*** %12
%96 = load double**, double*** %23
%97 = load i32, i32* %13
%98 = load i32, i32* %14
%99 = load double, double* %15
%100 = load i32, i32* %16
%101 = load i32, i32* %20
%102 = load i32*, i32** %21
%103 = call double @JacobiSeqLoopErr(double** %95, double** %96, i32 %97, i32 %98, double %99, i32 %100, i32 %101, i32* %102)
store double %103, double* %24
br label %148
104: ; preds = %91
%105 = load i32, i32* %19
switch i32 %105, label %146 [
i32 1, label %106
i32 2, label %116
i32 3, label %126
i32 4, label %136
]
106: ; preds = %104
%107 = load double**, double*** %12
%108 = load double**, double*** %23
%109 = load i32, i32* %13
%110 = load i32, i32* %14
%111 = load double, double* %15
%112 = load i32, i32* %16
%113 = load i32, i32* %20
%114 = load i32*, i32** %21
%115 = call double @JacobiOmpLoopV1err(double** %107, double** %108, i32 %109, i32 %110, double %111, i32 %112, i32 %113, i32* %114)
store double %115, double* %24
br label %147
116: ; preds = %104
%117 = load double**, double*** %12
%118 = load double**, double*** %23
%119 = load i32, i32* %13
%120 = load i32, i32* %14
%121 = load double, double* %15
%122 = load i32, i32* %16
%123 = load i32, i32* %20
%124 = load i32*, i32** %21
%125 = call double @JacobiOmpLoopV2err(double** %117, double** %118, i32 %119, i32 %120, double %121, i32 %122, i32 %123, i32* %124)
store double %125, double* %24
br label %147
126: ; preds = %104
%127 = load double**, double*** %12
%128 = load double**, double*** %23
%129 = load i32, i32* %13
%130 = load i32, i32* %14
%131 = load double, double* %15
%132 = load i32, i32* %16
%133 = load i32, i32* %20
%134 = load i32*, i32** %21
%135 = call double @JacobiOmpLoopV3err(double** %127, double** %128, i32 %129, i32 %130, double %131, i32 %132, i32 %133, i32* %134)
store double %135, double* %24
br label %147
136: ; preds = %104
%137 = load double**, double*** %12
%138 = load double**, double*** %23
%139 = load i32, i32* %13
%140 = load i32, i32* %14
%141 = load double, double* %15
%142 = load i32, i32* %16
%143 = load i32, i32* %20
%144 = load i32*, i32** %21
%145 = call double @JacobiOmpLoopV4err(double** %137, double** %138, i32 %139, i32 %140, double %141, i32 %142, i32 %143, i32* %144)
store double %145, double* %24
br label %147
146: ; preds = %104
store double -1.000000e+00, double* %24
br label %147
147: ; preds = %146, %136, %126, %116, %106
br label %148
148: ; preds = %147, %94
br label %149
149: ; preds = %148, %90
%150 = call double (...) @omp_get_wtime()
%151 = load double*, double** %22
%152 = load double, double* %151
%153 = fsub double %150, %152
%154 = load double*, double** %22
store double %153, double* %154
%155 = load double**, double*** %23
%156 = load i32, i32* %13
%157 = call i32 @FreeGrid(double** %155, i32 %156)
%158 = load double, double* %24
ret double %158
}

LLVM IR (-O2):
define double @Jacobi(double** %0, i32 %1, i32 %2, double %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32* %9, double* nocapture %10) {
%12 = tail call double** @InitGrid(i32 %1, i32 %2, i32 0)
store i32 0, i32* %9
%13 = tail call double (...) @omp_get_wtime()
store double %13, double* %10
%14 = icmp eq i32 %6, 0
%15 = icmp eq i32 %5, 0
br i1 %14, label %16, label %28
16: ; preds = %11
br i1 %15, label %17, label %19
17: ; preds = %16
%18 = tail call double @JacobiSeqLoop(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
19: ; preds = %16
switch i32 %7, label %40 [
i32 1, label %20
i32 2, label %22
i32 3, label %24
i32 4, label %26
]
20: ; preds = %19
%21 = tail call double @JacobiOmpLoopV1(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
22: ; preds = %19
%23 = tail call double @JacobiOmpLoopV2(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
24: ; preds = %19
%25 = tail call double @JacobiOmpLoopV3(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
26: ; preds = %19
%27 = tail call double @JacobiOmpLoopV4(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
28: ; preds = %11
br i1 %15, label %29, label %31
29: ; preds = %28
%30 = tail call double @JacobiSeqLoopErr(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
31: ; preds = %28
switch i32 %7, label %40 [
i32 1, label %32
i32 2, label %34
i32 3, label %36
i32 4, label %38
]
32: ; preds = %31
%33 = tail call double @JacobiOmpLoopV1err(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
34: ; preds = %31
%35 = tail call double @JacobiOmpLoopV2err(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
36: ; preds = %31
%37 = tail call double @JacobiOmpLoopV3err(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
38: ; preds = %31
%39 = tail call double @JacobiOmpLoopV4err(double** %0, double** %12, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %40
40: ; preds = %31, %19, %29, %38, %36, %34, %32, %17, %26, %24, %22, %20
%41 = phi double [ %18, %17 ], [ %27, %26 ], [ %25, %24 ], [ %23, %22 ], [ %21, %20 ], [ %30, %29 ], [ %39, %38 ], [ %37, %36 ], [ %35, %34 ], [ %33, %32 ], [ -1.000000e+00, %19 ], [ -1.000000e+00, %31 ]
%42 = tail call double (...) @omp_get_wtime()
%43 = load double, double* %10
%44 = fsub double %42, %43
store double %44, double* %10
%45 = tail call i32 @FreeGrid(double** %12, i32 %1)
ret double %41
}