#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 */
double **CreateGrid(int, int);
double RB_GS_OmpLoopV1(double **, double **, int, int, double, int, int, int *);
double RB_GS_OmpLoopV1err(double **, double **, int, int, double, int, int,
                          int *);
double RB_GS_OmpLoopV2(double **, double **, int, int, double, int, int, int *);
double RB_GS_OmpLoopV2err(double **, double **, int, int, double, int, int,
                          int *);
double RB_GS_OmpLoopV3(double **, double **, int, int, double, int, int, int *);
double RB_GS_OmpLoopV3err(double **, double **, int, int, double, int, int,
                          int *);
double RB_GS_OmpLoopV4(double **, double **, int, int, double, int, int, int *);
double RB_GS_OmpLoopV4err(double **, double **, int, int, double, int, int,
                          int *);
double RB_GS_SeqLoop(double **, double **, int, int, double, int, int, int *);
double RB_GS_SeqLoopErr(double **, double **, int, int, double, int, int,
                        int *);
double omp_get_wtime();
double RedBlack_GaussSeidel(double **u, int m, int n, double eps, int maxit,
                            int omp, int sqrerr, int version,
                            int iterations_print, int *iterations,
                            double *wtime) {
  double err;
  double **red;
  double **black;
  int i, j;
  red = CreateGrid(m, n / 2);
  black = CreateGrid(m, n / 2);
  *iterations = 0;
  *wtime = omp_get_wtime();
#pragma omp parallel shared(u, m, n, red, black) private(i, j)
  {
#pragma omp for
    for (i = 0; i < m; i++)
      for (j = (i + 1) % 2; j < n; j += 2) {
        black[i][j / 2] = u[i][j];
      }
#pragma omp for
    for (i = 0; i < m; i++)
      for (j = i % 2; j < n; j += 2) {
        red[i][j / 2] = u[i][j];
      }
  }
  if (sqrerr == 0)
    if (omp == 0)
      err = RB_GS_SeqLoop(black, red, m, n, eps, maxit, iterations_print,
                          iterations);
    else
      switch (version) {
      case 1:
        err = RB_GS_OmpLoopV1(black, red, m, n, eps, maxit, iterations_print,
                              iterations);
        break;
      case 2:
        err = RB_GS_OmpLoopV2(black, red, m, n, eps, maxit, iterations_print,
                              iterations);
        break;
      case 3:
        err = RB_GS_OmpLoopV3(black, red, m, n, eps, maxit, iterations_print,
                              iterations);
        break;
      case 4:
        err = RB_GS_OmpLoopV4(black, red, m, n, eps, maxit, iterations_print,
                              iterations);
        break;
      default:
        err = -1.0;
        break;
      }
  else if (omp == 0)
    err = RB_GS_SeqLoopErr(black, red, m, n, eps, maxit, iterations_print,
                           iterations);
  else
    switch (version) {
    case 1:
      err = RB_GS_OmpLoopV1err(black, red, m, n, eps, maxit, iterations_print,
                               iterations);
      break;
    case 2:
      err = RB_GS_OmpLoopV2err(black, red, m, n, eps, maxit, iterations_print,
                               iterations);
      break;
    case 3:
      err = RB_GS_OmpLoopV3err(black, red, m, n, eps, maxit, iterations_print,
                               iterations);
      break;
    case 4:
      err = RB_GS_OmpLoopV4err(black, red, m, n, eps, maxit, iterations_print,
                               iterations);
      break;
    default:
      err = -1.0;
      break;
    }
#pragma omp parallel private(j)
  {
#pragma omp for
    for (i = 1; i < m - 1; i++)
      for (j = i % 2 + 1; j < n - 1; j += 2) {
        u[i][j] = black[i][j / 2];
      }
#pragma omp for
    for (i = 1; i < m - 1; i++)
      for (j = (i + 1) % 2 + 1; j < n - 1; j += 2) {
        u[i][j] = red[i][j / 2];
      }
  }
  *wtime = omp_get_wtime() - *wtime;
  return err;
}


