#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, double);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
void kernel_adi(int tsteps, int n, double *u, double *v, double *p, double *q) {
  FILE *fp_u;
  FILE *fp_v;
  FILE *fp_p;
  FILE *fp_q;
  int t, i, j;
  double DX, DY, DT;
  double B1, B2;
  double mul1, mul2;
  double a, b, c, d, e, f;
#pragma scop
  DX = 1.0 / (double)n;
  DY = 1.0 / (double)n;
  DT = 1.0 / (double)tsteps;
  B1 = 2.0;
  B2 = 1.0;
  mul1 = B1 * DT / (DX * DX);
  mul2 = B2 * DT / (DY * DY);
  a = -mul1 / 2.0;
  b = 1.0 + mul1;
  c = a;
  d = -mul2 / 2.0;
  e = 1.0 + mul2;
  f = d;
  for (t = 1; t <= tsteps; t++) {
    for (i = 1; i < n - 1; i++) {
      v[i] = 1.0;
      p[i * n] = 0.0;
      q[i * n] = v[i];
      for (j = 1; j < n - 1; j++) {
        p[i * n + j] = -c / (a * p[i * n + (j - 1)] + b);
        q[i * n + j] =
            (-d * u[j * n + (i - 1)] + (1.0 + 2.0 * d) * u[j * n + i] -
             f * u[j * n + (i + 1)] - a * q[i * n + (j - 1)]) /
            (a * p[i * n + (j - 1)] + b);
      }
      v[n * (n - 1) + i] = 1.0;
      for (j = n - 2; j >= 1; j--) {
        v[j * n + i] = p[i * n + j] * v[(j + 1) * n + i] + q[i * n + j];
      }
    }
    for (i = 1; i < n - 1; i++) {
      u[i * n] = 1.0;
      p[i * n] = 0.0;
      q[i * n] = u[i * n];
      for (j = 1; j < n - 1; j++) {
        p[i * n + j] = -f / (d * p[i * n + (j - 1)] + e);
        q[i * n + j] =
            (-a * v[(i - 1) * n + j] + (1.0 + 2.0 * a) * v[i * n + j] -
             c * v[(i + 1) * n + j] - d * q[i * n + (j - 1)]) /
            (d * p[i * n + (j - 1)] + e);
      }
      u[i * n + (n - 1)] = 1.0;
      for (j = n - 2; j >= 1; j--) {
        u[i * n + j] = p[i * n + j] * u[i * n + (j + 1)] + q[i * n + j];
      }
    }
    char buffer_u[40];
    char buffer_v[40];
    char buffer_p[40];
    char buffer_q[40];
    sprintf(buffer_u, "%d", t);
    sprintf(buffer_v, "%d", t);
    sprintf(buffer_p, "%d", t);
    sprintf(buffer_q, "%d", t);
    strcat(buffer_u, "_simData_u.dat");
    strcat(buffer_v, "_simData_v.dat");
    strcat(buffer_p, "_simData_p.dat");
    strcat(buffer_q, "_simData_q.dat");
    fp_u = fopen(buffer_u, "wb");
    fp_v = fopen(buffer_v, "wb");
    fp_p = fopen(buffer_p, "wb");
    fp_q = fopen(buffer_q, "wb");
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        fprintf(fp_q, "%d %d %lf\n", i, j, q[i * n + j]);
      }
    }
    fclose(fp_u);
    fclose(fp_v);
    fclose(fp_p);
    fclose(fp_q);
  }
#pragma endscop
}


