#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);
scalar_t__ 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*/ gauss(double **, double **, int, int, int, int, int, double);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ init2d(double **, int, int);
int omp_get_thread_num();
int /*<<< orphan*/ omp_set_num_threads(int);
int /*<<< orphan*/ printf(char *, int, double, double);
int sin(double);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int global[2];
  int grid;
  struct timeval tts, ttf;
  double **u_current, **u_previous, **swap;
  double omega;
  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]);
  }
  omega = 2.0 / (1 + sin(3.14 / global[0]));
  u_previous = allocate2d(global[0], global[1]);
  init2d(u_previous, global[0], global[1]);
  u_current = allocate2d(global[0], global[1]);
  copy2d(u_current, u_previous, global[0], global[1]);
  int nthreads = grid;
  omp_set_num_threads(nthreads);
  int globalConv = 0;
  int iters = 0;
  double time = 0, compTime = 0;
  double *comps = calloc(nthreads, sizeof(double));
#pragma omp parallel
  {
    int tid = omp_get_thread_num();
    int local_i, local_j, range;
    int x, y, wavefront;
    struct timeval tcs, tcf;
    while (!globalConv) {
#pragma omp single
      {
        ++iters;
        gettimeofday(&tts, NULL);
      }
      x = 1;
      y = 1;
      while (x < global[0] - 1) {
        x += (x == 0);
        while (y < global[1] - 1) {
          y += (y == 0);
          wavefront = y + 1 - x;
          range = (wavefront / nthreads) + ((wavefront % nthreads) != 0);
          local_i = tid * range + x;
          local_j = y - tid * range;
#pragma omp barrier
          gettimeofday(&tcs, NULL);
          gauss(u_previous, u_current, local_i, local_j, range, global[0],
                global[1], omega);
          gettimeofday(&tcf, NULL);
          comps[tid] += (tcf.tv_sec - tcs.tv_sec) +
                        (tcf.tv_usec - tcs.tv_usec) * 0.000001;
          ++y;
#pragma omp barrier
        }
        wavefront = y - x;
        range = (wavefront / nthreads) + ((wavefront % nthreads) != 0);
        local_i = tid * range + x;
        local_j = (y - 1) - tid * range;
#pragma omp barrier
        gettimeofday(&tcs, NULL);
        gauss(u_previous, u_current, local_i, local_j, range, global[0],
              global[1], omega);
        gettimeofday(&tcf, NULL);
        comps[tid] +=
            (tcf.tv_sec - tcs.tv_sec) + (tcf.tv_usec - tcs.tv_usec) * 0.000001;
        ++x;
      }
#pragma omp barrier
      if ((iters % 100 == 0) && (tid == 0)) {
        if (converge(u_previous, u_current, 1, global[1] - 1, 1,
                     global[0] - 1)) {
          globalConv = 1;
        }
      }
#pragma omp single
      {
        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;
      }
    }
  }
  int i;
  for (i = 0; i < nthreads; ++i)
    compTime = (compTime >= comps[i]) ? compTime : comps[i];
  printf("SeidelSOR\tIters: %d Time: %.3lf \t Computation: %.3lf\n", iters,
         time, compTime);
  fprint2d("testseidel.out", u_current, global[0], global[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1232 <main+0x42>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
lea    0xdf5(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   1110 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  0xd99(%rip),%xmm0
divsd  %xmm1,%xmm0
call   10a0 <sin@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xd79(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1070 <allocate2d@plt>
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
call   10b0 <init2d@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1070 <allocate2d@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   10d0 <copy2d@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%edi
call   10e0 <omp_set_num_threads@plt>
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x64(%rbp),%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,-0x88(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8c(%rbp)
cmpl   $0x0,-0x68(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1333 <main+0x143>
jmp    16c7 <main+0x4d7>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
movl   $0x1,-0x9c(%rbp)
movl   $0x1,-0xa0(%rbp)
mov    -0x9c(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1611 <main+0x421>
cmpl   $0x0,-0x9c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0x9c(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0xa0(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    14e6 <main+0x2f6>
cmpl   $0x0,-0xa0(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0xa0(%rbp),%eax
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
sub    -0x9c(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cltd
idivl  -0x64(%rbp)
mov    %eax,-0xd0(%rbp)
mov    -0xa4(%rbp),%eax
cltd
idivl  -0x64(%rbp)
mov    -0xd0(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x98(%rbp)
mov    -0x8c(%rbp),%eax
imul   -0x98(%rbp),%eax
add    -0x9c(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0xa0(%rbp),%eax
mov    -0x8c(%rbp),%ecx
imul   -0x98(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x94(%rbp)
lea    -0xb8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x90(%rbp),%edx
mov    -0x94(%rbp),%ecx
mov    -0x98(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x14(%rbp),%eax
movsd  -0x60(%rbp),%xmm0
mov    %eax,(%rsp)
call   1040 <gauss@plt>
lea    -0xc8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0xc0(%rbp),%rax
sub    -0xb0(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
subsd  -0xb8(%rbp),%xmm0
ff
movsd  0xb5e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x88(%rbp),%rax
movslq -0x8c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    138c <main+0x19c>
mov    -0xa0(%rbp),%eax
sub    -0x9c(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cltd
idivl  -0x64(%rbp)
mov    %eax,-0xd4(%rbp)
mov    -0xa4(%rbp),%eax
cltd
idivl  -0x64(%rbp)
mov    -0xd4(%rbp),%eax
cmp    $0x0,%edx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x98(%rbp)
mov    -0x8c(%rbp),%eax
imul   -0x98(%rbp),%eax
add    -0x9c(%rbp),%eax
mov    %eax,-0x90(%rbp)
mov    -0xa0(%rbp),%eax
sub    $0x1,%eax
mov    -0x8c(%rbp),%ecx
imul   -0x98(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x94(%rbp)
lea    -0xb8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x90(%rbp),%edx
mov    -0x94(%rbp),%ecx
mov    -0x98(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x14(%rbp),%eax
movsd  -0x60(%rbp),%xmm0
mov    %eax,(%rsp)
call   1040 <gauss@plt>
lea    -0xc8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0xc0(%rbp),%rax
sub    -0xb0(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
subsd  -0xb8(%rbp),%xmm0
ff
movsd  0xa33(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x88(%rbp),%rax
movslq -0x8c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    135d <main+0x16d>
mov    -0x6c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    166c <main+0x47c>
cmpl   $0x0,-0x8c(%rbp)
jne    166c <main+0x47c>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%r9d
sub    $0x1,%r9d
mov    $0x1,%r8d
mov    %r8d,%edx
call   10c0 <converge@plt>
cmp    $0x0,%rax
je     1667 <main+0x477>
movl   $0x1,-0x68(%rbp)
jmp    166c <main+0x47c>
mov    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1060 <gettimeofday@plt>
mov    -0x38(%rbp),%rax
sub    -0x28(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  0x960(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    131d <main+0x12d>
movl   $0x0,-0xcc(%rbp)
mov    -0xcc(%rbp),%eax
cmp    -0x64(%rbp),%eax
jge    174c <main+0x55c>
movsd  -0x80(%rbp),%xmm0
mov    -0x88(%rbp),%rax
movslq -0xcc(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jb     1710 <main+0x520>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
jmp    172b <main+0x53b>
mov    -0x88(%rbp),%rax
movslq -0xcc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x80(%rbp)
mov    -0xcc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xcc(%rbp)
jmp    16d1 <main+0x4e1>
mov    -0x6c(%rbp),%esi
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
lea    0x8d1(%rip),%rdi
call   1050 <printf@plt>
mov    -0x48(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0x8f1(%rip),%rdi
call   10f0 <fprint2d@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
cmp    $0x4,%edi
jne    1722 <main+0x532>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1100 <atoi@plt>
mov    %eax,%r15d
mov    0x10(%rbx),%rdi
call   1100 <atoi@plt>
mov    %eax,%r12d
mov    0x18(%rbx),%rdi
call   1100 <atoi@plt>
mov    %eax,%r14d
cvtsi2sd %r15d,%xmm1
movsd  0xdc2(%rip),%xmm0
divsd  %xmm1,%xmm0
call   10a0 <sin@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0xdaf(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x48(%rsp)
mov    %r15d,%edi
mov    %r12d,%esi
call   1070 <allocate2d@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r15d,%esi
mov    %r12d,%edx
call   10b0 <init2d@plt>
mov    %r15d,%edi
mov    %r12d,%esi
call   1070 <allocate2d@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %rbp,0x18(%rsp)
mov    %rbp,%rsi
mov    %r15d,%edx
mov    %r12d,%ecx
call   10d0 <copy2d@plt>
mov    %r14d,%edi
call   10e0 <omp_set_num_threads@plt>
mov    %r14d,0x10(%rsp)
mov    %r14d,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,0x28(%rsp)
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    -0x1(%r15),%ecx
mov    %ecx,0x24(%rsp)
mov    %r12d,0x8(%rsp)
add    $0xffffffff,%r12d
mov    %r12d,0x14(%rsp)
mov    %eax,0xc(%rsp)
cltq
mov    %rax,0x40(%rsp)
xorpd  %xmm0,%xmm0
mov    %r15,0x80(%rsp)
jmp    135e <main+0x16e>
nopl   0x0(%rax,%rax,1)
lea    0x88(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x90(%rsp),%rax
sub    0xa0(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x88(%rsp),%xmm1
subsd  0x98(%rsp),%xmm1
movsd  0xccf(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x70(%rsp),%xmm0
addsd  %xmm1,%xmm0
mov    %rbp,%r13
test   %ebx,%ebx
jne    15c5 <main+0x3d5>
movsd  %xmm0,0x70(%rsp)
mov    0x18(%rsp),%rbp
mov    %r13,0x18(%rsp)
add    $0x1,%r14d
mov    %r14,0x78(%rsp)
lea    0x98(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
cmp    $0x3,%r15d
jl     1570 <main+0x380>
mov    $0x1,%ebx
mov    $0x1,%esi
mov    %rbp,0x50(%rsp)
jmp    1472 <main+0x282>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%eax
sub    %esi,%eax
cltd
idivl  0x10(%rsp)
mov    %edx,%r12d
mov    0xc(%rsp),%ecx
lea    0x30(%rsp),%rdi
mov    0x8(%rsp),%r13d
cmp    $0x1,%r12d
sbb    $0xffffffff,%eax
mov    %eax,%r12d
imul   %ecx,%r12d
lea    (%r12,%rsi,1),%r14d
not    %r12d
add    %ebx,%r12d
xor    %esi,%esi
mov    %eax,%ebp
call   1060 <gettimeofday@plt>
mov    %r13d,(%rsp)
mov    0x50(%rsp),%r13
mov    %r13,%rdi
mov    0x18(%rsp),%rsi
mov    %r14d,%edx
mov    %r12d,%ecx
mov    %ebp,%r8d
mov    %r15d,%r9d
movsd  0x48(%rsp),%xmm0
call   1040 <gauss@plt>
lea    0x60(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x58(%rsp),%rsi
mov    0x68(%rsp),%rax
sub    0x38(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x60(%rsp),%xmm1
subsd  0x30(%rsp),%xmm1
mulsd  0xbc6(%rip),%xmm1
addsd  %xmm0,%xmm1
mov    0x28(%rsp),%rax
mov    0x40(%rsp),%rdx
addsd  (%rax,%rdx,8),%xmm1
movsd  %xmm1,(%rax,%rdx,8)
add    $0x1,%esi
cmp    0x24(%rsp),%esi
mov    %r13,%rbp
jge    1570 <main+0x380>
cmp    $0x1,%esi
adc    $0x0,%esi
mov    0x14(%rsp),%eax
cmp    %eax,%ebx
mov    %rsi,0x58(%rsp)
jge    13b0 <main+0x1c0>
mov    0xc(%rsp),%ecx
nopl   (%rax)
cmp    $0x1,%ebx
mov    %ebx,%r13d
adc    $0x0,%r13d
lea    0x1(%r13),%ebx
mov    %ebx,%eax
sub    %esi,%eax
cltd
idivl  0x10(%rsp)
mov    %eax,%ebp
mov    %edx,%r12d
cmp    $0x1,%edx
mov    %eax,%r15d
sbb    $0xffffffff,%r15d
mov    %r15d,%r14d
imul   %ecx,%r14d
sub    %r14d,%r13d
add    %esi,%r14d
lea    0x30(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x8(%rsp),%eax
mov    %eax,(%rsp)
mov    0x50(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    %r14d,%edx
mov    %r13d,%ecx
mov    %r15d,%r8d
mov    0x80(%rsp),%r15
mov    %r15d,%r9d
movsd  0x48(%rsp),%xmm0
call   1040 <gauss@plt>
lea    0x60(%rsp),%rdi
xor    %esi,%esi
call   1060 <gettimeofday@plt>
mov    0x58(%rsp),%rsi
lea    0x30(%rsp),%rdi
mov    0xc(%rsp),%ecx
mov    0x68(%rsp),%rax
sub    0x38(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x60(%rsp),%xmm1
subsd  0x30(%rsp),%xmm1
mulsd  0xad1(%rip),%xmm1
addsd  %xmm0,%xmm1
mov    0x40(%rsp),%rax
mov    0x28(%rsp),%rdx
addsd  (%rdx,%rax,8),%xmm1
movsd  %xmm1,(%rdx,%rax,8)
cmp    0x14(%rsp),%ebx
jl     1490 <main+0x2a0>
mov    0x8(%rsp),%r13d
mov    %ebp,%eax
jmp    13ca <main+0x1da>
nopl   (%rax)
mov    0x78(%rsp),%r14
mov    %r14d,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%eax
mov    %r14d,%ecx
sub    %eax,%ecx
xor    %ebx,%ebx
or     0xc(%rsp),%ecx
jne    1300 <main+0x110>
mov    %rbp,%rdi
mov    0x18(%rsp),%rsi
mov    $0x1,%edx
mov    0x14(%rsp),%ecx
mov    $0x1,%r8d
mov    0x24(%rsp),%r9d
call   10c0 <converge@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
jmp    1300 <main+0x110>
mov    0x10(%rsp),%eax
test   %eax,%eax
jle    15f2 <main+0x402>
mov    %eax,%ecx
lea    -0x1(%rcx),%rdx
mov    %ecx,%eax
and    $0x3,%eax
cmp    $0x3,%rdx
jae    15ff <main+0x40f>
xorpd  %xmm5,%xmm5
xor    %edx,%edx
mov    0x28(%rsp),%rsi
mov    0x8(%rsp),%ebx
jmp    16a8 <main+0x4b8>
xorpd  %xmm1,%xmm1
mov    0x8(%rsp),%ebx
jmp    16eb <main+0x4fb>
and    $0xfffffffc,%ecx
xorpd  %xmm5,%xmm5
xor    %edx,%edx
mov    0x28(%rsp),%rsi
mov    0x8(%rsp),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rsi,%rdx,8),%xmm1
movsd  0x8(%rsi,%rdx,8),%xmm2
movapd %xmm1,%xmm3
cmplesd %xmm5,%xmm3
movapd %xmm3,%xmm4
andnpd %xmm1,%xmm4
andpd  %xmm5,%xmm3
orpd   %xmm4,%xmm3
movapd %xmm2,%xmm4
cmplesd %xmm3,%xmm4
movapd %xmm4,%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm4
orpd   %xmm1,%xmm4
movsd  0x10(%rsi,%rdx,8),%xmm1
movapd %xmm1,%xmm2
cmplesd %xmm4,%xmm2
movapd %xmm2,%xmm3
andpd  %xmm4,%xmm3
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
movsd  0x18(%rsi,%rdx,8),%xmm1
movapd %xmm1,%xmm5
cmplesd %xmm2,%xmm5
movapd %xmm5,%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm1,%xmm5
orpd   %xmm3,%xmm5
add    $0x4,%rdx
cmp    %rdx,%rcx
jne    1620 <main+0x430>
movapd %xmm5,%xmm1
test   %rax,%rax
je     16eb <main+0x4fb>
lea    (%rsi,%rdx,8),%rcx
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movsd  (%rcx,%rdx,8),%xmm2
movapd %xmm2,%xmm1
cmplesd %xmm5,%xmm1
movapd %xmm1,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm5,%xmm1
orpd   %xmm3,%xmm1
add    $0x1,%rdx
movapd %xmm1,%xmm5
cmp    %rdx,%rax
jne    16c0 <main+0x4d0>
lea    0x93f(%rip),%rdi
mov    %r14d,%esi
call   1050 <printf@plt>
lea    0x966(%rip),%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
mov    %ebx,%ecx
call   10f0 <fprint2d@plt>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x28b7(%rip),%rax
mov    (%rax),%edi
lea    0x8e6(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   1110 <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 = [54 x i8] c"SeidelSOR\09Iters: %d Time: %.3lf \09 Computation: %.3lf\0A\00"
@.str.2 = [15 x i8] c"testseidel.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 %struct.timeval
%9 = alloca %struct.timeval
%10 = alloca double**
%11 = alloca double**
%12 = alloca double**
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca double*
%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
%29 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%30 = load i32, i32* %4
%31 = icmp ne i32 %30, 4
br i1 %31, label %32, label %36
32: ; preds = %2
%33 = load i32, i32* @stderr
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%35 = call i32 @exit(i32 -1)
unreachable
36: ; preds = %2
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 @atoi(i8* %39)
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 %40, i32* %41
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 2
%44 = load i8*, i8** %43
%45 = call i32 @atoi(i8* %44)
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %45, i32* %46
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 3
%49 = load i8*, i8** %48
%50 = call i32 @atoi(i8* %49)
store i32 %50, i32* %7
br label %51
51: ; preds = %36
%52 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%53 = load i32, i32* %52
%54 = sitofp i32 %53 to double
%55 = fdiv double 3.140000e+00, %54
%56 = call i32 @sin(double %55)
%57 = add nsw i32 1, %56
%58 = sitofp i32 %57 to double
%59 = fdiv double 2.000000e+00, %58
store double %59, double* %13
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%61 = load i32, i32* %60
%62 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%63 = load i32, i32* %62
%64 = call double** @allocate2d(i32 %61, i32 %63)
store double** %64, double*** %11
%65 = load double**, double*** %11
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%67 = load i32, i32* %66
%68 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%69 = load i32, i32* %68
%70 = call i32 @init2d(double** %65, i32 %67, i32 %69)
%71 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%72 = load i32, i32* %71
%73 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%74 = load i32, i32* %73
%75 = call double** @allocate2d(i32 %72, i32 %74)
store double** %75, double*** %10
%76 = load double**, double*** %10
%77 = load double**, double*** %11
%78 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%79 = load i32, i32* %78
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%81 = load i32, i32* %80
%82 = call i32 @copy2d(double** %76, double** %77, i32 %79, i32 %81)
%83 = load i32, i32* %7
store i32 %83, i32* %14
%84 = load i32, i32* %14
%85 = call i32 @omp_set_num_threads(i32 %84)
store i32 0, i32* %15
store i32 0, i32* %16
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
%86 = load i32, i32* %14
%87 = call double* @calloc(i32 %86, i32 8)
store double* %87, double** %19
%88 = call i32 (...) @omp_get_thread_num()
store i32 %88, i32* %20
br label %89
89: ; preds = %254, %51
%90 = load i32, i32* %15
%91 = icmp ne i32 %90, 0
%92 = xor i1 %91, true
br i1 %92, label %93, label %273
93: ; preds = %89
%94 = load i32, i32* %16
%95 = add nsw i32 %94, 1
store i32 %95, i32* %16
%96 = call i32 @gettimeofday(%struct.timeval* %8, i32* null)
store i32 1, i32* %24
store i32 1, i32* %25
br label %97
97: ; preds = %177, %93
%98 = load i32, i32* %24
%99 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%100 = load i32, i32* %99
%101 = sub nsw i32 %100, 1
%102 = icmp slt i32 %98, %101
br i1 %102, label %103, label %234
103: ; preds = %97
%104 = load i32, i32* %24
%105 = icmp eq i32 %104, 0
%106 = zext i1 %105 to i32
%107 = load i32, i32* %24
%108 = add nsw i32 %107, %106
store i32 %108, i32* %24
br label %109
109: ; preds = %115, %103
%110 = load i32, i32* %25
%111 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%112 = load i32, i32* %111
%113 = sub nsw i32 %112, 1
%114 = icmp slt i32 %110, %113
br i1 %114, label %115, label %177
115: ; preds = %109
%116 = load i32, i32* %25
%117 = icmp eq i32 %116, 0
%118 = zext i1 %117 to i32
%119 = load i32, i32* %25
%120 = add nsw i32 %119, %118
store i32 %120, i32* %25
%121 = load i32, i32* %25
%122 = add nsw i32 %121, 1
%123 = load i32, i32* %24
%124 = sub nsw i32 %122, %123
store i32 %124, i32* %26
%125 = load i32, i32* %26
%126 = load i32, i32* %14
%127 = sdiv i32 %125, %126
%128 = load i32, i32* %26
%129 = load i32, i32* %14
%130 = srem i32 %128, %129
%131 = icmp ne i32 %130, 0
%132 = zext i1 %131 to i32
%133 = add nsw i32 %127, %132
store i32 %133, i32* %23
%134 = load i32, i32* %20
%135 = load i32, i32* %23
%136 = mul nsw i32 %134, %135
%137 = load i32, i32* %24
%138 = add nsw i32 %136, %137
store i32 %138, i32* %21
%139 = load i32, i32* %25
%140 = load i32, i32* %20
%141 = load i32, i32* %23
%142 = mul nsw i32 %140, %141
%143 = sub nsw i32 %139, %142
store i32 %143, i32* %22
%144 = call i32 @gettimeofday(%struct.timeval* %27, i32* null)
%145 = load double**, double*** %11
%146 = load double**, double*** %10
%147 = load i32, i32* %21
%148 = load i32, i32* %22
%149 = load i32, i32* %23
%150 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%151 = load i32, i32* %150
%152 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%153 = load i32, i32* %152
%154 = load double, double* %13
%155 = call i32 @gauss(double** %145, double** %146, i32 %147, i32 %148, i32 %149, i32 %151, i32 %153, double %154)
%156 = call i32 @gettimeofday(%struct.timeval* %28, i32* null)
%157 = getelementptr inbounds %struct.timeval, %struct.timeval* %28, i32 0, i32 1
%158 = load i64, i64* %157
%159 = getelementptr inbounds %struct.timeval, %struct.timeval* %27, i32 0, i32 1
%160 = load i64, i64* %159
%161 = sub nsw i64 %158, %160
%162 = sitofp i64 %161 to double
%163 = getelementptr inbounds %struct.timeval, %struct.timeval* %28, i32 0, i32 0
%164 = load double, double* %163
%165 = getelementptr inbounds %struct.timeval, %struct.timeval* %27, i32 0, i32 0
%166 = load double, double* %165
%167 = fsub double %164, %166
%168 = call double @llvm.fmuladd.f64(double %167, double 0x3EB0C6F7A0B5ED8D, double %162)
%169 = load double*, double** %19
%170 = load i32, i32* %20
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds double, double* %169, i64 %171
%173 = load double, double* %172
%174 = fadd double %173, %168
store double %174, double* %172
%175 = load i32, i32* %25
%176 = add nsw i32 %175, 1
store i32 %176, i32* %25
br label %109
177: ; preds = %109
%178 = load i32, i32* %25
%179 = load i32, i32* %24
%180 = sub nsw i32 %178, %179
store i32 %180, i32* %26
%181 = load i32, i32* %26
%182 = load i32, i32* %14
%183 = sdiv i32 %181, %182
%184 = load i32, i32* %26
%185 = load i32, i32* %14
%186 = srem i32 %184, %185
%187 = icmp ne i32 %186, 0
%188 = zext i1 %187 to i32
%189 = add nsw i32 %183, %188
store i32 %189, i32* %23
%190 = load i32, i32* %20
%191 = load i32, i32* %23
%192 = mul nsw i32 %190, %191
%193 = load i32, i32* %24
%194 = add nsw i32 %192, %193
store i32 %194, i32* %21
%195 = load i32, i32* %25
%196 = sub nsw i32 %195, 1
%197 = load i32, i32* %20
%198 = load i32, i32* %23
%199 = mul nsw i32 %197, %198
%200 = sub nsw i32 %196, %199
store i32 %200, i32* %22
%201 = call i32 @gettimeofday(%struct.timeval* %27, i32* null)
%202 = load double**, double*** %11
%203 = load double**, double*** %10
%204 = load i32, i32* %21
%205 = load i32, i32* %22
%206 = load i32, i32* %23
%207 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%208 = load i32, i32* %207
%209 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%210 = load i32, i32* %209
%211 = load double, double* %13
%212 = call i32 @gauss(double** %202, double** %203, i32 %204, i32 %205, i32 %206, i32 %208, i32 %210, double %211)
%213 = call i32 @gettimeofday(%struct.timeval* %28, i32* null)
%214 = getelementptr inbounds %struct.timeval, %struct.timeval* %28, i32 0, i32 1
%215 = load i64, i64* %214
%216 = getelementptr inbounds %struct.timeval, %struct.timeval* %27, i32 0, i32 1
%217 = load i64, i64* %216
%218 = sub nsw i64 %215, %217
%219 = sitofp i64 %218 to double
%220 = getelementptr inbounds %struct.timeval, %struct.timeval* %28, i32 0, i32 0
%221 = load double, double* %220
%222 = getelementptr inbounds %struct.timeval, %struct.timeval* %27, i32 0, i32 0
%223 = load double, double* %222
%224 = fsub double %221, %223
%225 = call double @llvm.fmuladd.f64(double %224, double 0x3EB0C6F7A0B5ED8D, double %219)
%226 = load double*, double** %19
%227 = load i32, i32* %20
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double, double* %226, i64 %228
%230 = load double, double* %229
%231 = fadd double %230, %225
store double %231, double* %229
%232 = load i32, i32* %24
%233 = add nsw i32 %232, 1
store i32 %233, i32* %24
br label %97
234: ; preds = %97
%235 = load i32, i32* %16
%236 = srem i32 %235, 100
%237 = icmp eq i32 %236, 0
br i1 %237, label %238, label %254
238: ; preds = %234
%239 = load i32, i32* %20
%240 = icmp eq i32 %239, 0
br i1 %240, label %241, label %254
241: ; preds = %238
%242 = load double**, double*** %11
%243 = load double**, double*** %10
%244 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%245 = load i32, i32* %244
%246 = sub nsw i32 %245, 1
%247 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%248 = load i32, i32* %247
%249 = sub nsw i32 %248, 1
%250 = call i64 @converge(double** %242, double** %243, i32 1, i32 %246, i32 1, i32 %249)
%251 = icmp ne i64 %250, 0
br i1 %251, label %252, label %253
252: ; preds = %241
store i32 1, i32* %15
br label %253
253: ; preds = %252, %241
br label %254
254: ; preds = %253, %238, %234
%255 = load double**, double*** %11
store double** %255, double*** %12
%256 = load double**, double*** %10
store double** %256, double*** %11
%257 = load double**, double*** %12
store double** %257, double*** %10
%258 = call i32 @gettimeofday(%struct.timeval* %9, i32* null)
%259 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 1
%260 = load i64, i64* %259
%261 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%262 = load i64, i64* %261
%263 = sub nsw i64 %260, %262
%264 = sitofp i64 %263 to double
%265 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%266 = load double, double* %265
%267 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%268 = load double, double* %267
%269 = fsub double %266, %268
%270 = call double @llvm.fmuladd.f64(double %269, double 0x3EB0C6F7A0B5ED8D, double %264)
%271 = load double, double* %17
%272 = fadd double %271, %270
store double %272, double* %17
br label %89
273: ; preds = %89
store i32 0, i32* %29
br label %274
274: ; preds = %296, %273
%275 = load i32, i32* %29
%276 = load i32, i32* %14
%277 = icmp slt i32 %275, %276
br i1 %277, label %278, label %299
278: ; preds = %274
%279 = load double, double* %18
%280 = load double*, double** %19
%281 = load i32, i32* %29
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds double, double* %280, i64 %282
%284 = load double, double* %283
%285 = fcmp oge double %279, %284
br i1 %285, label %286, label %288
286: ; preds = %278
%287 = load double, double* %18
br label %294
288: ; preds = %278
%289 = load double*, double** %19
%290 = load i32, i32* %29
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds double, double* %289, i64 %291
%293 = load double, double* %292
br label %294
294: ; preds = %288, %286
%295 = phi double [ %287, %286 ], [ %293, %288 ]
store double %295, double* %18
br label %296
296: ; preds = %294
%297 = load i32, i32* %29
%298 = add nsw i32 %297, 1
store i32 %298, i32* %29
br label %274
299: ; preds = %274
%300 = load i32, i32* %16
%301 = load double, double* %17
%302 = load double, double* %18
%303 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %300, double %301, double %302)
%304 = load double**, double*** %10
%305 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%306 = load i32, i32* %305
%307 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%308 = load i32, i32* %307
%309 = call i32 @fprint2d(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double** %304, i32 %306, i32 %308)
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 = [54 x i8] c"SeidelSOR\09Iters: %d Time: %.3lf \09 Computation: %.3lf\0A\00"
@.str.2 = [15 x i8] c"testseidel.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 = sitofp i32 %17 to double
%25 = fdiv double 3.140000e+00, %24
%26 = tail call i32 @sin(double %25)
%27 = add nsw i32 %26, 1
%28 = sitofp i32 %27 to double
%29 = fdiv double 2.000000e+00, %28
%30 = tail call double** @allocate2d(i32 %17, i32 %20)
%31 = tail call i32 @init2d(double** %30, i32 %17, i32 %20)
%32 = tail call double** @allocate2d(i32 %17, i32 %20)
%33 = tail call i32 @copy2d(double** %32, double** %30, i32 %17, i32 %20)
%34 = tail call i32 @omp_set_num_threads(i32 %23)
%35 = tail call double* @calloc(i32 %23, i32 8)
%36 = tail call i32 (...) @omp_get_thread_num()
%37 = bitcast %struct.timeval* %5 to i8*
%38 = bitcast %struct.timeval* %6 to i8*
%39 = add nsw i32 %17, -1
%40 = icmp sgt i32 %17, 2
%41 = add nsw i32 %20, -1
%42 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 1
%43 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 1
%44 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i64 0, i32 0
%45 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i64 0, i32 0
%46 = sext i32 %36 to i64
%47 = getelementptr inbounds double, double* %35, i64 %46
%48 = icmp eq i32 %36, 0
%49 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 1
%50 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%51 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%52 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
br label %53
53: ; preds = %14, %134
%54 = phi double** [ %32, %14 ], [ %55, %134 ]
%55 = phi double** [ %30, %14 ], [ %54, %134 ]
%56 = phi double [ 0.000000e+00, %14 ], [ %145, %134 ]
%57 = phi i32 [ 0, %14 ], [ %58, %134 ]
%58 = add nuw nsw i32 %57, 1
%59 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
br i1 %40, label %60, label %126
60: ; preds = %53, %100
%61 = phi i32 [ %103, %100 ], [ 1, %53 ]
%62 = phi i32 [ %124, %100 ], [ 1, %53 ]
%63 = icmp eq i32 %62, 0
%64 = zext i1 %63 to i32
%65 = add nsw i32 %62, %64
%66 = icmp slt i32 %61, %41
br i1 %66, label %71, label %67
67: ; preds = %60
%68 = sub nsw i32 %61, %65
%69 = sdiv i32 %68, %23
%70 = srem i32 %68, %23
br label %100
71: ; preds = %60, %71
%72 = phi i32 [ %76, %71 ], [ %61, %60 ]
%73 = icmp eq i32 %72, 0
%74 = zext i1 %73 to i32
%75 = add nsw i32 %72, %74
%76 = add nsw i32 %75, 1
%77 = sub nsw i32 %76, %65
%78 = sdiv i32 %77, %23
%79 = srem i32 %77, %23
%80 = icmp ne i32 %79, 0
%81 = zext i1 %80 to i32
%82 = add nsw i32 %78, %81
%83 = mul nsw i32 %82, %36
%84 = add nsw i32 %83, %65
%85 = sub nsw i32 %75, %83
%86 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%87 = tail call i32 @gauss(double** %55, double** %54, i32 %84, i32 %85, i32 %82, i32 %17, i32 %20, double %29)
%88 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%89 = load i64, i64* %42
%90 = load i64, i64* %43
%91 = sub nsw i64 %89, %90
%92 = sitofp i64 %91 to double
%93 = load double, double* %44
%94 = load double, double* %45
%95 = fsub double %93, %94
%96 = tail call double @llvm.fmuladd.f64(double %95, double 0x3EB0C6F7A0B5ED8D, double %92)
%97 = load double, double* %47
%98 = fadd double %97, %96
store double %98, double* %47
%99 = icmp slt i32 %76, %41
br i1 %99, label %71, label %100
100: ; preds = %71, %67
%101 = phi i32 [ %70, %67 ], [ %79, %71 ]
%102 = phi i32 [ %69, %67 ], [ %78, %71 ]
%103 = phi i32 [ %61, %67 ], [ %76, %71 ]
%104 = icmp ne i32 %101, 0
%105 = zext i1 %104 to i32
%106 = add nsw i32 %102, %105
%107 = mul nsw i32 %106, %36
%108 = add nsw i32 %107, %65
%109 = xor i32 %107, -1
%110 = add i32 %103, %109
%111 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%112 = tail call i32 @gauss(double** %55, double** %54, i32 %108, i32 %110, i32 %106, i32 %17, i32 %20, double %29)
%113 = call i32 @gettimeofday(%struct.timeval* %6, i32* null)
%114 = load i64, i64* %42
%115 = load i64, i64* %43
%116 = sub nsw i64 %114, %115
%117 = sitofp i64 %116 to double
%118 = load double, double* %44
%119 = load double, double* %45
%120 = fsub double %118, %119
%121 = tail call double @llvm.fmuladd.f64(double %120, double 0x3EB0C6F7A0B5ED8D, double %117)
%122 = load double, double* %47
%123 = fadd double %122, %121
store double %123, double* %47
%124 = add nsw i32 %65, 1
%125 = icmp slt i32 %124, %39
br i1 %125, label %60, label %126
126: ; preds = %100, %53
%127 = urem i32 %58, 100
%128 = icmp eq i32 %127, 0
%129 = select i1 %128, i1 %48, i1 false
br i1 %129, label %130, label %134
130: ; preds = %126
%131 = tail call i64 @converge(double** %55, double** %54, i32 1, i32 %41, i32 1, i32 %39)
%132 = icmp ne i64 %131, 0
%133 = zext i1 %132 to i32
br label %134
134: ; preds = %130, %126
%135 = phi i32 [ 0, %126 ], [ %133, %130 ]
%136 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%137 = load i64, i64* %49
%138 = load i64, i64* %50
%139 = sub nsw i64 %137, %138
%140 = sitofp i64 %139 to double
%141 = load double, double* %51
%142 = load double, double* %52
%143 = fsub double %141, %142
%144 = tail call double @llvm.fmuladd.f64(double %143, double 0x3EB0C6F7A0B5ED8D, double %140)
%145 = fadd double %56, %144
%146 = icmp eq i32 %135, 0
br i1 %146, label %53, label %147
147: ; preds = %134
%148 = icmp sgt i32 %23, 0
br i1 %148, label %149, label %198
149: ; preds = %147
%150 = zext i32 %23 to i64
%151 = add nsw i64 %150, -1
%152 = and i64 %150, 3
%153 = icmp ult i64 %151, 3
br i1 %153, label %182, label %154
154: ; preds = %149
%155 = and i64 %150, 4294967292
br label %156
156: ; preds = %156, %154
%157 = phi i64 [ 0, %154 ], [ %179, %156 ]
%158 = phi double [ 0.000000e+00, %154 ], [ %178, %156 ]
%159 = phi i64 [ 0, %154 ], [ %180, %156 ]
%160 = getelementptr inbounds double, double* %35, i64 %157
%161 = load double, double* %160
%162 = fcmp oge double %158, %161
%163 = select i1 %162, double %158, double %161
%164 = or i64 %157, 1
%165 = getelementptr inbounds double, double* %35, i64 %164
%166 = load double, double* %165
%167 = fcmp oge double %163, %166
%168 = select i1 %167, double %163, double %166
%169 = or i64 %157, 2
%170 = getelementptr inbounds double, double* %35, i64 %169
%171 = load double, double* %170
%172 = fcmp oge double %168, %171
%173 = select i1 %172, double %168, double %171
%174 = or i64 %157, 3
%175 = getelementptr inbounds double, double* %35, i64 %174
%176 = load double, double* %175
%177 = fcmp oge double %173, %176
%178 = select i1 %177, double %173, double %176
%179 = add nuw nsw i64 %157, 4
%180 = add i64 %159, 4
%181 = icmp eq i64 %180, %155
br i1 %181, label %182, label %156
182: ; preds = %156, %149
%183 = phi double [ undef, %149 ], [ %178, %156 ]
%184 = phi i64 [ 0, %149 ], [ %179, %156 ]
%185 = phi double [ 0.000000e+00, %149 ], [ %178, %156 ]
%186 = icmp eq i64 %152, 0
br i1 %186, label %198, label %187
187: ; preds = %182, %187
%188 = phi i64 [ %195, %187 ], [ %184, %182 ]
%189 = phi double [ %194, %187 ], [ %185, %182 ]
%190 = phi i64 [ %196, %187 ], [ 0, %182 ]
%191 = getelementptr inbounds double, double* %35, i64 %188
%192 = load double, double* %191
%193 = fcmp oge double %189, %192
%194 = select i1 %193, double %189, double %192
%195 = add nuw nsw i64 %188, 1
%196 = add i64 %190, 1
%197 = icmp eq i64 %196, %152
br i1 %197, label %198, label %187
198: ; preds = %182, %187, %147
%199 = phi double [ 0.000000e+00, %147 ], [ %183, %182 ], [ %194, %187 ]
%200 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0), i32 %58, double %145, double %199)
%201 = tail call i32 @fprint2d(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double** %55, i32 %17, i32 %20)
ret i32 0
}