x86 assembly (clang, -O0):
<RedBlack_GaussSeidel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%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),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   10b0 <CreateGrid@plt>
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   10b0 <CreateGrid@plt>
mov    %rax,-0x40(%rbp)
mov    0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1050 <omp_get_wtime@plt>
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12cd <RedBlack_GaussSeidel+0x10d>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12ba <RedBlack_GaussSeidel+0xfa>
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x48(%rbp)
jmp    1262 <RedBlack_GaussSeidel+0xa2>
jmp    12bf <RedBlack_GaussSeidel+0xff>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1245 <RedBlack_GaussSeidel+0x85>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1359 <RedBlack_GaussSeidel+0x199>
mov    -0x44(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1346 <RedBlack_GaussSeidel+0x186>
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x48(%rbp)
jmp    12ee <RedBlack_GaussSeidel+0x12e>
jmp    134b <RedBlack_GaussSeidel+0x18b>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12d4 <RedBlack_GaussSeidel+0x114>
cmpl   $0x0,-0x24(%rbp)
jne    14a7 <RedBlack_GaussSeidel+0x2e7>
cmpl   $0x0,-0x20(%rbp)
jne    139f <RedBlack_GaussSeidel+0x1df>
mov    -0x40(%rbp),%rdi
mov    -0x38(%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 <RB_GS_SeqLoop@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    14a2 <RedBlack_GaussSeidel+0x2e2>
mov    0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x60(%rbp)
sub    $0x3,%eax
ja     1490 <RedBlack_GaussSeidel+0x2d0>
mov    -0x60(%rbp),%rax
lea    0xc59(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x40(%rbp),%rdi
mov    -0x38(%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 <RB_GS_OmpLoopV1@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    149d <RedBlack_GaussSeidel+0x2dd>
mov    -0x40(%rbp),%rdi
mov    -0x38(%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   1080 <RB_GS_OmpLoopV2@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    149d <RedBlack_GaussSeidel+0x2dd>
mov    -0x40(%rbp),%rdi
mov    -0x38(%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 <RB_GS_OmpLoopV3@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    149d <RedBlack_GaussSeidel+0x2dd>
mov    -0x40(%rbp),%rdi
mov    -0x38(%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 <RB_GS_OmpLoopV4@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    149d <RedBlack_GaussSeidel+0x2dd>
movsd  0xb68(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    14a2 <RedBlack_GaussSeidel+0x2e2>
jmp    15eb <RedBlack_GaussSeidel+0x42b>
cmpl   $0x0,-0x20(%rbp)
jne    14e3 <RedBlack_GaussSeidel+0x323>
mov    -0x40(%rbp),%rdi
mov    -0x38(%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 <RB_GS_SeqLoopErr@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    15e6 <RedBlack_GaussSeidel+0x426>
mov    0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x68(%rbp)
sub    $0x3,%eax
ja     15d4 <RedBlack_GaussSeidel+0x414>
mov    -0x68(%rbp),%rax
lea    0xb05(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x40(%rbp),%rdi
mov    -0x38(%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   1030 <RB_GS_OmpLoopV1err@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    15e1 <RedBlack_GaussSeidel+0x421>
mov    -0x40(%rbp),%rdi
mov    -0x38(%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 <RB_GS_OmpLoopV2err@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    15e1 <RedBlack_GaussSeidel+0x421>
mov    -0x40(%rbp),%rdi
mov    -0x38(%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 <RB_GS_OmpLoopV3err@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    15e1 <RedBlack_GaussSeidel+0x421>
mov    -0x40(%rbp),%rdi
mov    -0x38(%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 <RB_GS_OmpLoopV4err@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    15e1 <RedBlack_GaussSeidel+0x421>
movsd  0xa24(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    15e6 <RedBlack_GaussSeidel+0x426>
jmp    15eb <RedBlack_GaussSeidel+0x42b>
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1684 <RedBlack_GaussSeidel+0x4c4>
mov    -0x44(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1671 <RedBlack_GaussSeidel+0x4b1>
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x70(%rbp)
mov    -0x48(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x48(%rbp)
jmp    1614 <RedBlack_GaussSeidel+0x454>
jmp    1676 <RedBlack_GaussSeidel+0x4b6>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    15f2 <RedBlack_GaussSeidel+0x432>
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1720 <RedBlack_GaussSeidel+0x560>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x48(%rbp)
mov    -0x48(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    170d <RedBlack_GaussSeidel+0x54d>
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x78(%rbp)
mov    -0x48(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x48(%rbp)
jmp    16b0 <RedBlack_GaussSeidel+0x4f0>
jmp    1712 <RedBlack_GaussSeidel+0x552>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    168b <RedBlack_GaussSeidel+0x4cb>
mov    $0x0,%al
call   1050 <omp_get_wtime@plt>
mov    0x28(%rbp),%rax
subsd  (%rax),%xmm0
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RedBlack_GaussSeidel>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,0x4c(%rsp)
mov    %r8d,0x30(%rsp)
mov    %ecx,0xc(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,0x28(%rsp)
mov    0xa8(%rsp),%r14
mov    0xa0(%rsp),%r15
mov    %edx,%ebx
shr    $0x1f,%ebx
add    %edx,%ebx
sar    %ebx
mov    %esi,%edi
mov    %ebx,%esi
call   10b0 <CreateGrid@plt>
mov    %rax,0x18(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   10b0 <CreateGrid@plt>
mov    %rax,0x40(%rsp)
movl   $0x0,(%r15)
xor    %eax,%eax
call   1050 <omp_get_wtime@plt>
movsd  %xmm0,(%r14)
mov    %rbp,0x38(%rsp)
test   %ebp,%ebp
jle    153c <RedBlack_GaussSeidel+0x37c>
movabs $0x7ffffffffffffffc,%r11
ff ff 7f
movslq %r12d,%rcx
mov    0x38(%rsp),%r10d
mov    $0x1,%r13b
xor    %r9d,%r9d
mov    %r12d,0x34(%rsp)
mov    0x28(%rsp),%r8
mov    0x40(%rsp),%r14
jmp    127d <RedBlack_GaussSeidel+0xbd>
nopw   0x0(%rax,%rax,1)
xor    $0x1,%r13b
cmp    %r10,%r9
je     13ab <RedBlack_GaussSeidel+0x1eb>
mov    %r9,%rbx
add    $0x1,%r9
mov    %r9d,%eax
and    $0x1,%eax
cmp    %r12d,%eax
jge    1270 <RedBlack_GaussSeidel+0xb0>
mov    %rbx,%rsi
or     $0xfffffffffffffffe,%rsi
add    %rcx,%rsi
movzbl %r13b,%ebp
and    $0x1,%ebp
mov    (%r8,%rbx,8),%rdi
mov    (%r14,%rbx,8),%rdx
cmp    $0x8,%rsi
jb     1384 <RedBlack_GaussSeidel+0x1c4>
not    %ebx
mov    %rsi,%rax
shr    %rax
and    $0x1,%ebx
and    $0xfffffffffffffffe,%rsi
or     %rbx,%rsi
lea    (%rdi,%rsi,8),%rsi
add    $0x8,%rsi
cmp    %rsi,%rdx
jae    12e6 <RedBlack_GaussSeidel+0x126>
lea    (%rdx,%rax,8),%rsi
add    $0x8,%rsi
lea    (%rdi,%rbx,8),%rbx
cmp    %rsi,%rbx
jb     1384 <RedBlack_GaussSeidel+0x1c4>
add    $0x1,%rax
mov    %eax,%esi
and    $0x3,%esi
test   %rsi,%rsi
mov    $0x4,%ebx
cmove  %rbx,%rsi
sub    %rsi,%rax
lea    0x0(,%rax,2),%rsi
add    %rbp,%rsi
mov    %rsi,0x10(%rsp)
xor    %r8d,%r8d
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r8,%rbx
or     %rbp,%rbx
lea    0x0(,%rbx,8),%r14
mov    %r14,%rsi
or     $0x10,%rsi
mov    %r14,%r12
or     $0x20,%r12
or     $0x30,%r14
movsd  (%rdi,%rbx,8),%xmm0
movhps (%rdi,%rsi,1),%xmm0
movsd  (%rdi,%r12,1),%xmm1
movhps (%rdi,%r14,1),%xmm1
mov    %r15,%rsi
and    %r11,%rsi
movups %xmm0,(%rdx,%rsi,8)
movups %xmm1,0x10(%rdx,%rsi,8)
add    $0x4,%r15
add    $0x8,%r8
cmp    %r15,%rax
jne    1320 <RedBlack_GaussSeidel+0x160>
mov    0x10(%rsp),%rbp
mov    0x34(%rsp),%r12d
mov    0x28(%rsp),%r8
mov    0x40(%rsp),%r14
mov    %rbp,%rax
and    $0xfffffffffffffffe,%rax
lea    (%rdx,%rax,4),%rax
nop
movsd  (%rdi,%rbp,8),%xmm0
movsd  %xmm0,(%rax)
add    $0x2,%rbp
add    $0x8,%rax
cmp    %rcx,%rbp
jl     1390 <RedBlack_GaussSeidel+0x1d0>
jmp    1270 <RedBlack_GaussSeidel+0xb0>
cmpl   $0x0,0x38(%rsp)
jle    153c <RedBlack_GaussSeidel+0x37c>
lea    -0x1(%rcx),%rax
mov    %rax,0x50(%rsp)
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    13e1 <RedBlack_GaussSeidel+0x221>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r14
add    $0x1,%r15d
cmp    %r10,%r14
je     153c <RedBlack_GaussSeidel+0x37c>
mov    %r14d,%eax
and    $0x1,%eax
cmp    %r12d,%eax
jge    13d0 <RedBlack_GaussSeidel+0x210>
mov    %rax,%rsi
not    %rsi
add    %rcx,%rsi
mov    %r15d,%ebx
and    $0x1,%ebx
mov    0x28(%rsp),%rdx
mov    (%rdx,%r14,8),%rbp
mov    0x18(%rsp),%rdx
mov    (%rdx,%r14,8),%r13
cmp    $0x8,%rsi
jb     1500 <RedBlack_GaussSeidel+0x340>
mov    %rsi,%r8
shr    %r8
and    $0xfffffffffffffffe,%rsi
or     %rax,%rsi
lea    0x8(,%rsi,8),%rsi
add    %rbp,%rsi
cmp    %rsi,%r13
jae    1453 <RedBlack_GaussSeidel+0x293>
lea    0x8(,%r8,8),%rsi
add    %r13,%rsi
lea    0x0(,%rax,8),%rax
add    %rbp,%rax
cmp    %rsi,%rax
jb     1500 <RedBlack_GaussSeidel+0x340>
mov    %r15d,%esi
and    $0x1,%esi
mov    0x50(%rsp),%r12
sub    %rsi,%r12
shr    %r12
add    $0x1,%r8
mov    %r8d,%esi
and    $0x3,%esi
test   %rsi,%rsi
mov    $0x4,%eax
cmove  %rax,%rsi
sub    %rsi,%r8
lea    (%rbx,%r8,2),%rax
mov    %rax,0x10(%rsp)
sub    %rsi,%r12
add    $0x1,%r12
xor    %r9d,%r9d
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r9,%rdi
or     %rbx,%rdi
lea    0x0(,%rdi,8),%rax
mov    %rax,%rdx
or     $0x10,%rdx
mov    %rax,%r8
or     $0x20,%r8
or     $0x30,%rax
movsd  0x0(%rbp,%rdi,8),%xmm0
movhps 0x0(%rbp,%rdx,1),%xmm0
movsd  0x0(%rbp,%r8,1),%xmm1
movhps 0x0(%rbp,%rax,1),%xmm1
mov    %rsi,%rax
and    %r11,%rax
movups %xmm0,0x0(%r13,%rax,8)
movups %xmm1,0x10(%r13,%rax,8)
add    $0x4,%rsi
add    $0x8,%r9
cmp    %rsi,%r12
jne    14a0 <RedBlack_GaussSeidel+0x2e0>
mov    0x10(%rsp),%rbx
mov    0x34(%rsp),%r12d
mov    %rbx,%rax
and    $0xfffffffffffffffe,%rax
lea    0x0(,%rax,4),%rax
add    %r13,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  0x0(%rbp,%rbx,8),%xmm0
movsd  %xmm0,(%rax)
add    $0x2,%rbx
add    $0x8,%rax
cmp    %rcx,%rbx
jl     1520 <RedBlack_GaussSeidel+0x360>
jmp    13d0 <RedBlack_GaussSeidel+0x210>
mov    0x98(%rsp),%r9d
mov    0x90(%rsp),%eax
cmpl   $0x0,0x4c(%rsp)
je     15b7 <RedBlack_GaussSeidel+0x3f7>
cmpl   $0x0,0x30(%rsp)
mov    0x38(%rsp),%r15
mov    0x40(%rsp),%rbx
je     1618 <RedBlack_GaussSeidel+0x458>
add    $0xffffffff,%eax
cmp    $0x3,%eax
mov    0x28(%rsp),%r14
ja     1688 <RedBlack_GaussSeidel+0x4c8>
lea    0xa89(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   1030 <RB_GS_OmpLoopV1err@plt>
jmp    17a4 <RedBlack_GaussSeidel+0x5e4>
cmpl   $0x0,0x30(%rsp)
mov    0x38(%rsp),%r15
mov    0x40(%rsp),%rbx
je     1644 <RedBlack_GaussSeidel+0x484>
add    $0xffffffff,%eax
cmp    $0x3,%eax
mov    0x28(%rsp),%r14
ja     1688 <RedBlack_GaussSeidel+0x4c8>
lea    0xa38(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   10c0 <RB_GS_OmpLoopV1@plt>
jmp    17a4 <RedBlack_GaussSeidel+0x5e4>
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   1090 <RB_GS_SeqLoopErr@plt>
jmp    166e <RedBlack_GaussSeidel+0x4ae>
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   1060 <RB_GS_SeqLoop@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x28(%rsp),%r14
cmp    $0x3,%r15d
jge    17b4 <RedBlack_GaussSeidel+0x5f4>
jmp    1898 <RedBlack_GaussSeidel+0x6d8>
movsd  0x970(%rip),%xmm0
jmp    17a4 <RedBlack_GaussSeidel+0x5e4>
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   1040 <RB_GS_OmpLoopV2err@plt>
jmp    17a4 <RedBlack_GaussSeidel+0x5e4>
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   10a0 <RB_GS_OmpLoopV3err@plt>
jmp    17a4 <RedBlack_GaussSeidel+0x5e4>
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   10e0 <RB_GS_OmpLoopV4err@plt>
jmp    17a4 <RedBlack_GaussSeidel+0x5e4>
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   10d0 <RB_GS_OmpLoopV3@plt>
jmp    17a4 <RedBlack_GaussSeidel+0x5e4>
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   1070 <RB_GS_OmpLoopV4@plt>
jmp    17a4 <RedBlack_GaussSeidel+0x5e4>
mov    0xa0(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
movsd  0x20(%rsp),%xmm0
mov    0xc(%rsp),%r8d
call   1080 <RB_GS_OmpLoopV2@plt>
movsd  %xmm0,0x10(%rsp)
cmp    $0x3,%r15d
jl     1898 <RedBlack_GaussSeidel+0x6d8>
lea    -0x1(%r15),%ecx
add    $0xffffffff,%r12d
movslq %r12d,%rax
mov    %ecx,%r8d
mov    $0x1,%ebp
mov    $0x1,%esi
jmp    17dc <RedBlack_GaussSeidel+0x61c>
xchg   %ax,%ax
add    $0x1,%rsi
add    $0x1,%ebp
cmp    %r8,%rsi
je     1828 <RedBlack_GaussSeidel+0x668>
mov    %esi,%ecx
and    $0x1,%ecx
add    $0x1,%ecx
cmp    %r12d,%ecx
jge    17d0 <RedBlack_GaussSeidel+0x610>
mov    %ebp,%edi
and    $0x1,%edi
add    $0x1,%rdi
shr    %rdi
mov    %ebp,%edx
and    $0x1,%edx
add    $0x1,%edx
mov    (%r14,%rsi,8),%rcx
shl    $0x3,%rdi
add    (%rbx,%rsi,8),%rdi
nopl   0x0(%rax)
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
add    $0x2,%rdx
add    $0x8,%rdi
cmp    %rax,%rdx
jl     1810 <RedBlack_GaussSeidel+0x650>
jmp    17d0 <RedBlack_GaussSeidel+0x610>
cmp    $0x3,%r15d
jl     1898 <RedBlack_GaussSeidel+0x6d8>
mov    $0x1,%r9d
xor    %edx,%edx
mov    0x18(%rsp),%rbp
jmp    1848 <RedBlack_GaussSeidel+0x688>
nopl   (%rax)
xor    $0x1,%dl
cmp    %r8,%r9
je     1898 <RedBlack_GaussSeidel+0x6d8>
mov    %r9,%rsi
add    $0x1,%r9
mov    %r9d,%ecx
and    $0x1,%ecx
add    $0x1,%ecx
cmp    %r12d,%ecx
jge    1840 <RedBlack_GaussSeidel+0x680>
movzbl %dl,%edi
and    $0x1,%edi
add    $0x1,%rdi
mov    (%r14,%rsi,8),%rbx
lea    0x0(,%rdi,4),%ecx
and    $0xfffffff8,%ecx
add    0x0(%rbp,%rsi,8),%rcx
nopw   0x0(%rax,%rax,1)
movsd  (%rcx),%xmm0
movsd  %xmm0,(%rbx,%rdi,8)
add    $0x2,%rdi
add    $0x8,%rcx
cmp    %rax,%rdi
jl     1880 <RedBlack_GaussSeidel+0x6c0>
jmp    1840 <RedBlack_GaussSeidel+0x680>
xor    %eax,%eax
call   1050 <omp_get_wtime@plt>
mov    0xa8(%rsp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  0x10(%rsp),%xmm0
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @RedBlack_GaussSeidel(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**
%25 = alloca double**
%26 = alloca i32
%27 = alloca i32
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
%28 = load i32, i32* %13
%29 = load i32, i32* %14
%30 = sdiv i32 %29, 2
%31 = call double** @CreateGrid(i32 %28, i32 %30)
store double** %31, double*** %24
%32 = load i32, i32* %13
%33 = load i32, i32* %14
%34 = sdiv i32 %33, 2
%35 = call double** @CreateGrid(i32 %32, i32 %34)
store double** %35, double*** %25
%36 = load i32*, i32** %21
store i32 0, i32* %36
%37 = call double (...) @omp_get_wtime()
%38 = load double*, double** %22
store double %37, double* %38
store i32 0, i32* %26
br label %39
39: ; preds = %74, %11
%40 = load i32, i32* %26
%41 = load i32, i32* %13
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %77
43: ; preds = %39
%44 = load i32, i32* %26
%45 = add nsw i32 %44, 1
%46 = srem i32 %45, 2
store i32 %46, i32* %27
br label %47
47: ; preds = %70, %43
%48 = load i32, i32* %27
%49 = load i32, i32* %14
%50 = icmp slt i32 %48, %49
br i1 %50, label %51, label %73
51: ; preds = %47
%52 = load double**, double*** %12
%53 = load i32, i32* %26
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds double*, double** %52, i64 %54
%56 = load double*, double** %55
%57 = load i32, i32* %27
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
%60 = load double, double* %59
%61 = load double**, double*** %25
%62 = load i32, i32* %26
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double*, double** %61, i64 %63
%65 = load double*, double** %64
%66 = load i32, i32* %27
%67 = sdiv i32 %66, 2
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %65, i64 %68
store double %60, double* %69
br label %70
70: ; preds = %51
%71 = load i32, i32* %27
%72 = add nsw i32 %71, 2
store i32 %72, i32* %27
br label %47
73: ; preds = %47
br label %74
74: ; preds = %73
%75 = load i32, i32* %26
%76 = add nsw i32 %75, 1
store i32 %76, i32* %26
br label %39
77: ; preds = %39
store i32 0, i32* %26
br label %78
78: ; preds = %112, %77
%79 = load i32, i32* %26
%80 = load i32, i32* %13
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %115
82: ; preds = %78
%83 = load i32, i32* %26
%84 = srem i32 %83, 2
store i32 %84, i32* %27
br label %85
85: ; preds = %108, %82
%86 = load i32, i32* %27
%87 = load i32, i32* %14
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %111
89: ; preds = %85
%90 = load double**, double*** %12
%91 = load i32, i32* %26
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds double*, double** %90, i64 %92
%94 = load double*, double** %93
%95 = load i32, i32* %27
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
%98 = load double, double* %97
%99 = load double**, double*** %24
%100 = load i32, i32* %26
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double*, double** %99, i64 %101
%103 = load double*, double** %102
%104 = load i32, i32* %27
%105 = sdiv i32 %104, 2
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds double, double* %103, i64 %106
store double %98, double* %107
br label %108
108: ; preds = %89
%109 = load i32, i32* %27
%110 = add nsw i32 %109, 2
store i32 %110, i32* %27
br label %85
111: ; preds = %85
br label %112
112: ; preds = %111
%113 = load i32, i32* %26
%114 = add nsw i32 %113, 1
store i32 %114, i32* %26
br label %78
115: ; preds = %78
%116 = load i32, i32* %18
%117 = icmp eq i32 %116, 0
br i1 %117, label %118, label %176
118: ; preds = %115
%119 = load i32, i32* %17
%120 = icmp eq i32 %119, 0
br i1 %120, label %121, label %131
121: ; preds = %118
%122 = load double**, double*** %25
%123 = load double**, double*** %24
%124 = load i32, i32* %13
%125 = load i32, i32* %14
%126 = load double, double* %15
%127 = load i32, i32* %16
%128 = load i32, i32* %20
%129 = load i32*, i32** %21
%130 = call double @RB_GS_SeqLoop(double** %122, double** %123, i32 %124, i32 %125, double %126, i32 %127, i32 %128, i32* %129)
store double %130, double* %23
br label %175
131: ; preds = %118
%132 = load i32, i32* %19
switch i32 %132, label %173 [
i32 1, label %133
i32 2, label %143
i32 3, label %153
i32 4, label %163
]
133: ; preds = %131
%134 = load double**, double*** %25
%135 = load double**, double*** %24
%136 = load i32, i32* %13
%137 = load i32, i32* %14
%138 = load double, double* %15
%139 = load i32, i32* %16
%140 = load i32, i32* %20
%141 = load i32*, i32** %21
%142 = call double @RB_GS_OmpLoopV1(double** %134, double** %135, i32 %136, i32 %137, double %138, i32 %139, i32 %140, i32* %141)
store double %142, double* %23
br label %174
143: ; preds = %131
%144 = load double**, double*** %25
%145 = load double**, double*** %24
%146 = load i32, i32* %13
%147 = load i32, i32* %14
%148 = load double, double* %15
%149 = load i32, i32* %16
%150 = load i32, i32* %20
%151 = load i32*, i32** %21
%152 = call double @RB_GS_OmpLoopV2(double** %144, double** %145, i32 %146, i32 %147, double %148, i32 %149, i32 %150, i32* %151)
store double %152, double* %23
br label %174
153: ; preds = %131
%154 = load double**, double*** %25
%155 = load double**, double*** %24
%156 = load i32, i32* %13
%157 = load i32, i32* %14
%158 = load double, double* %15
%159 = load i32, i32* %16
%160 = load i32, i32* %20
%161 = load i32*, i32** %21
%162 = call double @RB_GS_OmpLoopV3(double** %154, double** %155, i32 %156, i32 %157, double %158, i32 %159, i32 %160, i32* %161)
store double %162, double* %23
br label %174
163: ; preds = %131
%164 = load double**, double*** %25
%165 = load double**, double*** %24
%166 = load i32, i32* %13
%167 = load i32, i32* %14
%168 = load double, double* %15
%169 = load i32, i32* %16
%170 = load i32, i32* %20
%171 = load i32*, i32** %21
%172 = call double @RB_GS_OmpLoopV4(double** %164, double** %165, i32 %166, i32 %167, double %168, i32 %169, i32 %170, i32* %171)
store double %172, double* %23
br label %174
173: ; preds = %131
store double -1.000000e+00, double* %23
br label %174
174: ; preds = %173, %163, %153, %143, %133
br label %175
175: ; preds = %174, %121
br label %234
176: ; preds = %115
%177 = load i32, i32* %17
%178 = icmp eq i32 %177, 0
br i1 %178, label %179, label %189
179: ; preds = %176
%180 = load double**, double*** %25
%181 = load double**, double*** %24
%182 = load i32, i32* %13
%183 = load i32, i32* %14
%184 = load double, double* %15
%185 = load i32, i32* %16
%186 = load i32, i32* %20
%187 = load i32*, i32** %21
%188 = call double @RB_GS_SeqLoopErr(double** %180, double** %181, i32 %182, i32 %183, double %184, i32 %185, i32 %186, i32* %187)
store double %188, double* %23
br label %233
189: ; preds = %176
%190 = load i32, i32* %19
switch i32 %190, label %231 [
i32 1, label %191
i32 2, label %201
i32 3, label %211
i32 4, label %221
]
191: ; preds = %189
%192 = load double**, double*** %25
%193 = load double**, double*** %24
%194 = load i32, i32* %13
%195 = load i32, i32* %14
%196 = load double, double* %15
%197 = load i32, i32* %16
%198 = load i32, i32* %20
%199 = load i32*, i32** %21
%200 = call double @RB_GS_OmpLoopV1err(double** %192, double** %193, i32 %194, i32 %195, double %196, i32 %197, i32 %198, i32* %199)
store double %200, double* %23
br label %232
201: ; preds = %189
%202 = load double**, double*** %25
%203 = load double**, double*** %24
%204 = load i32, i32* %13
%205 = load i32, i32* %14
%206 = load double, double* %15
%207 = load i32, i32* %16
%208 = load i32, i32* %20
%209 = load i32*, i32** %21
%210 = call double @RB_GS_OmpLoopV2err(double** %202, double** %203, i32 %204, i32 %205, double %206, i32 %207, i32 %208, i32* %209)
store double %210, double* %23
br label %232
211: ; preds = %189
%212 = load double**, double*** %25
%213 = load double**, double*** %24
%214 = load i32, i32* %13
%215 = load i32, i32* %14
%216 = load double, double* %15
%217 = load i32, i32* %16
%218 = load i32, i32* %20
%219 = load i32*, i32** %21
%220 = call double @RB_GS_OmpLoopV3err(double** %212, double** %213, i32 %214, i32 %215, double %216, i32 %217, i32 %218, i32* %219)
store double %220, double* %23
br label %232
221: ; preds = %189
%222 = load double**, double*** %25
%223 = load double**, double*** %24
%224 = load i32, i32* %13
%225 = load i32, i32* %14
%226 = load double, double* %15
%227 = load i32, i32* %16
%228 = load i32, i32* %20
%229 = load i32*, i32** %21
%230 = call double @RB_GS_OmpLoopV4err(double** %222, double** %223, i32 %224, i32 %225, double %226, i32 %227, i32 %228, i32* %229)
store double %230, double* %23
br label %232
231: ; preds = %189
store double -1.000000e+00, double* %23
br label %232
232: ; preds = %231, %221, %211, %201, %191
br label %233
233: ; preds = %232, %179
br label %234
234: ; preds = %233, %175
store i32 1, i32* %26
br label %235
235: ; preds = %272, %234
%236 = load i32, i32* %26
%237 = load i32, i32* %13
%238 = sub nsw i32 %237, 1
%239 = icmp slt i32 %236, %238
br i1 %239, label %240, label %275
240: ; preds = %235
%241 = load i32, i32* %26
%242 = srem i32 %241, 2
%243 = add nsw i32 %242, 1
store i32 %243, i32* %27
br label %244
244: ; preds = %268, %240
%245 = load i32, i32* %27
%246 = load i32, i32* %14
%247 = sub nsw i32 %246, 1
%248 = icmp slt i32 %245, %247
br i1 %248, label %249, label %271
249: ; preds = %244
%250 = load double**, double*** %25
%251 = load i32, i32* %26
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds double*, double** %250, i64 %252
%254 = load double*, double** %253
%255 = load i32, i32* %27
%256 = sdiv i32 %255, 2
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds double, double* %254, i64 %257
%259 = load double, double* %258
%260 = load double**, double*** %12
%261 = load i32, i32* %26
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds double*, double** %260, i64 %262
%264 = load double*, double** %263
%265 = load i32, i32* %27
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds double, double* %264, i64 %266
store double %259, double* %267
br label %268
268: ; preds = %249
%269 = load i32, i32* %27
%270 = add nsw i32 %269, 2
store i32 %270, i32* %27
br label %244
271: ; preds = %244
br label %272
272: ; preds = %271
%273 = load i32, i32* %26
%274 = add nsw i32 %273, 1
store i32 %274, i32* %26
br label %235
275: ; preds = %235
store i32 1, i32* %26
br label %276
276: ; preds = %314, %275
%277 = load i32, i32* %26
%278 = load i32, i32* %13
%279 = sub nsw i32 %278, 1
%280 = icmp slt i32 %277, %279
br i1 %280, label %281, label %317
281: ; preds = %276
%282 = load i32, i32* %26
%283 = add nsw i32 %282, 1
%284 = srem i32 %283, 2
%285 = add nsw i32 %284, 1
store i32 %285, i32* %27
br label %286
286: ; preds = %310, %281
%287 = load i32, i32* %27
%288 = load i32, i32* %14
%289 = sub nsw i32 %288, 1
%290 = icmp slt i32 %287, %289
br i1 %290, label %291, label %313
291: ; preds = %286
%292 = load double**, double*** %24
%293 = load i32, i32* %26
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds double*, double** %292, i64 %294
%296 = load double*, double** %295
%297 = load i32, i32* %27
%298 = sdiv i32 %297, 2
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds double, double* %296, i64 %299
%301 = load double, double* %300
%302 = load double**, double*** %12
%303 = load i32, i32* %26
%304 = sext i32 %303 to i64
%305 = getelementptr inbounds double*, double** %302, i64 %304
%306 = load double*, double** %305
%307 = load i32, i32* %27
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds double, double* %306, i64 %308
store double %301, double* %309
br label %310
310: ; preds = %291
%311 = load i32, i32* %27
%312 = add nsw i32 %311, 2
store i32 %312, i32* %27
br label %286
313: ; preds = %286
br label %314
314: ; preds = %313
%315 = load i32, i32* %26
%316 = add nsw i32 %315, 1
store i32 %316, i32* %26
br label %276
317: ; preds = %276
%318 = call double (...) @omp_get_wtime()
%319 = load double*, double** %22
%320 = load double, double* %319
%321 = fsub double %318, %320
%322 = load double*, double** %22
store double %321, double* %322
%323 = load double, double* %23
ret double %323
}

LLVM IR (-O2):
define double @RedBlack_GaussSeidel(double** nocapture %0, i32 %1, i32 %2, double %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32* %9, double* nocapture %10) {
%12 = sdiv i32 %2, 2
%13 = tail call double** @CreateGrid(i32 %1, i32 %12)
%14 = tail call double** @CreateGrid(i32 %1, i32 %12)
store i32 0, i32* %9
%15 = tail call double (...) @omp_get_wtime()
store double %15, double* %10
%16 = icmp sgt i32 %1, 0
br i1 %16, label %17, label %185
17: ; preds = %11
%18 = sext i32 %2 to i64
%19 = zext i32 %1 to i64
br label %27
20: ; preds = %96, %27
%21 = xor i1 %29, true
%22 = icmp eq i64 %41, %19
br i1 %22, label %23, label %27
23: ; preds = %20
br i1 %16, label %24, label %185
24: ; preds = %23
%25 = sext i32 %2 to i64
%26 = zext i32 %1 to i64
br label %104
27: ; preds = %17, %20
%28 = phi i64 [ 0, %17 ], [ %41, %20 ]
%29 = phi i1 [ true, %17 ], [ %21, %20 ]
%30 = or i64 %28, -2
%31 = add nsw i64 %30, %18
%32 = lshr i64 %31, 1
%33 = add nuw i64 %32, 1
%34 = and i64 %28, 1
%35 = xor i64 %34, 1
%36 = or i64 %28, -2
%37 = add nsw i64 %36, %18
%38 = lshr i64 %37, 1
%39 = and i64 %37, -2
%40 = or i64 %39, %35
%41 = add nuw nsw i64 %28, 1
%42 = trunc i64 %41 to i32
%43 = and i32 %42, 1
%44 = icmp slt i32 %43, %2
br i1 %44, label %45, label %20
45: ; preds = %27
%46 = zext i1 %29 to i64
%47 = getelementptr inbounds double*, double** %0, i64 %28
%48 = load double*, double** %47
%49 = getelementptr inbounds double*, double** %14, i64 %28
%50 = load double*, double** %49
%51 = icmp ult i64 %31, 8
br i1 %51, label %94, label %52
52: ; preds = %45
%53 = getelementptr double, double* %50, i64 1
%54 = getelementptr double, double* %53, i64 %38
%55 = getelementptr double, double* %48, i64 %35
%56 = getelementptr double, double* %48, i64 1
%57 = getelementptr double, double* %56, i64 %40
%58 = icmp ult double* %50, %57
%59 = icmp ult double* %55, %54
%60 = and i1 %58, %59
br i1 %60, label %94, label %61
61: ; preds = %52
%62 = and i64 %33, 3
%63 = icmp eq i64 %62, 0
%64 = select i1 %63, i64 4, i64 %62
%65 = sub i64 %33, %64
%66 = shl i64 %65, 1
%67 = or i64 %66, %46
br label %68
68: ; preds = %68, %61
%69 = phi i64 [ 0, %61 ], [ %92, %68 ]
%70 = shl i64 %69, 1
%71 = or i64 %70, %46
%72 = or i64 %71, 2
%73 = or i64 %71, 4
%74 = or i64 %71, 6
%75 = getelementptr inbounds double, double* %48, i64 %71
%76 = getelementptr inbounds double, double* %48, i64 %72
%77 = getelementptr inbounds double, double* %48, i64 %73
%78 = getelementptr inbounds double, double* %48, i64 %74
%79 = load double, double* %75
%80 = load double, double* %76
%81 = insertelement <2 x double> poison, double %79, i64 0
%82 = insertelement <2 x double> %81, double %80, i64 1
%83 = load double, double* %77
%84 = load double, double* %78
%85 = insertelement <2 x double> poison, double %83, i64 0
%86 = insertelement <2 x double> %85, double %84, i64 1
%87 = and i64 %69, 9223372036854775804
%88 = getelementptr inbounds double, double* %50, i64 %87
%89 = bitcast double* %88 to <2 x double>*
store <2 x double> %82, <2 x double>* %89
%90 = getelementptr inbounds double, double* %88, i64 2
%91 = bitcast double* %90 to <2 x double>*
store <2 x double> %86, <2 x double>* %91
%92 = add nuw i64 %69, 4
%93 = icmp eq i64 %92, %65
br i1 %93, label %94, label %68
94: ; preds = %68, %52, %45
%95 = phi i64 [ %46, %52 ], [ %46, %45 ], [ %67, %68 ]
br label %96
96: ; preds = %94, %96
%97 = phi i64 [ %102, %96 ], [ %95, %94 ]
%98 = getelementptr inbounds double, double* %48, i64 %97
%99 = load double, double* %98
%100 = lshr i64 %97, 1
%101 = getelementptr inbounds double, double* %50, i64 %100
store double %99, double* %101
%102 = add nuw nsw i64 %97, 2
%103 = icmp slt i64 %102, %18
br i1 %103, label %96, label %20
104: ; preds = %24, %181
%105 = phi i64 [ 0, %24 ], [ %182, %181 ]
%106 = phi i32 [ 0, %24 ], [ %183, %181 ]
%107 = and i64 %105, 1
%108 = xor i64 %107, -1
%109 = add nsw i64 %108, %18
%110 = lshr i64 %109, 1
%111 = add nuw i64 %110, 1
%112 = and i64 %105, 1
%113 = xor i64 %112, -1
%114 = add nsw i64 %113, %18
%115 = lshr i64 %114, 1
%116 = and i64 %114, -2
%117 = or i64 %116, %112
%118 = trunc i64 %105 to i32
%119 = and i32 %118, 1
%120 = icmp slt i32 %119, %2
br i1 %120, label %121, label %181
121: ; preds = %104
%122 = and i32 %106, 1
%123 = zext i32 %122 to i64
%124 = getelementptr inbounds double*, double** %0, i64 %105
%125 = load double*, double** %124
%126 = getelementptr inbounds double*, double** %13, i64 %105
%127 = load double*, double** %126
%128 = icmp ult i64 %109, 8
br i1 %128, label %171, label %129
129: ; preds = %121
%130 = getelementptr double, double* %127, i64 1
%131 = getelementptr double, double* %130, i64 %115
%132 = getelementptr double, double* %125, i64 %112
%133 = getelementptr double, double* %125, i64 1
%134 = getelementptr double, double* %133, i64 %117
%135 = icmp ult double* %127, %134
%136 = icmp ult double* %132, %131
%137 = and i1 %135, %136
br i1 %137, label %171, label %138
138: ; preds = %129
%139 = and i64 %111, 3
%140 = icmp eq i64 %139, 0
%141 = select i1 %140, i64 4, i64 %139
%142 = sub i64 %111, %141
%143 = shl i64 %142, 1
%144 = or i64 %143, %123
br label %145
145: ; preds = %145, %138
%146 = phi i64 [ 0, %138 ], [ %169, %145 ]
%147 = shl i64 %146, 1
%148 = or i64 %147, %123
%149 = or i64 %148, 2
%150 = or i64 %148, 4
%151 = or i64 %148, 6
%152 = getelementptr inbounds double, double* %125, i64 %148
%153 = getelementptr inbounds double, double* %125, i64 %149
%154 = getelementptr inbounds double, double* %125, i64 %150
%155 = getelementptr inbounds double, double* %125, i64 %151
%156 = load double, double* %152
%157 = load double, double* %153
%158 = insertelement <2 x double> poison, double %156, i64 0
%159 = insertelement <2 x double> %158, double %157, i64 1
%160 = load double, double* %154
%161 = load double, double* %155
%162 = insertelement <2 x double> poison, double %160, i64 0
%163 = insertelement <2 x double> %162, double %161, i64 1
%164 = and i64 %146, 9223372036854775804
%165 = getelementptr inbounds double, double* %127, i64 %164
%166 = bitcast double* %165 to <2 x double>*
store <2 x double> %159, <2 x double>* %166
%167 = getelementptr inbounds double, double* %165, i64 2
%168 = bitcast double* %167 to <2 x double>*
store <2 x double> %163, <2 x double>* %168
%169 = add nuw i64 %146, 4
%170 = icmp eq i64 %169, %142
br i1 %170, label %171, label %145
171: ; preds = %145, %129, %121
%172 = phi i64 [ %123, %129 ], [ %123, %121 ], [ %144, %145 ]
br label %173
173: ; preds = %171, %173
%174 = phi i64 [ %179, %173 ], [ %172, %171 ]
%175 = getelementptr inbounds double, double* %125, i64 %174
%176 = load double, double* %175
%177 = lshr i64 %174, 1
%178 = getelementptr inbounds double, double* %127, i64 %177
store double %176, double* %178
%179 = add nuw nsw i64 %174, 2
%180 = icmp slt i64 %179, %25
br i1 %180, label %173, label %181
181: ; preds = %173, %104
%182 = add nuw nsw i64 %105, 1
%183 = add nuw nsw i32 %106, 1
%184 = icmp eq i64 %182, %26
br i1 %184, label %185, label %104
185: ; preds = %181, %11, %23
%186 = icmp eq i32 %6, 0
%187 = icmp eq i32 %5, 0
br i1 %186, label %188, label %200
188: ; preds = %185
br i1 %187, label %189, label %191
189: ; preds = %188
%190 = tail call double @RB_GS_SeqLoop(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
191: ; preds = %188
switch i32 %7, label %212 [
i32 1, label %192
i32 2, label %194
i32 3, label %196
i32 4, label %198
]
192: ; preds = %191
%193 = tail call double @RB_GS_OmpLoopV1(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
194: ; preds = %191
%195 = tail call double @RB_GS_OmpLoopV2(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
196: ; preds = %191
%197 = tail call double @RB_GS_OmpLoopV3(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
198: ; preds = %191
%199 = tail call double @RB_GS_OmpLoopV4(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
200: ; preds = %185
br i1 %187, label %201, label %203
201: ; preds = %200
%202 = tail call double @RB_GS_SeqLoopErr(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
203: ; preds = %200
switch i32 %7, label %212 [
i32 1, label %204
i32 2, label %206
i32 3, label %208
i32 4, label %210
]
204: ; preds = %203
%205 = tail call double @RB_GS_OmpLoopV1err(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
206: ; preds = %203
%207 = tail call double @RB_GS_OmpLoopV2err(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
208: ; preds = %203
%209 = tail call double @RB_GS_OmpLoopV3err(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
210: ; preds = %203
%211 = tail call double @RB_GS_OmpLoopV4err(double** %14, double** %13, i32 %1, i32 %2, double %3, i32 %4, i32 %8, i32* %9)
br label %212
212: ; preds = %203, %191, %201, %210, %208, %206, %204, %189, %198, %196, %194, %192
%213 = phi double [ %190, %189 ], [ %199, %198 ], [ %197, %196 ], [ %195, %194 ], [ %193, %192 ], [ %202, %201 ], [ %211, %210 ], [ %209, %208 ], [ %207, %206 ], [ %205, %204 ], [ -1.000000e+00, %191 ], [ -1.000000e+00, %203 ]
%214 = add i32 %1, -1
%215 = icmp sgt i32 %1, 2
br i1 %215, label %216, label %277
216: ; preds = %212
%217 = add nsw i32 %2, -1
%218 = sext i32 %217 to i64
%219 = zext i32 %214 to i64
br label %225
220: ; preds = %248
br i1 %215, label %221, label %277
221: ; preds = %220
%222 = add nsw i32 %2, -1
%223 = sext i32 %222 to i64
%224 = zext i32 %214 to i64
br label %255
225: ; preds = %216, %248
%226 = phi i64 [ 1, %216 ], [ %249, %248 ]
%227 = phi i32 [ 1, %216 ], [ %250, %248 ]
%228 = trunc i64 %226 to i32
%229 = and i32 %228, 1
%230 = add nuw nsw i32 %229, 1
%231 = icmp slt i32 %230, %217
br i1 %231, label %232, label %248
232: ; preds = %225
%233 = and i32 %227, 1
%234 = add nuw nsw i32 %233, 1
%235 = zext i32 %234 to i64
%236 = getelementptr inbounds double*, double** %14, i64 %226
%237 = load double*, double** %236
%238 = getelementptr inbounds double*, double** %0, i64 %226
%239 = load double*, double** %238
br label %240
240: ; preds = %232, %240
%241 = phi i64 [ %235, %232 ], [ %246, %240 ]
%242 = lshr i64 %241, 1
%243 = getelementptr inbounds double, double* %237, i64 %242
%244 = load double, double* %243
%245 = getelementptr inbounds double, double* %239, i64 %241
store double %244, double* %245
%246 = add nuw nsw i64 %241, 2
%247 = icmp slt i64 %246, %218
br i1 %247, label %240, label %248
248: ; preds = %240, %225
%249 = add nuw nsw i64 %226, 1
%250 = add nuw nsw i32 %227, 1
%251 = icmp eq i64 %249, %219
br i1 %251, label %220, label %225
252: ; preds = %269, %255
%253 = xor i1 %257, true
%254 = icmp eq i64 %258, %224
br i1 %254, label %277, label %255
255: ; preds = %221, %252
%256 = phi i64 [ 1, %221 ], [ %258, %252 ]
%257 = phi i1 [ false, %221 ], [ %253, %252 ]
%258 = add nuw nsw i64 %256, 1
%259 = trunc i64 %258 to i32
%260 = and i32 %259, 1
%261 = add nuw nsw i32 %260, 1
%262 = icmp slt i32 %261, %222
br i1 %262, label %263, label %252
263: ; preds = %255
%264 = select i1 %257, i64 2, i64 1
%265 = getelementptr inbounds double*, double** %13, i64 %256
%266 = load double*, double** %265
%267 = getelementptr inbounds double*, double** %0, i64 %256
%268 = load double*, double** %267
br label %269
269: ; preds = %263, %269
%270 = phi i64 [ %264, %263 ], [ %275, %269 ]
%271 = lshr i64 %270, 1
%272 = getelementptr inbounds double, double* %266, i64 %271
%273 = load double, double* %272
%274 = getelementptr inbounds double, double* %268, i64 %270
store double %273, double* %274
%275 = add nuw nsw i64 %270, 2
%276 = icmp slt i64 %275, %223
br i1 %276, label %269, label %252
277: ; preds = %252, %212, %220
%278 = tail call double (...) @omp_get_wtime()
%279 = load double, double* %10
%280 = fsub double %278, %279
store double %280, double* %10
ret double %213
}