x86 assembly (clang, -O0):
<kernel_adi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe82(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe6c(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xe56(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe4d(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe38(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdd4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xdb8(%rip),%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd79(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xd5d(%rip),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1a89 <kernel_adi+0x939>
movl   $0x1,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    15c6 <kernel_adi+0x476>
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  0xd02(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    150c <kernel_adi+0x3bc>
movsd  -0xa8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0xa0(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xb0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x50(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xb0(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
movsd  0xbf5(%rip),%xmm3
addsd  %xmm3,%xmm1
mov    -0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0xc0(%rbp),%xmm1
ff
mov    -0x10(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x50(%rbp),%edx
add    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x98(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0xa0(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1340 <kernel_adi+0x1f0>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
imul   %edx,%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  0xad6(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x1,-0x54(%rbp)
jl     15b3 <kernel_adi+0x463>
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    1538 <kernel_adi+0x3e8>
jmp    15b8 <kernel_adi+0x468>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    12dd <kernel_adi+0x18d>
movl   $0x1,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    18c0 <kernel_adi+0x770>
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  0xa0c(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1804 <kernel_adi+0x6b4>
movsd  -0xc0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0xb0(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0xb8(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x98(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
movsd  0x8fb(%rip),%xmm3
addsd  %xmm3,%xmm1
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
mov    -0x18(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0xb0(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x54(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0xb8(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    163c <kernel_adi+0x4ec>
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  0x7de(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x1,-0x54(%rbp)
jl     18ad <kernel_adi+0x75d>
mov    -0x20(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x54(%rbp),%edx
add    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x54(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    1830 <kernel_adi+0x6e0>
jmp    18b2 <kernel_adi+0x762>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    15cd <kernel_adi+0x47d>
lea    -0xf0(%rbp),%rdi
mov    -0x4c(%rbp),%edx
lea    0x73f(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x120(%rbp),%rdi
mov    -0x4c(%rbp),%edx
lea    0x729(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x150(%rbp),%rdi
mov    -0x4c(%rbp),%edx
lea    0x713(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x180(%rbp),%rdi
mov    -0x4c(%rbp),%edx
lea    0x6fd(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
lea    0x6ed(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x120(%rbp),%rdi
lea    0x6e9(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x150(%rbp),%rdi
lea    0x6e5(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x180(%rbp),%rdi
lea    0x6e1(%rip),%rsi
call   1060 <strcat@plt>
lea    -0xf0(%rbp),%rdi
lea    0x6dd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x30(%rbp)
lea    -0x120(%rbp),%rdi
lea    0x6c6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x38(%rbp)
lea    -0x150(%rbp),%rdi
lea    0x6af(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x40(%rbp)
lea    -0x180(%rbp),%rdi
lea    0x698(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x184(%rbp)
mov    -0x184(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1a57 <kernel_adi+0x907>
movl   $0x0,-0x188(%rbp)
mov    -0x188(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1a3e <kernel_adi+0x8ee>
mov    -0x48(%rbp),%rdi
mov    -0x184(%rbp),%edx
mov    -0x188(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    -0x184(%rbp),%esi
imul   -0x8(%rbp),%esi
add    -0x188(%rbp),%esi
movslq %esi,%rsi
movsd  (%rax,%rsi,8),%xmm0
lea    0x62d(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x188(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x188(%rbp)
jmp    19e3 <kernel_adi+0x893>
jmp    1a43 <kernel_adi+0x8f3>
mov    -0x184(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x184(%rbp)
jmp    19ca <kernel_adi+0x87a>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x38(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    12ca <kernel_adi+0x17a>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_adi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x268,%rsp
mov    %r8,0x38(%rsp)
mov    %rcx,0x80(%rsp)
mov    %edi,0x2c(%rsp)
test   %edi,%edi
jle    1a28 <kernel_adi+0x8d8>
cvtsi2sd %esi,%xmm1
movsd  0xe7a(%rip),%xmm0
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sdl 0x2c(%rsp),%xmm1
movapd %xmm0,%xmm8
divsd  %xmm1,%xmm8
movapd %xmm8,%xmm3
addsd  %xmm8,%xmm3
mulsd  %xmm2,%xmm2
divsd  %xmm2,%xmm3
divsd  %xmm2,%xmm8
movsd  0xe47(%rip),%xmm9
movapd %xmm3,%xmm4
mulsd  %xmm9,%xmm4
addsd  %xmm0,%xmm3
mulsd  %xmm8,%xmm9
addsd  %xmm0,%xmm8
movabs $0x100000000,%r8
lea    -0x1(%rsi),%ebx
movapd 0xe23(%rip),%xmm7
movapd %xmm4,%xmm6
xorpd  %xmm7,%xmm6
xorpd  %xmm9,%xmm7
movapd %xmm9,%xmm5
addsd  %xmm9,%xmm5
addsd  %xmm0,%xmm5
mov    %ebx,%eax
imul   %esi,%eax
lea    -0x2(%rsi),%ecx
movapd %xmm4,%xmm10
addsd  %xmm4,%xmm10
addsd  %xmm0,%xmm10
movslq %esi,%rbp
movslq %ecx,%rcx
cltq
mov    %rax,0x140(%rsp)
movslq %ebx,%rax
mov    %rax,0x130(%rsp)
mov    %ebp,%eax
mov    %rax,0x148(%rsp)
mov    %rbp,%rax
shl    $0x20,%rax
mov    %rax,0x30(%rsp)
lea    0x0(,%rbp,8),%r14
lea    0x8(%rdx),%rax
mov    %rax,0x110(%rsp)
mov    0x38(%rsp),%r10
lea    0x8(%r10),%rax
mov    %rax,0x108(%rsp)
mov    %rbp,%rax
imul   %rcx,%rax
add    $0x1,%rcx
mov    0x80(%rsp),%rdi
lea    (%rdi,%rax,8),%rax
add    $0x8,%rax
mov    %rax,0x100(%rsp)
mov    %rcx,0xa0(%rsp)
mov    %rcx,%rax
imul   %rbp,%rax
lea    (%rdi,%rax,8),%rax
add    $0x8,%rax
mov    %rax,0xf8(%rsp)
mov    %rbp,%rax
shl    $0x4,%rax
add    %rdi,%rax
add    $0x8,%rax
mov    %rax,0xe8(%rsp)
lea    -0x2(%rbp,%rbp,1),%eax
shl    $0x20,%rax
add    %r8,%rax
mov    %rax,0xe0(%rsp)
lea    0x8(%r9),%rax
mov    %rax,0xf0(%rsp)
lea    -0x1(%rbx),%rax
mov    %rax,0x138(%rsp)
lea    (%r10,%rbp,8),%rax
mov    %rax,0x90(%rsp)
lea    (%r9,%rbp,8),%rax
mov    %rax,0x88(%rsp)
lea    0x8(%rdi),%rax
mov    %rax,0xd8(%rsp)
lea    0x8(%r10,%rbp,8),%rax
mov    %rax,0xd0(%rsp)
lea    0x8(%rdi,%rbp,8),%rax
mov    %rax,0xc8(%rsp)
lea    0x8(%r9,%rbp,8),%rax
mov    %rax,0xc0(%rsp)
mov    %rbx,0xb0(%rsp)
lea    -0x8(,%rbx,8),%rax
ff
mov    %rax,0x128(%rsp)
mov    %rbp,0xa8(%rsp)
lea    (%rdx,%rbp,8),%rax
mov    %rax,0xb8(%rsp)
mov    $0x1,%eax
mov    %rax,0x40(%rsp)
mov    %rdx,0x48(%rsp)
mov    %rsi,0x20(%rsp)
movsd  %xmm8,0x120(%rsp)
movsd  %xmm3,0x118(%rsp)
movapd %xmm9,0x1a0(%rsp)
movapd %xmm4,0x190(%rsp)
movapd %xmm7,0x180(%rsp)
movapd %xmm6,0x170(%rsp)
movapd %xmm5,0x160(%rsp)
movapd %xmm10,0x150(%rsp)
mov    %r9,0x98(%rsp)
jmp    1475 <kernel_adi+0x325>
nopl   0x0(%rax,%rax,1)
mov    0x18(%rsp),%rdi
call   1030 <fclose@plt>
mov    0x10(%rsp),%rdi
call   1030 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1030 <fclose@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    0x40(%rsp),%rcx
lea    0x1(%rcx),%eax
cmp    0x2c(%rsp),%ecx
mov    %rax,0x40(%rsp)
mov    0x20(%rsp),%rsi
movsd  0x120(%rsp),%xmm8
movsd  0x118(%rsp),%xmm3
movapd 0x1a0(%rsp),%xmm9
movapd 0x190(%rsp),%xmm4
movapd 0x180(%rsp),%xmm7
movapd 0x170(%rsp),%xmm6
movapd 0x160(%rsp),%xmm5
movapd 0x150(%rsp),%xmm10
mov    0x98(%rsp),%r9
je     1a28 <kernel_adi+0x8d8>
cmp    $0x3,%esi
jl     18d7 <kernel_adi+0x787>
mov    $0x1,%r8d
mov    0x88(%rsp),%rdx
mov    0x90(%rsp),%rbx
mov    0xf8(%rsp),%rsi
mov    0x100(%rsp),%rdi
mov    0xf0(%rsp),%r10
mov    0x108(%rsp),%r11
mov    0x110(%rsp),%r15
mov    0x20(%rsp),%rax
mov    %eax,%r12d
mov    0x30(%rsp),%rax
mov    0x38(%rsp),%rcx
xchg   %ax,%ax
mov    %rsi,0x78(%rsp)
mov    %rbx,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    0x80(%rsp),%rbp
mov    %rax,%rdx
movabs $0x3ff0000000000000,%rax
mov    %rax,0x0(%rbp,%r8,8)
mov    %r8,%rax
imul   0xa8(%rsp),%rax
movq   $0x0,(%rcx,%rax,8)
mov    %r8,0x18(%rsp)
movsd  0x0(%rbp,%r8,8),%xmm0
movsd  %xmm0,(%r9,%rax,8)
mov    0x138(%rsp),%rbp
mov    %r10,0x70(%rsp)
mov    %r10,%rax
mov    %r11,0x68(%rsp)
mov    %r11,%rsi
mov    %r15,0x60(%rsp)
mov    %r15,%r11
mov    %r12d,0x58(%rsp)
mov    %r12d,%r10d
mov    %rdx,0x50(%rsp)
mov    %rdx,%r15
mov    0x48(%rsp),%r8
mov    0x20(%rsp),%r12
movabs $0x100000000,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rbx
sar    $0x1d,%rbx
movsd  (%rcx,%rbx,1),%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
movapd %xmm6,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rsi,%r14,1)
movslq %r10d,%r10
movsd  (%r11,%r14,1),%xmm1
mulsd  %xmm5,%xmm1
add    %r14,%r11
movsd  (%r8,%r10,8),%xmm2
mulsd  %xmm7,%xmm2
addsd  %xmm1,%xmm2
lea    0x2(%r10),%ecx
movslq %ecx,%rcx
movsd  (%r8,%rcx,8),%xmm1
mov    0x38(%rsp),%rcx
mulsd  %xmm7,%xmm1
addsd  %xmm2,%xmm1
movsd  (%r9,%rbx,1),%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rax,%r14,1)
add    %rdx,%r15
add    %r12d,%r10d
add    $0x8,%rsi
add    $0x8,%rax
add    $0xffffffffffffffff,%rbp
jne    1570 <kernel_adi+0x420>
mov    %r9,%r13
mov    0x140(%rsp),%rax
mov    0x18(%rsp),%r8
add    %r8,%rax
mov    0x80(%rsp),%rbp
movabs $0x3ff0000000000000,%rdx
mov    %rdx,0x0(%rbp,%rax,8)
xor    %eax,%eax
mov    0xa0(%rsp),%rbp
mov    0x10(%rsp),%rdx
mov    0x8(%rsp),%rbx
mov    0x78(%rsp),%rsi
nopl   (%rax)
movsd  -0x8(%rbx,%rbp,8),%xmm0
mulsd  (%rsi,%rax,1),%xmm0
addsd  -0x8(%rdx,%rbp,8),%xmm0
movsd  %xmm0,(%rdi,%rax,1)
add    $0xffffffffffffffff,%rbp
sub    %r14,%rax
cmp    $0x1,%rbp
jg     1640 <kernel_adi+0x4f0>
add    $0x1,%r8
mov    0x50(%rsp),%rax
add    0x30(%rsp),%rax
mov    0x58(%rsp),%r12d
add    $0x1,%r12d
mov    0x60(%rsp),%r15
add    $0x8,%r15
mov    0x68(%rsp),%r11
add    %r14,%r11
mov    0x70(%rsp),%r10
add    %r14,%r10
add    $0x8,%rdi
add    $0x8,%rsi
add    %r14,%rbx
add    %r14,%rdx
cmp    0xb0(%rsp),%r8
jne    14d0 <kernel_adi+0x380>
cmpl   $0x3,0x20(%rsp)
mov    0x48(%rsp),%r8
jl     18d7 <kernel_adi+0x787>
mov    $0x1,%eax
mov    0xb8(%rsp),%rcx
mov    0x88(%rsp),%rdx
mov    0x90(%rsp),%rdi
mov    0xe0(%rsp),%rbx
mov    0xc0(%rsp),%rsi
mov    %rsi,0x18(%rsp)
mov    0xc8(%rsp),%rsi
mov    %rsi,0x10(%rsp)
mov    0xd0(%rsp),%rsi
mov    %rsi,0x8(%rsp)
mov    0xd8(%rsp),%r10
mov    0xe8(%rsp),%r12
mov    0x30(%rsp),%r15
mov    %rdi,0x60(%rsp)
mov    %rdx,0x68(%rsp)
mov    %rcx,0x70(%rsp)
mov    %rax,0x78(%rsp)
imul   0xa8(%rsp),%rax
movabs $0x3ff0000000000000,%rsi
mov    %rsi,(%r8,%rax,8)
mov    0x38(%rsp),%rbp
movq   $0x0,0x0(%rbp,%rax,8)
movsd  (%r8,%rax,8),%xmm0
mov    %rax,0x50(%rsp)
movsd  %xmm0,(%r9,%rax,8)
xor    %r8d,%r8d
mov    %r15,0x58(%rsp)
movabs $0x100000000,%rdi
mov    0x128(%rsp),%r11
mov    0x18(%rsp),%rax
mov    0x10(%rsp),%rcx
mov    0x8(%rsp),%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rsi
sar    $0x1d,%rsi
movsd  0x0(%rbp,%rsi,1),%xmm0
mulsd  %xmm9,%xmm0
addsd  %xmm8,%xmm0
movapd %xmm7,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%rdx,%r8,1)
movsd  (%rcx,%r8,1),%xmm1
mulsd  %xmm10,%xmm1
movsd  (%r10,%r8,1),%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm1,%xmm2
movsd  (%r12,%r8,1),%xmm1
mulsd  %xmm6,%xmm1
addsd  %xmm2,%xmm1
movsd  (%r9,%rsi,1),%xmm2
mulsd  %xmm7,%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rax,%r8,1)
add    %rdi,%r15
add    $0x8,%r8
cmp    %r8,%r11
jne    17a0 <kernel_adi+0x650>
mov    0x50(%rsp),%rax
add    0x130(%rsp),%rax
mov    0x48(%rsp),%r8
movabs $0x3ff0000000000000,%rsi
mov    %rsi,(%r8,%rax,8)
mov    0xa0(%rsp),%rsi
mov    %rbx,%r9
movabs $0xffffffff00000000,%rax
ff ff ff
mov    0x70(%rsp),%rcx
mov    0x68(%rsp),%rdx
mov    0x60(%rsp),%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x8(%rdi,%rsi,8),%xmm0
mov    %rbx,%rbp
sar    $0x1d,%rbp
mulsd  (%r8,%rbp,1),%xmm0
addsd  -0x8(%rdx,%rsi,8),%xmm0
movsd  %xmm0,-0x8(%rcx,%rsi,8)
add    %rax,%rbx
add    $0xffffffffffffffff,%rsi
cmp    $0x1,%rsi
jg     1860 <kernel_adi+0x710>
mov    0x78(%rsp),%rax
add    $0x1,%rax
mov    0x30(%rsp),%rsi
mov    0x58(%rsp),%r15
add    %rsi,%r15
add    %r14,%r12
add    %r14,%r10
add    %r14,0x8(%rsp)
add    %r14,0x10(%rsp)
add    %r14,0x18(%rsp)
mov    %r9,%rbx
add    %rsi,%rbx
add    %r14,%rdi
add    %r14,%rdx
add    %r14,%rcx
cmp    0xb0(%rsp),%rax
mov    %r13,%r9
jne    1720 <kernel_adi+0x5d0>
lea    0x1b0(%rsp),%rdi
lea    0x73a(%rip),%r15
mov    %r15,%rsi
mov    0x40(%rsp),%rbp
mov    %ebp,%edx
call   1070 <sprintf@plt>
lea    0x240(%rsp),%r13
mov    %r13,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1070 <sprintf@plt>
lea    0x210(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1070 <sprintf@plt>
lea    0x1e0(%rsp),%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1070 <sprintf@plt>
lea    0x1b0(%rsp),%rbp
mov    %rbp,%rdi
lea    0x6dd(%rip),%rsi
call   1060 <strcat@plt>
mov    %r13,%rdi
lea    0x6dd(%rip),%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
lea    0x6dd(%rip),%rsi
call   1060 <strcat@plt>
mov    %r12,%rdi
lea    0x6dd(%rip),%rsi
call   1060 <strcat@plt>
mov    %rbp,%rdi
lea    0x6dd(%rip),%rbp
mov    %rbp,%rsi
call   1050 <fopen@plt>
mov    %rax,0x18(%rsp)
mov    %r13,%rdi
mov    %rbp,%rsi
call   1050 <fopen@plt>
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <fopen@plt>
mov    %rax,0x8(%rsp)
mov    %r12,%rdi
mov    %rbp,%rsi
call   1050 <fopen@plt>
mov    %rax,%r15
cmpl   $0x0,0x20(%rsp)
jle    13e0 <kernel_adi+0x290>
mov    0x98(%rsp),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %r13d,%r13d
lea    0x678(%rip),%rbx
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%r13,8),%xmm0
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r13d,%ecx
call   1040 <fprintf@plt>
mov    0x148(%rsp),%rax
add    $0x1,%r13
cmp    %r13,%rax
jne    19f0 <kernel_adi+0x8a0>
add    $0x1,%rbp
add    %r14,%r12
cmp    %rax,%rbp
jne    19e0 <kernel_adi+0x890>
jmp    13e0 <kernel_adi+0x290>
add    $0x268,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"_simData_u.dat\00"
@.str.2 = [15 x i8] c"_simData_v.dat\00"
@.str.3 = [15 x i8] c"_simData_p.dat\00"
@.str.4 = [15 x i8] c"_simData_q.dat\00"
@.str.5 = [3 x i8] c"wb\00"
@.str.6 = [11 x i8] c"%d %d %lf\0A\00"
define void @kernel_adi(i32 %0, i32 %1, double* %2, double* %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca [40 x i8]
%34 = alloca [40 x i8]
%35 = alloca [40 x i8]
%36 = alloca [40 x i8]
%37 = alloca i32
%38 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store double* %2, double** %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%39 = load i32, i32* %8
%40 = sitofp i32 %39 to double
%41 = fdiv double 1.000000e+00, %40
store double %41, double* %20
%42 = load i32, i32* %8
%43 = sitofp i32 %42 to double
%44 = fdiv double 1.000000e+00, %43
store double %44, double* %21
%45 = load i32, i32* %7
%46 = sitofp i32 %45 to double
%47 = fdiv double 1.000000e+00, %46
store double %47, double* %22
store double 2.000000e+00, double* %23
store double 1.000000e+00, double* %24
%48 = load double, double* %23
%49 = load double, double* %22
%50 = fmul double %48, %49
%51 = load double, double* %20
%52 = load double, double* %20
%53 = fmul double %51, %52
%54 = fdiv double %50, %53
store double %54, double* %25
%55 = load double, double* %24
%56 = load double, double* %22
%57 = fmul double %55, %56
%58 = load double, double* %21
%59 = load double, double* %21
%60 = fmul double %58, %59
%61 = fdiv double %57, %60
store double %61, double* %26
%62 = load double, double* %25
%63 = fneg double %62
%64 = fdiv double %63, 2.000000e+00
store double %64, double* %27
%65 = load double, double* %25
%66 = fadd double 1.000000e+00, %65
store double %66, double* %28
%67 = load double, double* %27
store double %67, double* %29
%68 = load double, double* %26
%69 = fneg double %68
%70 = fdiv double %69, 2.000000e+00
store double %70, double* %30
%71 = load double, double* %26
%72 = fadd double 1.000000e+00, %71
store double %72, double* %31
%73 = load double, double* %30
store double %73, double* %32
store i32 1, i32* %17
br label %74
74: ; preds = %538, %6
%75 = load i32, i32* %17
%76 = load i32, i32* %7
%77 = icmp sle i32 %75, %76
br i1 %77, label %78, label %541
78: ; preds = %74
store i32 1, i32* %18
br label %79
79: ; preds = %269, %78
%80 = load i32, i32* %18
%81 = load i32, i32* %8
%82 = sub nsw i32 %81, 1
%83 = icmp slt i32 %80, %82
br i1 %83, label %84, label %272
84: ; preds = %79
%85 = load double*, double** %10
%86 = load i32, i32* %18
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %85, i64 %87
store double 1.000000e+00, double* %88
%89 = load double*, double** %11
%90 = load i32, i32* %18
%91 = load i32, i32* %8
%92 = mul nsw i32 %90, %91
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %89, i64 %93
store double 0.000000e+00, double* %94
%95 = load double*, double** %10
%96 = load i32, i32* %18
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds double, double* %95, i64 %97
%99 = load double, double* %98
%100 = load double*, double** %12
%101 = load i32, i32* %18
%102 = load i32, i32* %8
%103 = mul nsw i32 %101, %102
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %100, i64 %104
store double %99, double* %105
store i32 1, i32* %19
br label %106
106: ; preds = %209, %84
%107 = load i32, i32* %19
%108 = load i32, i32* %8
%109 = sub nsw i32 %108, 1
%110 = icmp slt i32 %107, %109
br i1 %110, label %111, label %212
111: ; preds = %106
%112 = load double, double* %29
%113 = fneg double %112
%114 = load double, double* %27
%115 = load double*, double** %11
%116 = load i32, i32* %18
%117 = load i32, i32* %8
%118 = mul nsw i32 %116, %117
%119 = load i32, i32* %19
%120 = sub nsw i32 %119, 1
%121 = add nsw i32 %118, %120
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %115, i64 %122
%124 = load double, double* %123
%125 = load double, double* %28
%126 = call double @llvm.fmuladd.f64(double %114, double %124, double %125)
%127 = fdiv double %113, %126
%128 = load double*, double** %11
%129 = load i32, i32* %18
%130 = load i32, i32* %8
%131 = mul nsw i32 %129, %130
%132 = load i32, i32* %19
%133 = add nsw i32 %131, %132
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double, double* %128, i64 %134
store double %127, double* %135
%136 = load double, double* %30
%137 = fneg double %136
%138 = load double*, double** %9
%139 = load i32, i32* %19
%140 = load i32, i32* %8
%141 = mul nsw i32 %139, %140
%142 = load i32, i32* %18
%143 = sub nsw i32 %142, 1
%144 = add nsw i32 %141, %143
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds double, double* %138, i64 %145
%147 = load double, double* %146
%148 = load double, double* %30
%149 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %148, double 1.000000e+00)
%150 = load double*, double** %9
%151 = load i32, i32* %19
%152 = load i32, i32* %8
%153 = mul nsw i32 %151, %152
%154 = load i32, i32* %18
%155 = add nsw i32 %153, %154
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %150, i64 %156
%158 = load double, double* %157
%159 = fmul double %149, %158
%160 = call double @llvm.fmuladd.f64(double %137, double %147, double %159)
%161 = load double, double* %32
%162 = load double*, double** %9
%163 = load i32, i32* %19
%164 = load i32, i32* %8
%165 = mul nsw i32 %163, %164
%166 = load i32, i32* %18
%167 = add nsw i32 %166, 1
%168 = add nsw i32 %165, %167
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %162, i64 %169
%171 = load double, double* %170
%172 = fneg double %161
%173 = call double @llvm.fmuladd.f64(double %172, double %171, double %160)
%174 = load double, double* %27
%175 = load double*, double** %12
%176 = load i32, i32* %18
%177 = load i32, i32* %8
%178 = mul nsw i32 %176, %177
%179 = load i32, i32* %19
%180 = sub nsw i32 %179, 1
%181 = add nsw i32 %178, %180
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %175, i64 %182
%184 = load double, double* %183
%185 = fneg double %174
%186 = call double @llvm.fmuladd.f64(double %185, double %184, double %173)
%187 = load double, double* %27
%188 = load double*, double** %11
%189 = load i32, i32* %18
%190 = load i32, i32* %8
%191 = mul nsw i32 %189, %190
%192 = load i32, i32* %19
%193 = sub nsw i32 %192, 1
%194 = add nsw i32 %191, %193
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds double, double* %188, i64 %195
%197 = load double, double* %196
%198 = load double, double* %28
%199 = call double @llvm.fmuladd.f64(double %187, double %197, double %198)
%200 = fdiv double %186, %199
%201 = load double*, double** %12
%202 = load i32, i32* %18
%203 = load i32, i32* %8
%204 = mul nsw i32 %202, %203
%205 = load i32, i32* %19
%206 = add nsw i32 %204, %205
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds double, double* %201, i64 %207
store double %200, double* %208
br label %209
209: ; preds = %111
%210 = load i32, i32* %19
%211 = add nsw i32 %210, 1
store i32 %211, i32* %19
br label %106
212: ; preds = %106
%213 = load double*, double** %10
%214 = load i32, i32* %8
%215 = load i32, i32* %8
%216 = sub nsw i32 %215, 1
%217 = mul nsw i32 %214, %216
%218 = load i32, i32* %18
%219 = add nsw i32 %217, %218
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds double, double* %213, i64 %220
store double 1.000000e+00, double* %221
%222 = load i32, i32* %8
%223 = sub nsw i32 %222, 2
store i32 %223, i32* %19
br label %224
224: ; preds = %265, %212
%225 = load i32, i32* %19
%226 = icmp sge i32 %225, 1
br i1 %226, label %227, label %268
227: ; preds = %224
%228 = load double*, double** %11
%229 = load i32, i32* %18
%230 = load i32, i32* %8
%231 = mul nsw i32 %229, %230
%232 = load i32, i32* %19
%233 = add nsw i32 %231, %232
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds double, double* %228, i64 %234
%236 = load double, double* %235
%237 = load double*, double** %10
%238 = load i32, i32* %19
%239 = add nsw i32 %238, 1
%240 = load i32, i32* %8
%241 = mul nsw i32 %239, %240
%242 = load i32, i32* %18
%243 = add nsw i32 %241, %242
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds double, double* %237, i64 %244
%246 = load double, double* %245
%247 = load double*, double** %12
%248 = load i32, i32* %18
%249 = load i32, i32* %8
%250 = mul nsw i32 %248, %249
%251 = load i32, i32* %19
%252 = add nsw i32 %250, %251
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds double, double* %247, i64 %253
%255 = load double, double* %254
%256 = call double @llvm.fmuladd.f64(double %236, double %246, double %255)
%257 = load double*, double** %10
%258 = load i32, i32* %19
%259 = load i32, i32* %8
%260 = mul nsw i32 %258, %259
%261 = load i32, i32* %18
%262 = add nsw i32 %260, %261
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds double, double* %257, i64 %263
store double %256, double* %264
br label %265
265: ; preds = %227
%266 = load i32, i32* %19
%267 = add nsw i32 %266, -1
store i32 %267, i32* %19
br label %224
268: ; preds = %224
br label %269
269: ; preds = %268
%270 = load i32, i32* %18
%271 = add nsw i32 %270, 1
store i32 %271, i32* %18
br label %79
272: ; preds = %79
store i32 1, i32* %18
br label %273
273: ; preds = %467, %272
%274 = load i32, i32* %18
%275 = load i32, i32* %8
%276 = sub nsw i32 %275, 1
%277 = icmp slt i32 %274, %276
br i1 %277, label %278, label %470
278: ; preds = %273
%279 = load double*, double** %9
%280 = load i32, i32* %18
%281 = load i32, i32* %8
%282 = mul nsw i32 %280, %281
%283 = sext i32 %282 to i64
%284 = getelementptr inbounds double, double* %279, i64 %283
store double 1.000000e+00, double* %284
%285 = load double*, double** %11
%286 = load i32, i32* %18
%287 = load i32, i32* %8
%288 = mul nsw i32 %286, %287
%289 = sext i32 %288 to i64
%290 = getelementptr inbounds double, double* %285, i64 %289
store double 0.000000e+00, double* %290
%291 = load double*, double** %9
%292 = load i32, i32* %18
%293 = load i32, i32* %8
%294 = mul nsw i32 %292, %293
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds double, double* %291, i64 %295
%297 = load double, double* %296
%298 = load double*, double** %12
%299 = load i32, i32* %18
%300 = load i32, i32* %8
%301 = mul nsw i32 %299, %300
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds double, double* %298, i64 %302
store double %297, double* %303
store i32 1, i32* %19
br label %304
304: ; preds = %407, %278
%305 = load i32, i32* %19
%306 = load i32, i32* %8
%307 = sub nsw i32 %306, 1
%308 = icmp slt i32 %305, %307
br i1 %308, label %309, label %410
309: ; preds = %304
%310 = load double, double* %32
%311 = fneg double %310
%312 = load double, double* %30
%313 = load double*, double** %11
%314 = load i32, i32* %18
%315 = load i32, i32* %8
%316 = mul nsw i32 %314, %315
%317 = load i32, i32* %19
%318 = sub nsw i32 %317, 1
%319 = add nsw i32 %316, %318
%320 = sext i32 %319 to i64
%321 = getelementptr inbounds double, double* %313, i64 %320
%322 = load double, double* %321
%323 = load double, double* %31
%324 = call double @llvm.fmuladd.f64(double %312, double %322, double %323)
%325 = fdiv double %311, %324
%326 = load double*, double** %11
%327 = load i32, i32* %18
%328 = load i32, i32* %8
%329 = mul nsw i32 %327, %328
%330 = load i32, i32* %19
%331 = add nsw i32 %329, %330
%332 = sext i32 %331 to i64
%333 = getelementptr inbounds double, double* %326, i64 %332
store double %325, double* %333
%334 = load double, double* %27
%335 = fneg double %334
%336 = load double*, double** %10
%337 = load i32, i32* %18
%338 = sub nsw i32 %337, 1
%339 = load i32, i32* %8
%340 = mul nsw i32 %338, %339
%341 = load i32, i32* %19
%342 = add nsw i32 %340, %341
%343 = sext i32 %342 to i64
%344 = getelementptr inbounds double, double* %336, i64 %343
%345 = load double, double* %344
%346 = load double, double* %27
%347 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %346, double 1.000000e+00)
%348 = load double*, double** %10
%349 = load i32, i32* %18
%350 = load i32, i32* %8
%351 = mul nsw i32 %349, %350
%352 = load i32, i32* %19
%353 = add nsw i32 %351, %352
%354 = sext i32 %353 to i64
%355 = getelementptr inbounds double, double* %348, i64 %354
%356 = load double, double* %355
%357 = fmul double %347, %356
%358 = call double @llvm.fmuladd.f64(double %335, double %345, double %357)
%359 = load double, double* %29
%360 = load double*, double** %10
%361 = load i32, i32* %18
%362 = add nsw i32 %361, 1
%363 = load i32, i32* %8
%364 = mul nsw i32 %362, %363
%365 = load i32, i32* %19
%366 = add nsw i32 %364, %365
%367 = sext i32 %366 to i64
%368 = getelementptr inbounds double, double* %360, i64 %367
%369 = load double, double* %368
%370 = fneg double %359
%371 = call double @llvm.fmuladd.f64(double %370, double %369, double %358)
%372 = load double, double* %30
%373 = load double*, double** %12
%374 = load i32, i32* %18
%375 = load i32, i32* %8
%376 = mul nsw i32 %374, %375
%377 = load i32, i32* %19
%378 = sub nsw i32 %377, 1
%379 = add nsw i32 %376, %378
%380 = sext i32 %379 to i64
%381 = getelementptr inbounds double, double* %373, i64 %380
%382 = load double, double* %381
%383 = fneg double %372
%384 = call double @llvm.fmuladd.f64(double %383, double %382, double %371)
%385 = load double, double* %30
%386 = load double*, double** %11
%387 = load i32, i32* %18
%388 = load i32, i32* %8
%389 = mul nsw i32 %387, %388
%390 = load i32, i32* %19
%391 = sub nsw i32 %390, 1
%392 = add nsw i32 %389, %391
%393 = sext i32 %392 to i64
%394 = getelementptr inbounds double, double* %386, i64 %393
%395 = load double, double* %394
%396 = load double, double* %31
%397 = call double @llvm.fmuladd.f64(double %385, double %395, double %396)
%398 = fdiv double %384, %397
%399 = load double*, double** %12
%400 = load i32, i32* %18
%401 = load i32, i32* %8
%402 = mul nsw i32 %400, %401
%403 = load i32, i32* %19
%404 = add nsw i32 %402, %403
%405 = sext i32 %404 to i64
%406 = getelementptr inbounds double, double* %399, i64 %405
store double %398, double* %406
br label %407
407: ; preds = %309
%408 = load i32, i32* %19
%409 = add nsw i32 %408, 1
store i32 %409, i32* %19
br label %304
410: ; preds = %304
%411 = load double*, double** %9
%412 = load i32, i32* %18
%413 = load i32, i32* %8
%414 = mul nsw i32 %412, %413
%415 = load i32, i32* %8
%416 = sub nsw i32 %415, 1
%417 = add nsw i32 %414, %416
%418 = sext i32 %417 to i64
%419 = getelementptr inbounds double, double* %411, i64 %418
store double 1.000000e+00, double* %419
%420 = load i32, i32* %8
%421 = sub nsw i32 %420, 2
store i32 %421, i32* %19
br label %422
422: ; preds = %463, %410
%423 = load i32, i32* %19
%424 = icmp sge i32 %423, 1
br i1 %424, label %425, label %466
425: ; preds = %422
%426 = load double*, double** %11
%427 = load i32, i32* %18
%428 = load i32, i32* %8
%429 = mul nsw i32 %427, %428
%430 = load i32, i32* %19
%431 = add nsw i32 %429, %430
%432 = sext i32 %431 to i64
%433 = getelementptr inbounds double, double* %426, i64 %432
%434 = load double, double* %433
%435 = load double*, double** %9
%436 = load i32, i32* %18
%437 = load i32, i32* %8
%438 = mul nsw i32 %436, %437
%439 = load i32, i32* %19
%440 = add nsw i32 %439, 1
%441 = add nsw i32 %438, %440
%442 = sext i32 %441 to i64
%443 = getelementptr inbounds double, double* %435, i64 %442
%444 = load double, double* %443
%445 = load double*, double** %12
%446 = load i32, i32* %18
%447 = load i32, i32* %8
%448 = mul nsw i32 %446, %447
%449 = load i32, i32* %19
%450 = add nsw i32 %448, %449
%451 = sext i32 %450 to i64
%452 = getelementptr inbounds double, double* %445, i64 %451
%453 = load double, double* %452
%454 = call double @llvm.fmuladd.f64(double %434, double %444, double %453)
%455 = load double*, double** %9
%456 = load i32, i32* %18
%457 = load i32, i32* %8
%458 = mul nsw i32 %456, %457
%459 = load i32, i32* %19
%460 = add nsw i32 %458, %459
%461 = sext i32 %460 to i64
%462 = getelementptr inbounds double, double* %455, i64 %461
store double %454, double* %462
br label %463
463: ; preds = %425
%464 = load i32, i32* %19
%465 = add nsw i32 %464, -1
store i32 %465, i32* %19
br label %422
466: ; preds = %422
br label %467
467: ; preds = %466
%468 = load i32, i32* %18
%469 = add nsw i32 %468, 1
store i32 %469, i32* %18
br label %273
470: ; preds = %273
%471 = getelementptr inbounds [40 x i8], [40 x i8]* %33, i64 0, i64 0
%472 = load i32, i32* %17
%473 = call i32 @sprintf(i8* %471, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %472)
%474 = getelementptr inbounds [40 x i8], [40 x i8]* %34, i64 0, i64 0
%475 = load i32, i32* %17
%476 = call i32 @sprintf(i8* %474, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %475)
%477 = getelementptr inbounds [40 x i8], [40 x i8]* %35, i64 0, i64 0
%478 = load i32, i32* %17
%479 = call i32 @sprintf(i8* %477, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %478)
%480 = getelementptr inbounds [40 x i8], [40 x i8]* %36, i64 0, i64 0
%481 = load i32, i32* %17
%482 = call i32 @sprintf(i8* %480, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %481)
%483 = getelementptr inbounds [40 x i8], [40 x i8]* %33, i64 0, i64 0
%484 = call i32 @strcat(i8* %483, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%485 = getelementptr inbounds [40 x i8], [40 x i8]* %34, i64 0, i64 0
%486 = call i32 @strcat(i8* %485, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%487 = getelementptr inbounds [40 x i8], [40 x i8]* %35, i64 0, i64 0
%488 = call i32 @strcat(i8* %487, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%489 = getelementptr inbounds [40 x i8], [40 x i8]* %36, i64 0, i64 0
%490 = call i32 @strcat(i8* %489, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%491 = getelementptr inbounds [40 x i8], [40 x i8]* %33, i64 0, i64 0
%492 = call i32* @fopen(i8* %491, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %492, i32** %13
%493 = getelementptr inbounds [40 x i8], [40 x i8]* %34, i64 0, i64 0
%494 = call i32* @fopen(i8* %493, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %494, i32** %14
%495 = getelementptr inbounds [40 x i8], [40 x i8]* %35, i64 0, i64 0
%496 = call i32* @fopen(i8* %495, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %496, i32** %15
%497 = getelementptr inbounds [40 x i8], [40 x i8]* %36, i64 0, i64 0
%498 = call i32* @fopen(i8* %497, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32* %498, i32** %16
store i32 0, i32* %37
br label %499
499: ; preds = %526, %470
%500 = load i32, i32* %37
%501 = load i32, i32* %8
%502 = icmp slt i32 %500, %501
br i1 %502, label %503, label %529
503: ; preds = %499
store i32 0, i32* %38
br label %504
504: ; preds = %522, %503
%505 = load i32, i32* %38
%506 = load i32, i32* %8
%507 = icmp slt i32 %505, %506
br i1 %507, label %508, label %525
508: ; preds = %504
%509 = load i32*, i32** %16
%510 = load i32, i32* %37
%511 = load i32, i32* %38
%512 = load double*, double** %12
%513 = load i32, i32* %37
%514 = load i32, i32* %8
%515 = mul nsw i32 %513, %514
%516 = load i32, i32* %38
%517 = add nsw i32 %515, %516
%518 = sext i32 %517 to i64
%519 = getelementptr inbounds double, double* %512, i64 %518
%520 = load double, double* %519
%521 = call i32 @fprintf(i32* %509, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %510, i32 %511, double %520)
br label %522
522: ; preds = %508
%523 = load i32, i32* %38
%524 = add nsw i32 %523, 1
store i32 %524, i32* %38
br label %504
525: ; preds = %504
br label %526
526: ; preds = %525
%527 = load i32, i32* %37
%528 = add nsw i32 %527, 1
store i32 %528, i32* %37
br label %499
529: ; preds = %499
%530 = load i32*, i32** %13
%531 = call i32 @fclose(i32* %530)
%532 = load i32*, i32** %14
%533 = call i32 @fclose(i32* %532)
%534 = load i32*, i32** %15
%535 = call i32 @fclose(i32* %534)
%536 = load i32*, i32** %16
%537 = call i32 @fclose(i32* %536)
br label %538
538: ; preds = %529
%539 = load i32, i32* %17
%540 = add nsw i32 %539, 1
store i32 %540, i32* %17
br label %74
541: ; preds = %74
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"_simData_u.dat\00"
@.str.2 = [15 x i8] c"_simData_v.dat\00"
@.str.3 = [15 x i8] c"_simData_p.dat\00"
@.str.4 = [15 x i8] c"_simData_q.dat\00"
@.str.5 = [3 x i8] c"wb\00"
@.str.6 = [11 x i8] c"%d %d %lf\0A\00"
define void @kernel_adi(i32 %0, i32 %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = alloca [40 x i8]
%8 = alloca [40 x i8]
%9 = alloca [40 x i8]
%10 = alloca [40 x i8]
%11 = sitofp i32 %1 to double
%12 = fdiv double 1.000000e+00, %11
%13 = sitofp i32 %0 to double
%14 = fdiv double 1.000000e+00, %13
%15 = fmul double %14, 2.000000e+00
%16 = fmul double %12, %12
%17 = fdiv double %15, %16
%18 = fdiv double %14, %16
%19 = fmul double %17, -5.000000e-01
%20 = fadd double %17, 1.000000e+00
%21 = fmul double %18, -5.000000e-01
%22 = fadd double %18, 1.000000e+00
%23 = icmp slt i32 %0, 1
br i1 %23, label %217, label %24
24: ; preds = %6
%25 = add i32 %1, -1
%26 = icmp sgt i32 %1, 2
%27 = fneg double %19
%28 = fneg double %21
%29 = call double @llvm.fmuladd.f64(double %21, double 2.000000e+00, double 1.000000e+00)
%30 = mul nsw i32 %25, %1
%31 = add i32 %1, -2
%32 = call double @llvm.fmuladd.f64(double %19, double 2.000000e+00, double 1.000000e+00)
%33 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i64 0, i64 0
%34 = getelementptr inbounds [40 x i8], [40 x i8]* %8, i64 0, i64 0
%35 = getelementptr inbounds [40 x i8], [40 x i8]* %9, i64 0, i64 0
%36 = getelementptr inbounds [40 x i8], [40 x i8]* %10, i64 0, i64 0
%37 = icmp sgt i32 %1, 0
%38 = sext i32 %1 to i64
%39 = sext i32 %31 to i64
%40 = sext i32 %30 to i64
%41 = sext i32 %25 to i64
%42 = zext i32 %25 to i64
%43 = zext i32 %25 to i64
%44 = zext i32 %1 to i64
br label %45
45: ; preds = %24, %198
%46 = phi i32 [ 1, %24 ], [ %203, %198 ]
br i1 %26, label %48, label %181
47: ; preds = %114
br i1 %26, label %117, label %181
48: ; preds = %45, %114
%49 = phi i64 [ %115, %114 ], [ 1, %45 ]
%50 = getelementptr inbounds double, double* %3, i64 %49
store double 1.000000e+00, double* %50
%51 = mul nsw i64 %49, %38
%52 = getelementptr inbounds double, double* %4, i64 %51
store double 0.000000e+00, double* %52
%53 = load double, double* %50
%54 = getelementptr inbounds double, double* %5, i64 %51
store double %53, double* %54
%55 = trunc i64 %49 to i32
br label %56
56: ; preds = %48, %56
%57 = phi i64 [ 1, %48 ], [ %91, %56 ]
%58 = trunc i64 %57 to i32
%59 = add i64 %57, %51
%60 = shl i64 %59, 32
%61 = add i64 %60, -4294967296
%62 = ashr exact i64 %61, 32
%63 = getelementptr inbounds double, double* %4, i64 %62
%64 = load double, double* %63
%65 = call double @llvm.fmuladd.f64(double %19, double %64, double %20)
%66 = fdiv double %27, %65
%67 = add nsw i64 %57, %51
%68 = getelementptr inbounds double, double* %4, i64 %67
store double %66, double* %68
%69 = mul nsw i64 %57, %38
%70 = mul nsw i32 %58, %1
%71 = add i32 %70, %55
%72 = add i32 %71, -1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double, double* %2, i64 %73
%75 = load double, double* %74
%76 = add nsw i64 %69, %49
%77 = getelementptr inbounds double, double* %2, i64 %76
%78 = load double, double* %77
%79 = fmul double %29, %78
%80 = call double @llvm.fmuladd.f64(double %28, double %75, double %79)
%81 = add i32 %71, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %2, i64 %82
%84 = load double, double* %83
%85 = call double @llvm.fmuladd.f64(double %28, double %84, double %80)
%86 = getelementptr inbounds double, double* %5, i64 %62
%87 = load double, double* %86
%88 = call double @llvm.fmuladd.f64(double %27, double %87, double %85)
%89 = fdiv double %88, %65
%90 = getelementptr inbounds double, double* %5, i64 %67
store double %89, double* %90
%91 = add nuw nsw i64 %57, 1
%92 = icmp eq i64 %91, %42
br i1 %92, label %93, label %56
93: ; preds = %56
%94 = add nsw i64 %49, %40
%95 = getelementptr inbounds double, double* %3, i64 %94
store double 1.000000e+00, double* %95
br label %96
96: ; preds = %93, %96
%97 = phi i64 [ %39, %93 ], [ %112, %96 ]
%98 = add nsw i64 %97, %51
%99 = getelementptr inbounds double, double* %4, i64 %98
%100 = load double, double* %99
%101 = add nuw nsw i64 %97, 1
%102 = mul nsw i64 %101, %38
%103 = add nsw i64 %102, %49
%104 = getelementptr inbounds double, double* %3, i64 %103
%105 = load double, double* %104
%106 = getelementptr inbounds double, double* %5, i64 %98
%107 = load double, double* %106
%108 = call double @llvm.fmuladd.f64(double %100, double %105, double %107)
%109 = mul nsw i64 %97, %38
%110 = add nsw i64 %109, %49
%111 = getelementptr inbounds double, double* %3, i64 %110
store double %108, double* %111
%112 = add nsw i64 %97, -1
%113 = icmp sgt i64 %97, 1
br i1 %113, label %96, label %114
114: ; preds = %96
%115 = add nuw nsw i64 %49, 1
%116 = icmp eq i64 %115, %42
br i1 %116, label %47, label %48
117: ; preds = %47, %178
%118 = phi i64 [ %179, %178 ], [ 1, %47 ]
%119 = mul nsw i64 %118, %38
%120 = getelementptr inbounds double, double* %2, i64 %119
store double 1.000000e+00, double* %120
%121 = getelementptr inbounds double, double* %4, i64 %119
store double 0.000000e+00, double* %121
%122 = load double, double* %120
%123 = getelementptr inbounds double, double* %5, i64 %119
store double %122, double* %123
%124 = add nsw i64 %118, -1
%125 = mul nsw i64 %124, %38
%126 = add nuw nsw i64 %118, 1
%127 = mul nsw i64 %126, %38
br label %128
128: ; preds = %117, %128
%129 = phi i64 [ 1, %117 ], [ %156, %128 ]
%130 = add i64 %129, %119
%131 = shl i64 %130, 32
%132 = add i64 %131, -4294967296
%133 = ashr exact i64 %132, 32
%134 = getelementptr inbounds double, double* %4, i64 %133
%135 = load double, double* %134
%136 = call double @llvm.fmuladd.f64(double %21, double %135, double %22)
%137 = fdiv double %28, %136
%138 = add nsw i64 %129, %119
%139 = getelementptr inbounds double, double* %4, i64 %138
store double %137, double* %139
%140 = add nsw i64 %129, %125
%141 = getelementptr inbounds double, double* %3, i64 %140
%142 = load double, double* %141
%143 = getelementptr inbounds double, double* %3, i64 %138
%144 = load double, double* %143
%145 = fmul double %32, %144
%146 = call double @llvm.fmuladd.f64(double %27, double %142, double %145)
%147 = add nsw i64 %129, %127
%148 = getelementptr inbounds double, double* %3, i64 %147
%149 = load double, double* %148
%150 = call double @llvm.fmuladd.f64(double %27, double %149, double %146)
%151 = getelementptr inbounds double, double* %5, i64 %133
%152 = load double, double* %151
%153 = call double @llvm.fmuladd.f64(double %28, double %152, double %150)
%154 = fdiv double %153, %136
%155 = getelementptr inbounds double, double* %5, i64 %138
store double %154, double* %155
%156 = add nuw nsw i64 %129, 1
%157 = icmp eq i64 %156, %43
br i1 %157, label %158, label %128
158: ; preds = %128
%159 = add nsw i64 %119, %41
%160 = getelementptr inbounds double, double* %2, i64 %159
store double 1.000000e+00, double* %160
br label %161
161: ; preds = %158, %161
%162 = phi i64 [ %39, %158 ], [ %176, %161 ]
%163 = add nsw i64 %162, %119
%164 = getelementptr inbounds double, double* %4, i64 %163
%165 = load double, double* %164
%166 = add i64 %162, %119
%167 = shl i64 %166, 32
%168 = add i64 %167, 4294967296
%169 = ashr exact i64 %168, 32
%170 = getelementptr inbounds double, double* %2, i64 %169
%171 = load double, double* %170
%172 = getelementptr inbounds double, double* %5, i64 %163
%173 = load double, double* %172
%174 = call double @llvm.fmuladd.f64(double %165, double %171, double %173)
%175 = getelementptr inbounds double, double* %2, i64 %163
store double %174, double* %175
%176 = add nsw i64 %162, -1
%177 = icmp sgt i64 %162, 1
br i1 %177, label %161, label %178
178: ; preds = %161
%179 = add nuw nsw i64 %118, 1
%180 = icmp eq i64 %179, %43
br i1 %180, label %181, label %117
181: ; preds = %178, %45, %47
%182 = call i32 @sprintf(i8* %33, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %46)
%183 = call i32 @sprintf(i8* %34, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %46)
%184 = call i32 @sprintf(i8* %35, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %46)
%185 = call i32 @sprintf(i8* %36, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %46)
%186 = call i32 @strcat(i8* %33, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%187 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%188 = call i32 @strcat(i8* %35, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%189 = call i32 @strcat(i8* %36, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%190 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%191 = call i32* @fopen(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%192 = call i32* @fopen(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%193 = call i32* @fopen(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br i1 %37, label %194, label %198
194: ; preds = %181, %205
%195 = phi i64 [ %206, %205 ], [ 0, %181 ]
%196 = mul nsw i64 %195, %38
%197 = trunc i64 %195 to i32
br label %208
198: ; preds = %205, %181
%199 = call i32 @fclose(i32* %190)
%200 = call i32 @fclose(i32* %191)
%201 = call i32 @fclose(i32* %192)
%202 = call i32 @fclose(i32* %193)
%203 = add nuw i32 %46, 1
%204 = icmp eq i32 %46, %0
br i1 %204, label %217, label %45
205: ; preds = %208
%206 = add nuw nsw i64 %195, 1
%207 = icmp eq i64 %206, %44
br i1 %207, label %198, label %194
208: ; preds = %194, %208
%209 = phi i64 [ 0, %194 ], [ %215, %208 ]
%210 = add nsw i64 %209, %196
%211 = getelementptr inbounds double, double* %5, i64 %210
%212 = load double, double* %211
%213 = trunc i64 %209 to i32
%214 = call i32 @fprintf(i32* %193, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 %197, i32 %213, double %212)
%215 = add nuw nsw i64 %209, 1
%216 = icmp eq i64 %215, %44
br i1 %216, label %205, label %208
217: ; preds = %198, %6
ret void
}