#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 */
float CalcGflops(double, unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ Call_Init2d(int, double *, double, double, unsigned int,
                               unsigned int);
int /*<<< orphan*/ Compute_Adv_x(double *, double *, double, unsigned int,
                                 unsigned int, double);
int /*<<< orphan*/ Compute_Adv_y(double *, double *, double, unsigned int,
                                 unsigned int, double);
int /*<<< orphan*/ Compute_sspRK(double *, double *, double *, int,
                                 unsigned int, unsigned int, double);
int /*<<< orphan*/ PrintSummary(char *, char *, double, float, double const,
                                unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ SaveBinary2D(double *, unsigned int, unsigned int);
double atof(char *);
unsigned int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(double *, double *, int);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
double omp_get_wtime();
int /*<<< orphan*/ omp_set_num_threads(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  omp_set_num_threads(8);
  double alpha, dt, dx, dy;
  unsigned int Nx, Ny, max_iter, blockX, blockY;
  if (argc == 10) {
    alpha = atof(argv[1]);
    dt = atof(argv[2]);
    dx = atof(argv[3]);
    dy = atof(argv[4]);
    Nx = atoi(argv[5]);
    Ny = atoi(argv[6]);
    max_iter = atoi(argv[7]);
    blockX = atoi(argv[8]);
    blockY = atoi(argv[9]);
  } else {
    printf("Usage: %s alpha dt dx dy Nx Ny Iterations block_x block_y\n",
           argv[0]);
    exit(1);
  }
  const double L = dx * (Nx - 1);
  const double W = dy * (Ny - 1);
  const double tFinal = dt * max_iter;
  printf("alpha: %g\n", alpha);
  printf("dx: %g\n", dx);
  printf("dy: %g\n", dy);
  printf("dt: %g\n", dt);
  printf("tEnd: %g\n", tFinal);
  printf("Cuda Blocks Details:\n");
  printf("Threads in X: %d\n", blockX);
  printf("Threads in Y: %d\n", blockY);
  printf("\n");
  double *h_u;
  h_u = (double *)malloc(sizeof(double) * Nx * Ny);
  double *h_uo;
  h_uo = (double *)malloc(sizeof(double) * Nx * Ny);
  double *h_Lu;
  h_Lu = (double *)malloc(sizeof(double) * Nx * Ny);
  Call_Init2d(1, h_u, dx, dy, Nx, Ny);
  double start = omp_get_wtime();
  for (unsigned int iterations = 0; iterations < max_iter; iterations++) {
    memcpy(h_uo, h_u, sizeof(double) * Nx * Ny);
    memset(h_Lu, 0, sizeof(double) * Nx * Ny);
    Compute_Adv_x(h_u, h_Lu, alpha, Nx, Ny, dx);
    Compute_Adv_y(h_u, h_Lu, alpha, Nx, Ny, dy);
    Compute_sspRK(h_u, h_uo, h_Lu, 1, Nx, Ny, dt);
    Compute_Adv_x(h_u, h_Lu, alpha, Nx, Ny, dx);
    Compute_Adv_y(h_u, h_Lu, alpha, Nx, Ny, dy);
    Compute_sspRK(h_u, h_uo, h_Lu, 2, Nx, Ny, dt);
    Compute_Adv_x(h_u, h_Lu, alpha, Nx, Ny, dx);
    Compute_Adv_y(h_u, h_Lu, alpha, Nx, Ny, dy);
    Compute_sspRK(h_u, h_uo, h_Lu, 3, Nx, Ny, dt);
  }
  double stop = omp_get_wtime();
  double tOMP = stop - start;
  printf("Computation took %lf seconds\n", tOMP);
  float gflops = CalcGflops(tOMP, max_iter, Nx, Ny);
  PrintSummary(argv[0], "none", tOMP, gflops, tFinal, max_iter, Nx, Ny);
  if (1)
    SaveBinary2D(h_u, Nx, Ny);
  free(h_u);
  free(h_uo);
  free(h_Lu);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x8,%edi
call   10c0 <omp_set_num_threads@plt>
cmpl   $0xa,-0x8(%rbp)
jne    12da <main+0xca>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x48(%rax),%rdi
call   1100 <atoi@plt>
mov    %eax,-0x44(%rbp)
jmp    12f9 <main+0xe9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1110 <exit@plt>
movsd  -0x28(%rbp),%xmm0
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x3c(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xcee(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xce6(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xcdb(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xcd0(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  -0x60(%rbp),%xmm0
lea    0xcc5(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xcc1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x40(%rbp),%esi
lea    0xcc6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x44(%rbp),%esi
lea    0xcc7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xca5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x34(%rbp),%eax
shl    $0x3,%rax
mov    -0x38(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x34(%rbp),%eax
shl    $0x3,%rax
mov    -0x38(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x70(%rbp)
mov    -0x34(%rbp),%eax
shl    $0x3,%rax
mov    -0x38(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x68(%rbp),%rsi
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    $0x1,%edi
call   1120 <Call_Init2d@plt>
mov    $0x0,%al
call   1050 <omp_get_wtime@plt>
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jae    15cf <main+0x3bf>
mov    -0x70(%rbp),%rdi
mov    -0x68(%rbp),%rsi
mov    -0x34(%rbp),%eax
shl    $0x3,%rax
mov    -0x38(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,%edx
call   10a0 <memcpy@plt>
mov    -0x78(%rbp),%rdi
mov    -0x34(%rbp),%eax
shl    $0x3,%rax
mov    -0x38(%rbp),%ecx
imul   %rcx,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    -0x68(%rbp),%rdi
mov    -0x78(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsd  -0x28(%rbp),%xmm1
call   1090 <Compute_Adv_x@plt>
mov    -0x68(%rbp),%rdi
mov    -0x78(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsd  -0x30(%rbp),%xmm1
call   1130 <Compute_Adv_y@plt>
mov    -0x68(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x78(%rbp),%rdx
mov    -0x34(%rbp),%r8d
mov    -0x38(%rbp),%r9d
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%ecx
call   10d0 <Compute_sspRK@plt>
mov    -0x68(%rbp),%rdi
mov    -0x78(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsd  -0x28(%rbp),%xmm1
call   1090 <Compute_Adv_x@plt>
mov    -0x68(%rbp),%rdi
mov    -0x78(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsd  -0x30(%rbp),%xmm1
call   1130 <Compute_Adv_y@plt>
mov    -0x68(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x78(%rbp),%rdx
mov    -0x34(%rbp),%r8d
mov    -0x38(%rbp),%r9d
movsd  -0x20(%rbp),%xmm0
mov    $0x2,%ecx
call   10d0 <Compute_sspRK@plt>
mov    -0x68(%rbp),%rdi
mov    -0x78(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsd  -0x28(%rbp),%xmm1
call   1090 <Compute_Adv_x@plt>
mov    -0x68(%rbp),%rdi
mov    -0x78(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsd  -0x30(%rbp),%xmm1
call   1130 <Compute_Adv_y@plt>
mov    -0x68(%rbp),%rdi
mov    -0x70(%rbp),%rsi
mov    -0x78(%rbp),%rdx
mov    -0x34(%rbp),%r8d
mov    -0x38(%rbp),%r9d
movsd  -0x20(%rbp),%xmm0
mov    $0x3,%ecx
call   10d0 <Compute_sspRK@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    145d <main+0x24d>
mov    $0x0,%al
call   1050 <omp_get_wtime@plt>
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
lea    0xaa0(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movsd  -0x98(%rbp),%xmm0
ff
mov    -0x3c(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
call   10f0 <CalcGflops@plt>
movss  %xmm0,-0x9c(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
movsd  -0x98(%rbp),%xmm0
ff
movss  -0x9c(%rbp),%xmm1
ff
movsd  -0x60(%rbp),%xmm2
mov    -0x3c(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
lea    0xa6c(%rip),%rsi
call   10e0 <PrintSummary@plt>
mov    -0x68(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
call   1070 <SaveBinary2D@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbp
mov    %edi,%ebx
mov    $0x8,%edi
call   10e0 <omp_set_num_threads@plt>
cmp    $0xa,%ebx
jne    15dc <main+0x3ac>
mov    0x8(%rbp),%rdi
call   1060 <atof@plt>
movsd  %xmm0,(%rsp)
mov    0x10(%rbp),%rdi
call   1060 <atof@plt>
movsd  %xmm0,0x18(%rsp)
mov    0x18(%rbp),%rdi
call   1060 <atof@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x20(%rbp),%rdi
call   1060 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    0x28(%rbp),%rdi
call   1120 <atoi@plt>
mov    %eax,%r13d
mov    0x30(%rbp),%rdi
call   1120 <atoi@plt>
mov    %eax,%r12d
mov    0x38(%rbp),%rdi
call   1120 <atoi@plt>
mov    %eax,%r14d
mov    0x40(%rbp),%rdi
call   1120 <atoi@plt>
mov    %eax,%r15d
mov    %rbp,0x40(%rsp)
mov    0x48(%rbp),%rdi
call   1120 <atoi@plt>
mov    %eax,%ebp
mov    %r14d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
lea    0xd4c(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd44(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd38(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd2c(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd20(%rip),%rdi
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xd5d(%rip),%rdi
call   1050 <puts@plt>
lea    0xd0a(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd0b(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    %r13d,%r15d
imul   %r12d,%r15d
shl    $0x3,%r15d
mov    %r15d,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbp
mov    %r15d,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbx
mov    %r15d,0x28(%rsp)
mov    %r15d,%edi
call   10d0 <malloc@plt>
mov    %rax,%r15
mov    $0x1,%edi
mov    %rbp,%rsi
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %r13d,%edx
mov    %r12d,%ecx
call   1140 <Call_Init2d@plt>
xor    %eax,%eax
call   1070 <omp_get_wtime@plt>
movsd  %xmm0,0x38(%rsp)
mov    %r14d,0x24(%rsp)
test   %r14d,%r14d
je     1542 <main+0x312>
mov    0x24(%rsp),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,0x2c(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12d,%r14d
mov    %r13d,%r12d
mov    0x28(%rsp),%r13d
mov    %r13d,%edx
call   10c0 <memcpy@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    %r13d,%edx
mov    %r12d,%r13d
mov    %r14d,%r12d
call   10a0 <memset@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
movsd  (%rsp),%xmm0
mov    %r13d,%edx
mov    %r14d,%ecx
movsd  0x10(%rsp),%xmm1
call   10b0 <Compute_Adv_x@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
movsd  (%rsp),%xmm0
mov    %r13d,%edx
mov    %r14d,%ecx
movsd  0x8(%rsp),%xmm1
call   1150 <Compute_Adv_y@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    $0x1,%ecx
mov    %r13d,%r8d
mov    %r14d,%r9d
movsd  0x18(%rsp),%xmm0
call   10f0 <Compute_sspRK@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
movsd  (%rsp),%xmm0
mov    %r13d,%edx
mov    %r14d,%ecx
movsd  0x10(%rsp),%xmm1
call   10b0 <Compute_Adv_x@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
movsd  (%rsp),%xmm0
mov    %r13d,%edx
mov    %r14d,%ecx
movsd  0x8(%rsp),%xmm1
call   1150 <Compute_Adv_y@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    $0x2,%ecx
mov    %r13d,%r8d
mov    %r14d,%r9d
movsd  0x18(%rsp),%xmm0
call   10f0 <Compute_sspRK@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
movsd  (%rsp),%xmm0
mov    %r13d,%edx
mov    %r14d,%ecx
movsd  0x10(%rsp),%xmm1
call   10b0 <Compute_Adv_x@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
movsd  (%rsp),%xmm0
mov    %r13d,%edx
mov    %r14d,%ecx
movsd  0x8(%rsp),%xmm1
call   1150 <Compute_Adv_y@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    $0x3,%ecx
mov    %r13d,%r8d
mov    %r14d,%r9d
movsd  0x18(%rsp),%xmm0
call   10f0 <Compute_sspRK@plt>
mov    0x2c(%rsp),%eax
add    $0xffffffff,%eax
jne    1400 <main+0x1d0>
xor    %eax,%eax
call   1070 <omp_get_wtime@plt>
subsd  0x38(%rsp),%xmm0
movsd  %xmm0,(%rsp)
lea    0xb31(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
movsd  (%rsp),%xmm0
mov    0x24(%rsp),%r14d
mov    %r14d,%edi
mov    %r13d,%esi
mov    %r12d,%edx
call   1110 <CalcGflops@plt>
movaps %xmm0,%xmm1
mov    0x40(%rsp),%rax
mov    (%rax),%rdi
lea    0xb1e(%rip),%rsi
movsd  (%rsp),%xmm0
movsd  0x30(%rsp),%xmm2
mov    %r14d,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
call   1100 <PrintSummary@plt>
mov    %rbp,%rdi
mov    %r13d,%esi
mov    %r12d,%edx
call   1090 <SaveBinary2D@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x0(%rbp),%rsi
lea    0xa19(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%edi
call   1130 <exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Usage: %s alpha dt dx dy Nx Ny Iterations block_x block_y\0A\00"
@.str.1 = [11 x i8] c"alpha: %g\0A\00"
@.str.2 = [8 x i8] c"dx: %g\0A\00"
@.str.3 = [8 x i8] c"dy: %g\0A\00"
@.str.4 = [8 x i8] c"dt: %g\0A\00"
@.str.5 = [10 x i8] c"tEnd: %g\0A\00"
@.str.6 = [22 x i8] c"Cuda Blocks Details:\0A\00"
@.str.7 = [18 x i8] c"Threads in X: %d\0A\00"
@.str.8 = [18 x i8] c"Threads in Y: %d\0A\00"
@.str.9 = [2 x i8] c"\0A\00"
@.str.10 = [30 x i8] c"Computation took %lf seconds\0A\00"
@.str.11 = [5 x i8] c"none\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double
%22 = alloca i32
%23 = alloca double
%24 = alloca double
%25 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%26 = call i32 @omp_set_num_threads(i32 8)
%27 = load i32, i32* %4
%28 = icmp eq i32 %27, 10
br i1 %28, label %29, label %66
29: ; preds = %2
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call double @atof(i8* %32)
store double %33, double* %6
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 2
%36 = load i8*, i8** %35
%37 = call double @atof(i8* %36)
store double %37, double* %7
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 3
%40 = load i8*, i8** %39
%41 = call double @atof(i8* %40)
store double %41, double* %8
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 4
%44 = load i8*, i8** %43
%45 = call double @atof(i8* %44)
store double %45, double* %9
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 5
%48 = load i8*, i8** %47
%49 = call i32 @atoi(i8* %48)
store i32 %49, i32* %10
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i64 6
%52 = load i8*, i8** %51
%53 = call i32 @atoi(i8* %52)
store i32 %53, i32* %11
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 7
%56 = load i8*, i8** %55
%57 = call i32 @atoi(i8* %56)
store i32 %57, i32* %12
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 8
%60 = load i8*, i8** %59
%61 = call i32 @atoi(i8* %60)
store i32 %61, i32* %13
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 9
%64 = load i8*, i8** %63
%65 = call i32 @atoi(i8* %64)
store i32 %65, i32* %14
br label %72
66: ; preds = %2
%67 = load i8**, i8*** %5
%68 = getelementptr inbounds i8*, i8** %67, i64 0
%69 = load i8*, i8** %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %69)
%71 = call i32 @exit(i32 1)
unreachable
72: ; preds = %29
%73 = load double, double* %8
%74 = load i32, i32* %10
%75 = sub i32 %74, 1
%76 = uitofp i32 %75 to double
%77 = fmul double %73, %76
store double %77, double* %15
%78 = load double, double* %9
%79 = load i32, i32* %11
%80 = sub i32 %79, 1
%81 = uitofp i32 %80 to double
%82 = fmul double %78, %81
store double %82, double* %16
%83 = load double, double* %7
%84 = load i32, i32* %12
%85 = uitofp i32 %84 to double
%86 = fmul double %83, %85
store double %86, double* %17
%87 = load double, double* %6
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %87)
%89 = load double, double* %8
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %89)
%91 = load double, double* %9
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %91)
%93 = load double, double* %7
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %93)
%95 = load double, double* %17
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), double %95)
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%98 = load i32, i32* %13
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %98)
%100 = load i32, i32* %14
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %100)
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%103 = load i32, i32* %10
%104 = zext i32 %103 to i64
%105 = mul i64 8, %104
%106 = load i32, i32* %11
%107 = zext i32 %106 to i64
%108 = mul i64 %105, %107
%109 = trunc i64 %108 to i32
%110 = call i64 @malloc(i32 %109)
%111 = inttoptr i64 %110 to double*
store double* %111, double** %18
%112 = load i32, i32* %10
%113 = zext i32 %112 to i64
%114 = mul i64 8, %113
%115 = load i32, i32* %11
%116 = zext i32 %115 to i64
%117 = mul i64 %114, %116
%118 = trunc i64 %117 to i32
%119 = call i64 @malloc(i32 %118)
%120 = inttoptr i64 %119 to double*
store double* %120, double** %19
%121 = load i32, i32* %10
%122 = zext i32 %121 to i64
%123 = mul i64 8, %122
%124 = load i32, i32* %11
%125 = zext i32 %124 to i64
%126 = mul i64 %123, %125
%127 = trunc i64 %126 to i32
%128 = call i64 @malloc(i32 %127)
%129 = inttoptr i64 %128 to double*
store double* %129, double** %20
%130 = load double*, double** %18
%131 = load double, double* %8
%132 = load double, double* %9
%133 = load i32, i32* %10
%134 = load i32, i32* %11
%135 = call i32 @Call_Init2d(i32 1, double* %130, double %131, double %132, i32 %133, i32 %134)
%136 = call double (...) @omp_get_wtime()
store double %136, double* %21
store i32 0, i32* %22
br label %137
137: ; preds = %224, %72
%138 = load i32, i32* %22
%139 = load i32, i32* %12
%140 = icmp ult i32 %138, %139
br i1 %140, label %141, label %227
141: ; preds = %137
%142 = load double*, double** %19
%143 = load double*, double** %18
%144 = load i32, i32* %10
%145 = zext i32 %144 to i64
%146 = mul i64 8, %145
%147 = load i32, i32* %11
%148 = zext i32 %147 to i64
%149 = mul i64 %146, %148
%150 = trunc i64 %149 to i32
%151 = call i32 @memcpy(double* %142, double* %143, i32 %150)
%152 = load double*, double** %20
%153 = load i32, i32* %10
%154 = zext i32 %153 to i64
%155 = mul i64 8, %154
%156 = load i32, i32* %11
%157 = zext i32 %156 to i64
%158 = mul i64 %155, %157
%159 = trunc i64 %158 to i32
%160 = call i32 @memset(double* %152, i32 0, i32 %159)
%161 = load double*, double** %18
%162 = load double*, double** %20
%163 = load double, double* %6
%164 = load i32, i32* %10
%165 = load i32, i32* %11
%166 = load double, double* %8
%167 = call i32 @Compute_Adv_x(double* %161, double* %162, double %163, i32 %164, i32 %165, double %166)
%168 = load double*, double** %18
%169 = load double*, double** %20
%170 = load double, double* %6
%171 = load i32, i32* %10
%172 = load i32, i32* %11
%173 = load double, double* %9
%174 = call i32 @Compute_Adv_y(double* %168, double* %169, double %170, i32 %171, i32 %172, double %173)
%175 = load double*, double** %18
%176 = load double*, double** %19
%177 = load double*, double** %20
%178 = load i32, i32* %10
%179 = load i32, i32* %11
%180 = load double, double* %7
%181 = call i32 @Compute_sspRK(double* %175, double* %176, double* %177, i32 1, i32 %178, i32 %179, double %180)
%182 = load double*, double** %18
%183 = load double*, double** %20
%184 = load double, double* %6
%185 = load i32, i32* %10
%186 = load i32, i32* %11
%187 = load double, double* %8
%188 = call i32 @Compute_Adv_x(double* %182, double* %183, double %184, i32 %185, i32 %186, double %187)
%189 = load double*, double** %18
%190 = load double*, double** %20
%191 = load double, double* %6
%192 = load i32, i32* %10
%193 = load i32, i32* %11
%194 = load double, double* %9
%195 = call i32 @Compute_Adv_y(double* %189, double* %190, double %191, i32 %192, i32 %193, double %194)
%196 = load double*, double** %18
%197 = load double*, double** %19
%198 = load double*, double** %20
%199 = load i32, i32* %10
%200 = load i32, i32* %11
%201 = load double, double* %7
%202 = call i32 @Compute_sspRK(double* %196, double* %197, double* %198, i32 2, i32 %199, i32 %200, double %201)
%203 = load double*, double** %18
%204 = load double*, double** %20
%205 = load double, double* %6
%206 = load i32, i32* %10
%207 = load i32, i32* %11
%208 = load double, double* %8
%209 = call i32 @Compute_Adv_x(double* %203, double* %204, double %205, i32 %206, i32 %207, double %208)
%210 = load double*, double** %18
%211 = load double*, double** %20
%212 = load double, double* %6
%213 = load i32, i32* %10
%214 = load i32, i32* %11
%215 = load double, double* %9
%216 = call i32 @Compute_Adv_y(double* %210, double* %211, double %212, i32 %213, i32 %214, double %215)
%217 = load double*, double** %18
%218 = load double*, double** %19
%219 = load double*, double** %20
%220 = load i32, i32* %10
%221 = load i32, i32* %11
%222 = load double, double* %7
%223 = call i32 @Compute_sspRK(double* %217, double* %218, double* %219, i32 3, i32 %220, i32 %221, double %222)
br label %224
224: ; preds = %141
%225 = load i32, i32* %22
%226 = add i32 %225, 1
store i32 %226, i32* %22
br label %137
227: ; preds = %137
%228 = call double (...) @omp_get_wtime()
store double %228, double* %23
%229 = load double, double* %23
%230 = load double, double* %21
%231 = fsub double %229, %230
store double %231, double* %24
%232 = load double, double* %24
%233 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), double %232)
%234 = load double, double* %24
%235 = load i32, i32* %12
%236 = load i32, i32* %10
%237 = load i32, i32* %11
%238 = call float @CalcGflops(double %234, i32 %235, i32 %236, i32 %237)
store float %238, float* %25
%239 = load i8**, i8*** %5
%240 = getelementptr inbounds i8*, i8** %239, i64 0
%241 = load i8*, i8** %240
%242 = load double, double* %24
%243 = load float, float* %25
%244 = load double, double* %17
%245 = load i32, i32* %12
%246 = load i32, i32* %10
%247 = load i32, i32* %11
%248 = call i32 @PrintSummary(i8* %241, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), double %242, float %243, double %244, i32 %245, i32 %246, i32 %247)
%249 = load double*, double** %18
%250 = load i32, i32* %10
%251 = load i32, i32* %11
%252 = call i32 @SaveBinary2D(double* %249, i32 %250, i32 %251)
%253 = load double*, double** %18
%254 = call i32 @free(double* %253)
%255 = load double*, double** %19
%256 = call i32 @free(double* %255)
%257 = load double*, double** %20
%258 = call i32 @free(double* %257)
ret i32 0
}

LLVM IR (-O2):
@.str = [59 x i8] c"Usage: %s alpha dt dx dy Nx Ny Iterations block_x block_y\0A\00"
@.str.1 = [11 x i8] c"alpha: %g\0A\00"
@.str.2 = [8 x i8] c"dx: %g\0A\00"
@.str.3 = [8 x i8] c"dy: %g\0A\00"
@.str.4 = [8 x i8] c"dt: %g\0A\00"
@.str.5 = [10 x i8] c"tEnd: %g\0A\00"
@.str.7 = [18 x i8] c"Threads in X: %d\0A\00"
@.str.8 = [18 x i8] c"Threads in Y: %d\0A\00"
@.str.10 = [30 x i8] c"Computation took %lf seconds\0A\00"
@.str.11 = [5 x i8] c"none\00"
@str = [21 x i8] c"Cuda Blocks Details:\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @omp_set_num_threads(i32 8)
%4 = icmp eq i32 %0, 10
br i1 %4, label %5, label %55
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call double @atof(i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call double @atof(i8* %10)
%12 = getelementptr inbounds i8*, i8** %1, i64 3
%13 = load i8*, i8** %12
%14 = tail call double @atof(i8* %13)
%15 = getelementptr inbounds i8*, i8** %1, i64 4
%16 = load i8*, i8** %15
%17 = tail call double @atof(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 5
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 6
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
%24 = getelementptr inbounds i8*, i8** %1, i64 7
%25 = load i8*, i8** %24
%26 = tail call i32 @atoi(i8* %25)
%27 = getelementptr inbounds i8*, i8** %1, i64 8
%28 = load i8*, i8** %27
%29 = tail call i32 @atoi(i8* %28)
%30 = getelementptr inbounds i8*, i8** %1, i64 9
%31 = load i8*, i8** %30
%32 = tail call i32 @atoi(i8* %31)
%33 = uitofp i32 %26 to double
%34 = fmul double %11, %33
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %8)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %14)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %17)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %11)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), double %34)
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %29)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %32)
%43 = tail call i32 @putchar(i32 10)
%44 = shl i32 %20, 3
%45 = mul i32 %23, %44
%46 = tail call i64 @malloc(i32 %45)
%47 = inttoptr i64 %46 to double*
%48 = tail call i64 @malloc(i32 %45)
%49 = inttoptr i64 %48 to double*
%50 = tail call i64 @malloc(i32 %45)
%51 = inttoptr i64 %50 to double*
%52 = tail call i32 @Call_Init2d(i32 1, double* %47, double %14, double %17, i32 %20, i32 %23)
%53 = tail call double (...) @omp_get_wtime()
%54 = icmp eq i32 %26, 0
br i1 %54, label %59, label %70
55: ; preds = %2
%56 = load i8*, i8** %1
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %56)
%58 = tail call i32 @exit(i32 1)
unreachable
59: ; preds = %70, %5
%60 = tail call double (...) @omp_get_wtime()
%61 = fsub double %60, %53
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), double %61)
%63 = tail call float @CalcGflops(double %61, i32 %26, i32 %20, i32 %23)
%64 = load i8*, i8** %1
%65 = tail call i32 @PrintSummary(i8* %64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), double %61, float %63, double %34, i32 %26, i32 %20, i32 %23)
%66 = tail call i32 @SaveBinary2D(double* %47, i32 %20, i32 %23)
%67 = tail call i32 @free(double* %47)
%68 = tail call i32 @free(double* %49)
%69 = tail call i32 @free(double* %51)
ret i32 0
70: ; preds = %5, %70
%71 = phi i32 [ %83, %70 ], [ 0, %5 ]
%72 = tail call i32 @memcpy(double* %49, double* %47, i32 %45)
%73 = tail call i32 @memset(double* %51, i32 0, i32 %45)
%74 = tail call i32 @Compute_Adv_x(double* %47, double* %51, double %8, i32 %20, i32 %23, double %14)
%75 = tail call i32 @Compute_Adv_y(double* %47, double* %51, double %8, i32 %20, i32 %23, double %17)
%76 = tail call i32 @Compute_sspRK(double* %47, double* %49, double* %51, i32 1, i32 %20, i32 %23, double %11)
%77 = tail call i32 @Compute_Adv_x(double* %47, double* %51, double %8, i32 %20, i32 %23, double %14)
%78 = tail call i32 @Compute_Adv_y(double* %47, double* %51, double %8, i32 %20, i32 %23, double %17)
%79 = tail call i32 @Compute_sspRK(double* %47, double* %49, double* %51, i32 2, i32 %20, i32 %23, double %11)
%80 = tail call i32 @Compute_Adv_x(double* %47, double* %51, double %8, i32 %20, i32 %23, double %14)
%81 = tail call i32 @Compute_Adv_y(double* %47, double* %51, double %8, i32 %20, i32 %23, double %17)
%82 = tail call i32 @Compute_sspRK(double* %47, double* %49, double* %51, i32 3, i32 %20, i32 %23, double %11)
%83 = add nuw i32 %71, 1
%84 = icmp eq i32 %83, %26
br i1 %84, label %59, label %70
}