#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 psg_kernel_adi(int tsteps, int n, double *u, double *v, double *p,
                    double *q) {
  double *q1;
  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--) {
        if (t == tsteps / 2 && i == n / 2 && j == n / 2) {
          q1 = q + 16;
          q[i * n + j] = q1[i * n + j];
        }
        u[i * n + j] = p[i * n + j] * u[i * n + (j + 1)] + q[i * n + j];
      }
    }
    char buffer_q[40];
    sprintf(buffer_q, "%d", t);
    strcat(buffer_q, "_simData_q.dat");
    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_q);
  }
#pragma endscop
}


x86 assembly (clang, -O0):
<psg_kernel_adi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%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,-0x68(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xe6c(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xe56(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe4d(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe38(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
mulsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
mulsd  -0x68(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x78(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
mulsd  -0x70(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdce(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xdb2(%rip),%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd73(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xd57(%rip),%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movl   $0x1,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1a5a <psg_kernel_adi+0x90a>
movl   $0x1,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    15cc <psg_kernel_adi+0x47c>
mov    -0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  0xcfc(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x58(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1512 <psg_kernel_adi+0x3c2>
movsd  -0xb0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xb8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x5c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x58(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xb8(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
movsd  0xbef(%rip),%xmm3
addsd  %xmm3,%xmm1
mov    -0x10(%rbp),%rax
mov    -0x5c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0xc8(%rbp),%xmm1
ff
mov    -0x10(%rbp),%rax
mov    -0x5c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x58(%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  -0xa0(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x5c(%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  -0xa0(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1346 <psg_kernel_adi+0x1f6>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
imul   %edx,%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  0xad0(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x5c(%rbp)
cmpl   $0x1,-0x5c(%rbp)
jl     15b9 <psg_kernel_adi+0x469>
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x5c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x58(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x5c(%rbp)
jmp    153e <psg_kernel_adi+0x3ee>
jmp    15be <psg_kernel_adi+0x46e>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    12e3 <psg_kernel_adi+0x193>
movl   $0x1,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    196c <psg_kernel_adi+0x81c>
mov    -0x10(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  0xa06(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    180a <psg_kernel_adi+0x6ba>
movsd  -0xc8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0xb8(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0xc0(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xa0(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x58(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
addsd  %xmm1,%xmm1
movsd  0x8f5(%rip),%xmm3
addsd  %xmm3,%xmm1
mov    -0x18(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0xb0(%rbp),%xmm1
ff
mov    -0x18(%rbp),%rax
mov    -0x58(%rbp),%ecx
add    $0x1,%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%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  -0xb8(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x5c(%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  -0xb8(%rbp),%xmm1
ff
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x5c(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
movsd  -0xc0(%rbp),%xmm2
ff
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1642 <psg_kernel_adi+0x4f2>
mov    -0x10(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  0x7d8(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x5c(%rbp)
cmpl   $0x1,-0x5c(%rbp)
jl     1959 <psg_kernel_adi+0x809>
mov    -0x54(%rbp),%eax
mov    %eax,-0xfc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xfc(%rbp),%eax
cmp    %ecx,%eax
jne    18e6 <psg_kernel_adi+0x796>
mov    -0x58(%rbp),%eax
mov    %eax,-0x100(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x100(%rbp),%eax
cmp    %ecx,%eax
jne    18e6 <psg_kernel_adi+0x796>
mov    -0x5c(%rbp),%eax
mov    %eax,-0x104(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x104(%rbp),%eax
cmp    %ecx,%eax
jne    18e6 <psg_kernel_adi+0x796>
mov    -0x28(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x5c(%rbp),%edx
add    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x58(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x5c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x5c(%rbp)
jmp    1836 <psg_kernel_adi+0x6e6>
jmp    195e <psg_kernel_adi+0x80e>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    15d3 <psg_kernel_adi+0x483>
lea    -0xf0(%rbp),%rdi
mov    -0x54(%rbp),%edx
lea    0x693(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
lea    0x683(%rip),%rsi
call   1060 <strcat@plt>
lea    -0xf0(%rbp),%rdi
lea    0x67f(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0xf4(%rbp)
mov    -0xf4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1a43 <psg_kernel_adi+0x8f3>
movl   $0x0,-0xf8(%rbp)
mov    -0xf8(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1a2a <psg_kernel_adi+0x8da>
mov    -0x50(%rbp),%rdi
mov    -0xf4(%rbp),%edx
mov    -0xf8(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    -0xf4(%rbp),%esi
imul   -0x8(%rbp),%esi
add    -0xf8(%rbp),%esi
movslq %esi,%rsi
movsd  (%rax,%rsi,8),%xmm0
lea    0x614(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0xf8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
jmp    19cf <psg_kernel_adi+0x87f>
jmp    1a2f <psg_kernel_adi+0x8df>
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    19b6 <psg_kernel_adi+0x866>
mov    -0x50(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    12d0 <psg_kernel_adi+0x180>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psg_kernel_adi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1d8,%rsp
mov    %r9,0x8(%rsp)
mov    %rcx,0x68(%rsp)
mov    %edi,0x14(%rsp)
test   %edi,%edi
jle    1989 <psg_kernel_adi+0x839>
mov    %r8,%rbp
cvtsi2sd %esi,%xmm1
movsd  0xe7a(%rip),%xmm0
movapd %xmm0,%xmm2
mov    0x14(%rsp),%edi
cvtsi2sd %edi,%xmm3
divsd  %xmm1,%xmm2
movapd %xmm0,%xmm8
divsd  %xmm3,%xmm8
movapd %xmm8,%xmm4
addsd  %xmm8,%xmm4
mulsd  %xmm2,%xmm2
divsd  %xmm2,%xmm4
divsd  %xmm2,%xmm8
movsd  0xe48(%rip),%xmm9
movapd %xmm4,%xmm3
mulsd  %xmm9,%xmm3
addsd  %xmm0,%xmm4
mulsd  %xmm8,%xmm9
addsd  %xmm0,%xmm8
movabs $0x100000000,%r8
lea    -0x1(%rsi),%r9d
movapd 0xe23(%rip),%xmm7
movapd %xmm3,%xmm6
xorpd  %xmm7,%xmm6
xorpd  %xmm9,%xmm7
movapd %xmm9,%xmm5
addsd  %xmm9,%xmm5
addsd  %xmm0,%xmm5
mov    %r9d,%eax
imul   %esi,%eax
lea    -0x2(%rsi),%ecx
movapd %xmm3,%xmm10
addsd  %xmm3,%xmm10
addsd  %xmm0,%xmm10
shr    %edi
mov    %edi,0x70(%rsp)
mov    %esi,%edi
shr    $0x1f,%edi
add    %esi,%edi
sar    %edi
movslq %esi,%rbx
movslq %ecx,%rcx
cltq
mov    %rax,0x138(%rsp)
movslq %r9d,%rax
mov    %rax,0x120(%rsp)
mov    %ebx,%eax
mov    %rax,0x148(%rsp)
mov    %rbx,%rax
shl    $0x20,%rax
mov    %rax,0x18(%rsp)
mov    %rbx,%rax
imul   %rcx,%rax
add    $0x1,%rcx
mov    0x68(%rsp),%r10
lea    (%r10,%rax,8),%rax
add    $0x8,%rax
mov    %rax,0xf8(%rsp)
mov    %rcx,0x88(%rsp)
mov    %rcx,%rax
imul   %rbx,%rax
lea    (%r10,%rax,8),%rax
add    $0x8,%rax
mov    %rax,0xf0(%rsp)
mov    %rbx,%rax
shl    $0x4,%rax
add    %r10,%rax
add    $0x8,%rax
mov    %rax,0xd0(%rsp)
lea    (%rbx,%rbx,1),%eax
add    $0xfffffffe,%eax
shl    $0x20,%rax
add    %r8,%rax
mov    %rax,0xc8(%rsp)
mov    %rdi,0x128(%rsp)
neg    %rdi
mov    %rdi,0x118(%rsp)
lea    0x0(,%rbx,8),%r14
lea    0x8(%rdx),%rax
mov    %rax,0xe8(%rsp)
lea    0x8(%rbp),%rax
mov    %rax,0xe0(%rsp)
mov    0x8(%rsp),%rax
lea    0x8(%rax),%rcx
mov    %rcx,0xd8(%rsp)
lea    -0x1(%r9),%rcx
mov    %rcx,0x130(%rsp)
lea    0x0(%rbp,%rbx,8),%rcx
mov    %rcx,0x80(%rsp)
lea    (%rax,%rbx,8),%rcx
mov    %rcx,0x78(%rsp)
lea    0x8(%r10),%rcx
mov    %rcx,0xc0(%rsp)
lea    0x8(%rbp,%rbx,8),%rcx
mov    %rcx,0xb8(%rsp)
lea    0x8(%r10,%rbx,8),%rcx
mov    %rcx,0xb0(%rsp)
lea    0x8(%rax,%rbx,8),%rax
mov    %rax,0xa8(%rsp)
mov    %r9,0x98(%rsp)
lea    -0x8(,%r9,8),%rax
ff
mov    %rax,0x110(%rsp)
mov    %rbx,0x90(%rsp)
lea    (%rdx,%rbx,8),%rax
mov    %rax,0xa0(%rsp)
mov    $0x1,%eax
mov    %rax,0x30(%rsp)
mov    %rbp,0x58(%rsp)
mov    %rdx,0x50(%rsp)
mov    %rsi,(%rsp)
movsd  %xmm8,0x108(%rsp)
movsd  %xmm4,0x100(%rsp)
movapd %xmm9,0x1a0(%rsp)
movapd %xmm3,0x190(%rsp)
movapd %xmm7,0x180(%rsp)
movapd %xmm6,0x170(%rsp)
movapd %xmm5,0x160(%rsp)
movapd %xmm10,0x150(%rsp)
jmp    1473 <psg_kernel_adi+0x323>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
call   1030 <fclose@plt>
mov    0x30(%rsp),%rcx
lea    0x1(%rcx),%eax
cmp    0x14(%rsp),%ecx
mov    %rax,0x30(%rsp)
mov    0x58(%rsp),%rbp
mov    (%rsp),%rsi
movsd  0x108(%rsp),%xmm8
movsd  0x100(%rsp),%xmm4
movapd 0x1a0(%rsp),%xmm9
movapd 0x190(%rsp),%xmm3
movapd 0x180(%rsp),%xmm7
movapd 0x170(%rsp),%xmm6
movapd 0x160(%rsp),%xmm5
movapd 0x150(%rsp),%xmm10
je     1989 <psg_kernel_adi+0x839>
cmp    $0x3,%esi
jl     18f0 <psg_kernel_adi+0x7a0>
mov    $0x1,%r8d
mov    0x78(%rsp),%rcx
mov    0x80(%rsp),%rdx
mov    0xf0(%rsp),%rsi
mov    0xf8(%rsp),%rdi
mov    0xd8(%rsp),%rbx
mov    0xe0(%rsp),%r9
mov    0xe8(%rsp),%r11
mov    (%rsp),%rax
mov    %eax,%r10d
mov    0x18(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rdx,0x38(%rsp)
mov    %rcx,0x40(%rsp)
mov    0x68(%rsp),%rcx
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rcx,%r8,8)
mov    %r8,%rax
imul   0x90(%rsp),%rax
movq   $0x0,0x0(%rbp,%rax,8)
mov    %r8,0x48(%rsp)
movsd  (%rcx,%r8,8),%xmm0
mov    0x8(%rsp),%r13
movsd  %xmm0,0x0(%r13,%rax,8)
mov    %rbp,%r8
mov    0x130(%rsp),%rbp
mov    %rbx,0x28(%rsp)
mov    %rbx,%rax
mov    %r9,0x20(%rsp)
mov    %r11,0x60(%rsp)
mov    %r10d,0x74(%rsp)
mov    %r15,0x140(%rsp)
mov    0x50(%rsp),%r12
mov    (%rsp),%rdx
nopl   0x0(%rax)
mov    %r15,%rbx
sar    $0x1d,%rbx
movsd  (%r8,%rbx,1),%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
movapd %xmm6,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r9,%r14,1)
movslq %r10d,%r10
movsd  (%r11,%r14,1),%xmm1
mulsd  %xmm5,%xmm1
add    %r14,%r11
movsd  (%r12,%r10,8),%xmm2
mulsd  %xmm7,%xmm2
addsd  %xmm1,%xmm2
lea    0x2(%r10),%ecx
movslq %ecx,%rcx
movsd  (%r12,%rcx,8),%xmm1
mulsd  %xmm7,%xmm1
addsd  %xmm2,%xmm1
movsd  0x0(%r13,%rbx,1),%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%rax,%r14,1)
movabs $0x100000000,%rcx
add    %rcx,%r15
add    %edx,%r10d
add    $0x8,%r9
add    $0x8,%rax
add    $0xffffffffffffffff,%rbp
jne    1550 <psg_kernel_adi+0x400>
mov    0x138(%rsp),%rax
mov    0x48(%rsp),%r8
add    %r8,%rax
mov    0x68(%rsp),%rcx
movabs $0x3ff0000000000000,%rdx
mov    %rdx,(%rcx,%rax,8)
xor    %eax,%eax
mov    0x88(%rsp),%rbp
mov    0x40(%rsp),%rcx
mov    0x38(%rsp),%rdx
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%rdx,%rbp,8),%xmm0
mulsd  (%rsi,%rax,1),%xmm0
addsd  -0x8(%rcx,%rbp,8),%xmm0
movsd  %xmm0,(%rdi,%rax,1)
add    $0xffffffffffffffff,%rbp
sub    %r14,%rax
cmp    $0x1,%rbp
jg     1620 <psg_kernel_adi+0x4d0>
add    $0x1,%r8
mov    0x140(%rsp),%r15
add    0x18(%rsp),%r15
mov    0x74(%rsp),%r10d
add    $0x1,%r10d
mov    0x60(%rsp),%r11
add    $0x8,%r11
mov    0x20(%rsp),%r9
add    %r14,%r9
mov    0x28(%rsp),%rbx
add    %r14,%rbx
add    $0x8,%rdi
add    $0x8,%rsi
add    %r14,%rdx
add    %r14,%rcx
cmp    0x98(%rsp),%r8
mov    0x58(%rsp),%rbp
jne    14d0 <psg_kernel_adi+0x380>
cmpl   $0x3,(%rsp)
mov    0x50(%rsp),%rax
jl     18f0 <psg_kernel_adi+0x7a0>
mov    $0x1,%ebx
mov    0xa0(%rsp),%rcx
mov    %rcx,0x48(%rsp)
mov    0x78(%rsp),%rcx
mov    %rcx,0x40(%rsp)
mov    0x80(%rsp),%rcx
mov    %rcx,0x38(%rsp)
mov    0xc8(%rsp),%rcx
mov    %rcx,0x20(%rsp)
mov    0xa8(%rsp),%r9
mov    0xb0(%rsp),%r12
mov    0xb8(%rsp),%r11
mov    0xc0(%rsp),%r8
mov    0xd0(%rsp),%r13
mov    0x18(%rsp),%r15
jmp    1757 <psg_kernel_adi+0x607>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    0x18(%rsp),%rcx
mov    0x60(%rsp),%r15
add    %rcx,%r15
add    %r14,%r13
add    %r14,%r8
add    %r14,%r11
add    %r14,%r12
add    %r14,%r9
add    %rcx,0x20(%rsp)
add    %r14,0x38(%rsp)
add    %r14,0x40(%rsp)
add    %r14,0x48(%rsp)
cmp    0x98(%rsp),%rbx
mov    0x58(%rsp),%rbp
je     18f0 <psg_kernel_adi+0x7a0>
mov    %rbx,0x28(%rsp)
mov    %rbx,%r10
imul   0x90(%rsp),%r10
movabs $0x3ff0000000000000,%rcx
mov    %rcx,(%rax,%r10,8)
movq   $0x0,0x0(%rbp,%r10,8)
movsd  (%rax,%r10,8),%xmm0
mov    0x8(%rsp),%rsi
movsd  %xmm0,(%rsi,%r10,8)
xor    %ebx,%ebx
mov    %r15,0x60(%rsp)
movabs $0x100000000,%rax
mov    0x110(%rsp),%rcx
nopl   0x0(%rax)
mov    %r15,%rdi
sar    $0x1d,%rdi
movsd  0x0(%rbp,%rdi,1),%xmm0
mulsd  %xmm9,%xmm0
addsd  %xmm8,%xmm0
movapd %xmm7,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r11,%rbx,1)
movsd  (%r12,%rbx,1),%xmm1
mulsd  %xmm10,%xmm1
movsd  (%r8,%rbx,1),%xmm2
mulsd  %xmm6,%xmm2
addsd  %xmm1,%xmm2
movsd  0x0(%r13,%rbx,1),%xmm1
mulsd  %xmm6,%xmm1
addsd  %xmm2,%xmm1
movsd  (%rsi,%rdi,1),%xmm2
mulsd  %xmm7,%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,(%r9,%rbx,1)
add    %rax,%r15
add    $0x8,%rbx
cmp    %rbx,%rcx
jne    17b0 <psg_kernel_adi+0x660>
mov    0x120(%rsp),%rax
lea    (%r10,%rax,1),%rdi
mov    0x50(%rsp),%rax
movabs $0x3ff0000000000000,%rcx
mov    %rcx,(%rax,%rdi,8)
mov    0x128(%rsp),%rdx
add    %rdx,%r10
mov    0x88(%rsp),%rbp
mov    0x20(%rsp),%rsi
mov    0x70(%rsp),%ecx
mov    0x118(%rsp),%r15
mov    0x28(%rsp),%rbx
jmp    18b8 <psg_kernel_adi+0x768>
nopw   0x0(%rax,%rax,1)
mov    0x38(%rsp),%rdi
movsd  -0x8(%rdi,%rbp,8),%xmm0
mov    %rsi,%rdi
sar    $0x1d,%rdi
mulsd  (%rax,%rdi,1),%xmm0
mov    0x40(%rsp),%rdi
addsd  -0x8(%rdi,%rbp,8),%xmm0
mov    0x48(%rsp),%rdi
movsd  %xmm0,-0x8(%rdi,%rbp,8)
movabs $0xffffffff00000000,%rdi
ff ff ff
add    %rdi,%rsi
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%rbp
jle    1710 <psg_kernel_adi+0x5c0>
cmp    %ecx,0x30(%rsp)
jne    1870 <psg_kernel_adi+0x720>
cmp    %rdx,%rbx
jne    1870 <psg_kernel_adi+0x720>
lea    (%r15,%rbp,1),%rbx
cmp    $0x1,%rbx
mov    0x28(%rsp),%rbx
jne    1870 <psg_kernel_adi+0x720>
mov    0x8(%rsp),%rdi
movsd  0x80(%rdi,%r10,8),%xmm0
movsd  %xmm0,(%rdi,%r10,8)
jmp    1870 <psg_kernel_adi+0x720>
nopl   0x0(%rax)
lea    0x1b0(%rsp),%rbp
mov    %rbp,%rdi
lea    0x71e(%rip),%rsi
mov    0x30(%rsp),%rdx
call   1070 <sprintf@plt>
mov    %rbp,%rdi
lea    0x70d(%rip),%rsi
call   1060 <strcat@plt>
mov    %rbp,%rdi
lea    0x70d(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbp
cmpl   $0x0,(%rsp)
jle    1400 <psg_kernel_adi+0x2b0>
mov    0x8(%rsp),%r12
xor    %r15d,%r15d
nop
xor    %r13d,%r13d
lea    0x6eb(%rip),%rbx
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%r13,8),%xmm0
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r13d,%ecx
call   1040 <fprintf@plt>
mov    0x148(%rsp),%rax
add    $0x1,%r13
cmp    %r13,%rax
jne    1950 <psg_kernel_adi+0x800>
add    $0x1,%r15
add    %r14,%r12
cmp    %rax,%r15
jne    1940 <psg_kernel_adi+0x7f0>
jmp    1400 <psg_kernel_adi+0x2b0>
add    $0x1d8,%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_q.dat\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [11 x i8] c"%d %d %lf\0A\00"
define void @psg_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 double*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%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 double
%34 = alloca [40 x i8]
%35 = alloca i32
%36 = 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
%37 = load i32, i32* %8
%38 = sitofp i32 %37 to double
%39 = fdiv double 1.000000e+00, %38
store double %39, double* %21
%40 = load i32, i32* %8
%41 = sitofp i32 %40 to double
%42 = fdiv double 1.000000e+00, %41
store double %42, double* %22
%43 = load i32, i32* %7
%44 = sitofp i32 %43 to double
%45 = fdiv double 1.000000e+00, %44
store double %45, double* %23
store double 2.000000e+00, double* %24
store double 1.000000e+00, double* %25
%46 = load double, double* %24
%47 = load double, double* %23
%48 = fmul double %46, %47
%49 = load double, double* %21
%50 = load double, double* %21
%51 = fmul double %49, %50
%52 = fdiv double %48, %51
store double %52, double* %26
%53 = load double, double* %25
%54 = load double, double* %23
%55 = fmul double %53, %54
%56 = load double, double* %22
%57 = load double, double* %22
%58 = fmul double %56, %57
%59 = fdiv double %55, %58
store double %59, double* %27
%60 = load double, double* %26
%61 = fneg double %60
%62 = fdiv double %61, 2.000000e+00
store double %62, double* %28
%63 = load double, double* %26
%64 = fadd double 1.000000e+00, %63
store double %64, double* %29
%65 = load double, double* %28
store double %65, double* %30
%66 = load double, double* %27
%67 = fneg double %66
%68 = fdiv double %67, 2.000000e+00
store double %68, double* %31
%69 = load double, double* %27
%70 = fadd double 1.000000e+00, %69
store double %70, double* %32
%71 = load double, double* %31
store double %71, double* %33
store i32 1, i32* %18
br label %72
72: ; preds = %544, %6
%73 = load i32, i32* %18
%74 = load i32, i32* %7
%75 = icmp sle i32 %73, %74
br i1 %75, label %76, label %547
76: ; preds = %72
store i32 1, i32* %19
br label %77
77: ; preds = %267, %76
%78 = load i32, i32* %19
%79 = load i32, i32* %8
%80 = sub nsw i32 %79, 1
%81 = icmp slt i32 %78, %80
br i1 %81, label %82, label %270
82: ; preds = %77
%83 = load double*, double** %10
%84 = load i32, i32* %19
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %83, i64 %85
store double 1.000000e+00, double* %86
%87 = load double*, double** %11
%88 = load i32, i32* %19
%89 = load i32, i32* %8
%90 = mul nsw i32 %88, %89
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %87, i64 %91
store double 0.000000e+00, double* %92
%93 = load double*, double** %10
%94 = load i32, i32* %19
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds double, double* %93, i64 %95
%97 = load double, double* %96
%98 = load double*, double** %12
%99 = load i32, i32* %19
%100 = load i32, i32* %8
%101 = mul nsw i32 %99, %100
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds double, double* %98, i64 %102
store double %97, double* %103
store i32 1, i32* %20
br label %104
104: ; preds = %207, %82
%105 = load i32, i32* %20
%106 = load i32, i32* %8
%107 = sub nsw i32 %106, 1
%108 = icmp slt i32 %105, %107
br i1 %108, label %109, label %210
109: ; preds = %104
%110 = load double, double* %30
%111 = fneg double %110
%112 = load double, double* %28
%113 = load double*, double** %11
%114 = load i32, i32* %19
%115 = load i32, i32* %8
%116 = mul nsw i32 %114, %115
%117 = load i32, i32* %20
%118 = sub nsw i32 %117, 1
%119 = add nsw i32 %116, %118
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds double, double* %113, i64 %120
%122 = load double, double* %121
%123 = load double, double* %29
%124 = call double @llvm.fmuladd.f64(double %112, double %122, double %123)
%125 = fdiv double %111, %124
%126 = load double*, double** %11
%127 = load i32, i32* %19
%128 = load i32, i32* %8
%129 = mul nsw i32 %127, %128
%130 = load i32, i32* %20
%131 = add nsw i32 %129, %130
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds double, double* %126, i64 %132
store double %125, double* %133
%134 = load double, double* %31
%135 = fneg double %134
%136 = load double*, double** %9
%137 = load i32, i32* %20
%138 = load i32, i32* %8
%139 = mul nsw i32 %137, %138
%140 = load i32, i32* %19
%141 = sub nsw i32 %140, 1
%142 = add nsw i32 %139, %141
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %136, i64 %143
%145 = load double, double* %144
%146 = load double, double* %31
%147 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %146, double 1.000000e+00)
%148 = load double*, double** %9
%149 = load i32, i32* %20
%150 = load i32, i32* %8
%151 = mul nsw i32 %149, %150
%152 = load i32, i32* %19
%153 = add nsw i32 %151, %152
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds double, double* %148, i64 %154
%156 = load double, double* %155
%157 = fmul double %147, %156
%158 = call double @llvm.fmuladd.f64(double %135, double %145, double %157)
%159 = load double, double* %33
%160 = load double*, double** %9
%161 = load i32, i32* %20
%162 = load i32, i32* %8
%163 = mul nsw i32 %161, %162
%164 = load i32, i32* %19
%165 = add nsw i32 %164, 1
%166 = add nsw i32 %163, %165
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds double, double* %160, i64 %167
%169 = load double, double* %168
%170 = fneg double %159
%171 = call double @llvm.fmuladd.f64(double %170, double %169, double %158)
%172 = load double, double* %28
%173 = load double*, double** %12
%174 = load i32, i32* %19
%175 = load i32, i32* %8
%176 = mul nsw i32 %174, %175
%177 = load i32, i32* %20
%178 = sub nsw i32 %177, 1
%179 = add nsw i32 %176, %178
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds double, double* %173, i64 %180
%182 = load double, double* %181
%183 = fneg double %172
%184 = call double @llvm.fmuladd.f64(double %183, double %182, double %171)
%185 = load double, double* %28
%186 = load double*, double** %11
%187 = load i32, i32* %19
%188 = load i32, i32* %8
%189 = mul nsw i32 %187, %188
%190 = load i32, i32* %20
%191 = sub nsw i32 %190, 1
%192 = add nsw i32 %189, %191
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds double, double* %186, i64 %193
%195 = load double, double* %194
%196 = load double, double* %29
%197 = call double @llvm.fmuladd.f64(double %185, double %195, double %196)
%198 = fdiv double %184, %197
%199 = load double*, double** %12
%200 = load i32, i32* %19
%201 = load i32, i32* %8
%202 = mul nsw i32 %200, %201
%203 = load i32, i32* %20
%204 = add nsw i32 %202, %203
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds double, double* %199, i64 %205
store double %198, double* %206
br label %207
207: ; preds = %109
%208 = load i32, i32* %20
%209 = add nsw i32 %208, 1
store i32 %209, i32* %20
br label %104
210: ; preds = %104
%211 = load double*, double** %10
%212 = load i32, i32* %8
%213 = load i32, i32* %8
%214 = sub nsw i32 %213, 1
%215 = mul nsw i32 %212, %214
%216 = load i32, i32* %19
%217 = add nsw i32 %215, %216
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds double, double* %211, i64 %218
store double 1.000000e+00, double* %219
%220 = load i32, i32* %8
%221 = sub nsw i32 %220, 2
store i32 %221, i32* %20
br label %222
222: ; preds = %263, %210
%223 = load i32, i32* %20
%224 = icmp sge i32 %223, 1
br i1 %224, label %225, label %266
225: ; preds = %222
%226 = load double*, double** %11
%227 = load i32, i32* %19
%228 = load i32, i32* %8
%229 = mul nsw i32 %227, %228
%230 = load i32, i32* %20
%231 = add nsw i32 %229, %230
%232 = sext i32 %231 to i64
%233 = getelementptr inbounds double, double* %226, i64 %232
%234 = load double, double* %233
%235 = load double*, double** %10
%236 = load i32, i32* %20
%237 = add nsw i32 %236, 1
%238 = load i32, i32* %8
%239 = mul nsw i32 %237, %238
%240 = load i32, i32* %19
%241 = add nsw i32 %239, %240
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds double, double* %235, i64 %242
%244 = load double, double* %243
%245 = load double*, double** %12
%246 = load i32, i32* %19
%247 = load i32, i32* %8
%248 = mul nsw i32 %246, %247
%249 = load i32, i32* %20
%250 = add nsw i32 %248, %249
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds double, double* %245, i64 %251
%253 = load double, double* %252
%254 = call double @llvm.fmuladd.f64(double %234, double %244, double %253)
%255 = load double*, double** %10
%256 = load i32, i32* %20
%257 = load i32, i32* %8
%258 = mul nsw i32 %256, %257
%259 = load i32, i32* %19
%260 = add nsw i32 %258, %259
%261 = sext i32 %260 to i64
%262 = getelementptr inbounds double, double* %255, i64 %261
store double %254, double* %262
br label %263
263: ; preds = %225
%264 = load i32, i32* %20
%265 = add nsw i32 %264, -1
store i32 %265, i32* %20
br label %222
266: ; preds = %222
br label %267
267: ; preds = %266
%268 = load i32, i32* %19
%269 = add nsw i32 %268, 1
store i32 %269, i32* %19
br label %77
270: ; preds = %77
store i32 1, i32* %19
br label %271
271: ; preds = %500, %270
%272 = load i32, i32* %19
%273 = load i32, i32* %8
%274 = sub nsw i32 %273, 1
%275 = icmp slt i32 %272, %274
br i1 %275, label %276, label %503
276: ; preds = %271
%277 = load double*, double** %9
%278 = load i32, i32* %19
%279 = load i32, i32* %8
%280 = mul nsw i32 %278, %279
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds double, double* %277, i64 %281
store double 1.000000e+00, double* %282
%283 = load double*, double** %11
%284 = load i32, i32* %19
%285 = load i32, i32* %8
%286 = mul nsw i32 %284, %285
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds double, double* %283, i64 %287
store double 0.000000e+00, double* %288
%289 = load double*, double** %9
%290 = load i32, i32* %19
%291 = load i32, i32* %8
%292 = mul nsw i32 %290, %291
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds double, double* %289, i64 %293
%295 = load double, double* %294
%296 = load double*, double** %12
%297 = load i32, i32* %19
%298 = load i32, i32* %8
%299 = mul nsw i32 %297, %298
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds double, double* %296, i64 %300
store double %295, double* %301
store i32 1, i32* %20
br label %302
302: ; preds = %405, %276
%303 = load i32, i32* %20
%304 = load i32, i32* %8
%305 = sub nsw i32 %304, 1
%306 = icmp slt i32 %303, %305
br i1 %306, label %307, label %408
307: ; preds = %302
%308 = load double, double* %33
%309 = fneg double %308
%310 = load double, double* %31
%311 = load double*, double** %11
%312 = load i32, i32* %19
%313 = load i32, i32* %8
%314 = mul nsw i32 %312, %313
%315 = load i32, i32* %20
%316 = sub nsw i32 %315, 1
%317 = add nsw i32 %314, %316
%318 = sext i32 %317 to i64
%319 = getelementptr inbounds double, double* %311, i64 %318
%320 = load double, double* %319
%321 = load double, double* %32
%322 = call double @llvm.fmuladd.f64(double %310, double %320, double %321)
%323 = fdiv double %309, %322
%324 = load double*, double** %11
%325 = load i32, i32* %19
%326 = load i32, i32* %8
%327 = mul nsw i32 %325, %326
%328 = load i32, i32* %20
%329 = add nsw i32 %327, %328
%330 = sext i32 %329 to i64
%331 = getelementptr inbounds double, double* %324, i64 %330
store double %323, double* %331
%332 = load double, double* %28
%333 = fneg double %332
%334 = load double*, double** %10
%335 = load i32, i32* %19
%336 = sub nsw i32 %335, 1
%337 = load i32, i32* %8
%338 = mul nsw i32 %336, %337
%339 = load i32, i32* %20
%340 = add nsw i32 %338, %339
%341 = sext i32 %340 to i64
%342 = getelementptr inbounds double, double* %334, i64 %341
%343 = load double, double* %342
%344 = load double, double* %28
%345 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %344, double 1.000000e+00)
%346 = load double*, double** %10
%347 = load i32, i32* %19
%348 = load i32, i32* %8
%349 = mul nsw i32 %347, %348
%350 = load i32, i32* %20
%351 = add nsw i32 %349, %350
%352 = sext i32 %351 to i64
%353 = getelementptr inbounds double, double* %346, i64 %352
%354 = load double, double* %353
%355 = fmul double %345, %354
%356 = call double @llvm.fmuladd.f64(double %333, double %343, double %355)
%357 = load double, double* %30
%358 = load double*, double** %10
%359 = load i32, i32* %19
%360 = add nsw i32 %359, 1
%361 = load i32, i32* %8
%362 = mul nsw i32 %360, %361
%363 = load i32, i32* %20
%364 = add nsw i32 %362, %363
%365 = sext i32 %364 to i64
%366 = getelementptr inbounds double, double* %358, i64 %365
%367 = load double, double* %366
%368 = fneg double %357
%369 = call double @llvm.fmuladd.f64(double %368, double %367, double %356)
%370 = load double, double* %31
%371 = load double*, double** %12
%372 = load i32, i32* %19
%373 = load i32, i32* %8
%374 = mul nsw i32 %372, %373
%375 = load i32, i32* %20
%376 = sub nsw i32 %375, 1
%377 = add nsw i32 %374, %376
%378 = sext i32 %377 to i64
%379 = getelementptr inbounds double, double* %371, i64 %378
%380 = load double, double* %379
%381 = fneg double %370
%382 = call double @llvm.fmuladd.f64(double %381, double %380, double %369)
%383 = load double, double* %31
%384 = load double*, double** %11
%385 = load i32, i32* %19
%386 = load i32, i32* %8
%387 = mul nsw i32 %385, %386
%388 = load i32, i32* %20
%389 = sub nsw i32 %388, 1
%390 = add nsw i32 %387, %389
%391 = sext i32 %390 to i64
%392 = getelementptr inbounds double, double* %384, i64 %391
%393 = load double, double* %392
%394 = load double, double* %32
%395 = call double @llvm.fmuladd.f64(double %383, double %393, double %394)
%396 = fdiv double %382, %395
%397 = load double*, double** %12
%398 = load i32, i32* %19
%399 = load i32, i32* %8
%400 = mul nsw i32 %398, %399
%401 = load i32, i32* %20
%402 = add nsw i32 %400, %401
%403 = sext i32 %402 to i64
%404 = getelementptr inbounds double, double* %397, i64 %403
store double %396, double* %404
br label %405
405: ; preds = %307
%406 = load i32, i32* %20
%407 = add nsw i32 %406, 1
store i32 %407, i32* %20
br label %302
408: ; preds = %302
%409 = load double*, double** %9
%410 = load i32, i32* %19
%411 = load i32, i32* %8
%412 = mul nsw i32 %410, %411
%413 = load i32, i32* %8
%414 = sub nsw i32 %413, 1
%415 = add nsw i32 %412, %414
%416 = sext i32 %415 to i64
%417 = getelementptr inbounds double, double* %409, i64 %416
store double 1.000000e+00, double* %417
%418 = load i32, i32* %8
%419 = sub nsw i32 %418, 2
store i32 %419, i32* %20
br label %420
420: ; preds = %496, %408
%421 = load i32, i32* %20
%422 = icmp sge i32 %421, 1
br i1 %422, label %423, label %499
423: ; preds = %420
%424 = load i32, i32* %18
%425 = load i32, i32* %7
%426 = sdiv i32 %425, 2
%427 = icmp eq i32 %424, %426
br i1 %427, label %428, label %458
428: ; preds = %423
%429 = load i32, i32* %19
%430 = load i32, i32* %8
%431 = sdiv i32 %430, 2
%432 = icmp eq i32 %429, %431
br i1 %432, label %433, label %458
433: ; preds = %428
%434 = load i32, i32* %20
%435 = load i32, i32* %8
%436 = sdiv i32 %435, 2
%437 = icmp eq i32 %434, %436
br i1 %437, label %438, label %458
438: ; preds = %433
%439 = load double*, double** %12
%440 = getelementptr inbounds double, double* %439, i64 16
store double* %440, double** %13
%441 = load double*, double** %13
%442 = load i32, i32* %19
%443 = load i32, i32* %8
%444 = mul nsw i32 %442, %443
%445 = load i32, i32* %20
%446 = add nsw i32 %444, %445
%447 = sext i32 %446 to i64
%448 = getelementptr inbounds double, double* %441, i64 %447
%449 = load double, double* %448
%450 = load double*, double** %12
%451 = load i32, i32* %19
%452 = load i32, i32* %8
%453 = mul nsw i32 %451, %452
%454 = load i32, i32* %20
%455 = add nsw i32 %453, %454
%456 = sext i32 %455 to i64
%457 = getelementptr inbounds double, double* %450, i64 %456
store double %449, double* %457
br label %458
458: ; preds = %438, %433, %428, %423
%459 = load double*, double** %11
%460 = load i32, i32* %19
%461 = load i32, i32* %8
%462 = mul nsw i32 %460, %461
%463 = load i32, i32* %20
%464 = add nsw i32 %462, %463
%465 = sext i32 %464 to i64
%466 = getelementptr inbounds double, double* %459, i64 %465
%467 = load double, double* %466
%468 = load double*, double** %9
%469 = load i32, i32* %19
%470 = load i32, i32* %8
%471 = mul nsw i32 %469, %470
%472 = load i32, i32* %20
%473 = add nsw i32 %472, 1
%474 = add nsw i32 %471, %473
%475 = sext i32 %474 to i64
%476 = getelementptr inbounds double, double* %468, i64 %475
%477 = load double, double* %476
%478 = load double*, double** %12
%479 = load i32, i32* %19
%480 = load i32, i32* %8
%481 = mul nsw i32 %479, %480
%482 = load i32, i32* %20
%483 = add nsw i32 %481, %482
%484 = sext i32 %483 to i64
%485 = getelementptr inbounds double, double* %478, i64 %484
%486 = load double, double* %485
%487 = call double @llvm.fmuladd.f64(double %467, double %477, double %486)
%488 = load double*, double** %9
%489 = load i32, i32* %19
%490 = load i32, i32* %8
%491 = mul nsw i32 %489, %490
%492 = load i32, i32* %20
%493 = add nsw i32 %491, %492
%494 = sext i32 %493 to i64
%495 = getelementptr inbounds double, double* %488, i64 %494
store double %487, double* %495
br label %496
496: ; preds = %458
%497 = load i32, i32* %20
%498 = add nsw i32 %497, -1
store i32 %498, i32* %20
br label %420
499: ; preds = %420
br label %500
500: ; preds = %499
%501 = load i32, i32* %19
%502 = add nsw i32 %501, 1
store i32 %502, i32* %19
br label %271
503: ; preds = %271
%504 = getelementptr inbounds [40 x i8], [40 x i8]* %34, i64 0, i64 0
%505 = load i32, i32* %18
%506 = call i32 @sprintf(i8* %504, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %505)
%507 = getelementptr inbounds [40 x i8], [40 x i8]* %34, i64 0, i64 0
%508 = call i32 @strcat(i8* %507, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%509 = getelementptr inbounds [40 x i8], [40 x i8]* %34, i64 0, i64 0
%510 = call i32* @fopen(i8* %509, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %510, i32** %17
store i32 0, i32* %35
br label %511
511: ; preds = %538, %503
%512 = load i32, i32* %35
%513 = load i32, i32* %8
%514 = icmp slt i32 %512, %513
br i1 %514, label %515, label %541
515: ; preds = %511
store i32 0, i32* %36
br label %516
516: ; preds = %534, %515
%517 = load i32, i32* %36
%518 = load i32, i32* %8
%519 = icmp slt i32 %517, %518
br i1 %519, label %520, label %537
520: ; preds = %516
%521 = load i32*, i32** %17
%522 = load i32, i32* %35
%523 = load i32, i32* %36
%524 = load double*, double** %12
%525 = load i32, i32* %35
%526 = load i32, i32* %8
%527 = mul nsw i32 %525, %526
%528 = load i32, i32* %36
%529 = add nsw i32 %527, %528
%530 = sext i32 %529 to i64
%531 = getelementptr inbounds double, double* %524, i64 %530
%532 = load double, double* %531
%533 = call i32 @fprintf(i32* %521, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %522, i32 %523, double %532)
br label %534
534: ; preds = %520
%535 = load i32, i32* %36
%536 = add nsw i32 %535, 1
store i32 %536, i32* %36
br label %516
537: ; preds = %516
br label %538
538: ; preds = %537
%539 = load i32, i32* %35
%540 = add nsw i32 %539, 1
store i32 %540, i32* %35
br label %511
541: ; preds = %511
%542 = load i32*, i32** %17
%543 = call i32 @fclose(i32* %542)
br label %544
544: ; preds = %541
%545 = load i32, i32* %18
%546 = add nsw i32 %545, 1
store i32 %546, i32* %18
br label %72
547: ; preds = %72
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"_simData_q.dat\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [11 x i8] c"%d %d %lf\0A\00"
define void @psg_kernel_adi(i32 %0, i32 %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = alloca [40 x i8]
%8 = sitofp i32 %1 to double
%9 = fdiv double 1.000000e+00, %8
%10 = sitofp i32 %0 to double
%11 = fdiv double 1.000000e+00, %10
%12 = fmul double %11, 2.000000e+00
%13 = fmul double %9, %9
%14 = fdiv double %12, %13
%15 = fdiv double %11, %13
%16 = fmul double %14, -5.000000e-01
%17 = fadd double %14, 1.000000e+00
%18 = fmul double %15, -5.000000e-01
%19 = fadd double %15, 1.000000e+00
%20 = icmp slt i32 %0, 1
br i1 %20, label %215, label %21
21: ; preds = %6
%22 = add i32 %1, -1
%23 = icmp sgt i32 %1, 2
%24 = fneg double %16
%25 = fneg double %18
%26 = call double @llvm.fmuladd.f64(double %18, double 2.000000e+00, double 1.000000e+00)
%27 = mul nsw i32 %22, %1
%28 = add i32 %1, -2
%29 = call double @llvm.fmuladd.f64(double %16, double 2.000000e+00, double 1.000000e+00)
%30 = lshr i32 %0, 1
%31 = sdiv i32 %1, 2
%32 = getelementptr inbounds double, double* %5, i64 16
%33 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i64 0, i64 0
%34 = icmp sgt i32 %1, 0
%35 = sext i32 %1 to i64
%36 = sext i32 %28 to i64
%37 = sext i32 %27 to i64
%38 = zext i32 %31 to i64
%39 = sext i32 %22 to i64
%40 = zext i32 %22 to i64
%41 = zext i32 %22 to i64
%42 = zext i32 %1 to i64
br label %43
43: ; preds = %21, %199
%44 = phi i32 [ 1, %21 ], [ %201, %199 ]
br i1 %23, label %48, label %191
45: ; preds = %114
br i1 %23, label %46, label %191
46: ; preds = %45
%47 = icmp eq i32 %44, %30
br label %117
48: ; preds = %43, %114
%49 = phi i64 [ %115, %114 ], [ 1, %43 ]
%50 = getelementptr inbounds double, double* %3, i64 %49
store double 1.000000e+00, double* %50
%51 = mul nsw i64 %49, %35
%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 %16, double %64, double %17)
%66 = fdiv double %24, %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, %35
%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 %26, %78
%80 = call double @llvm.fmuladd.f64(double %25, 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 %25, double %84, double %80)
%86 = getelementptr inbounds double, double* %5, i64 %62
%87 = load double, double* %86
%88 = call double @llvm.fmuladd.f64(double %24, 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, %40
br i1 %92, label %93, label %56
93: ; preds = %56
%94 = add nsw i64 %49, %37
%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 [ %36, %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, %35
%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, %35
%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, %40
br i1 %116, label %45, label %48
117: ; preds = %188, %46
%118 = phi i64 [ 1, %46 ], [ %189, %188 ]
%119 = mul nsw i64 %118, %35
%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, %35
%126 = add nuw nsw i64 %118, 1
%127 = mul nsw i64 %126, %35
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 %18, double %135, double %19)
%137 = fdiv double %25, %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 %29, %144
%146 = call double @llvm.fmuladd.f64(double %24, 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 %24, double %149, double %146)
%151 = getelementptr inbounds double, double* %5, i64 %133
%152 = load double, double* %151
%153 = call double @llvm.fmuladd.f64(double %25, 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, %41
br i1 %157, label %158, label %128
158: ; preds = %128
%159 = add nsw i64 %119, %39
%160 = getelementptr inbounds double, double* %2, i64 %159
store double 1.000000e+00, double* %160
%161 = icmp eq i64 %118, %38
%162 = add nsw i64 %119, %38
%163 = getelementptr inbounds double, double* %32, i64 %162
%164 = getelementptr inbounds double, double* %5, i64 %162
br label %165
165: ; preds = %158, %172
%166 = phi i64 [ %36, %158 ], [ %186, %172 ]
br i1 %47, label %167, label %172
167: ; preds = %165
%168 = icmp eq i64 %166, %38
%169 = select i1 %161, i1 %168, i1 false
br i1 %169, label %170, label %172
170: ; preds = %167
%171 = load double, double* %163
store double %171, double* %164
br label %172
172: ; preds = %170, %167, %165
%173 = add nsw i64 %166, %119
%174 = getelementptr inbounds double, double* %4, i64 %173
%175 = load double, double* %174
%176 = add i64 %166, %119
%177 = shl i64 %176, 32
%178 = add i64 %177, 4294967296
%179 = ashr exact i64 %178, 32
%180 = getelementptr inbounds double, double* %2, i64 %179
%181 = load double, double* %180
%182 = getelementptr inbounds double, double* %5, i64 %173
%183 = load double, double* %182
%184 = call double @llvm.fmuladd.f64(double %175, double %181, double %183)
%185 = getelementptr inbounds double, double* %2, i64 %173
store double %184, double* %185
%186 = add nsw i64 %166, -1
%187 = icmp sgt i64 %166, 1
br i1 %187, label %165, label %188
188: ; preds = %172
%189 = add nuw nsw i64 %118, 1
%190 = icmp eq i64 %189, %41
br i1 %190, label %191, label %117
191: ; preds = %188, %43, %45
%192 = call i32 @sprintf(i8* %33, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %44)
%193 = call i32 @strcat(i8* %33, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%194 = call i32* @fopen(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br i1 %34, label %195, label %199
195: ; preds = %191, %203
%196 = phi i64 [ %204, %203 ], [ 0, %191 ]
%197 = mul nsw i64 %196, %35
%198 = trunc i64 %196 to i32
br label %206
199: ; preds = %203, %191
%200 = call i32 @fclose(i32* %194)
%201 = add nuw i32 %44, 1
%202 = icmp eq i32 %44, %0
br i1 %202, label %215, label %43
203: ; preds = %206
%204 = add nuw nsw i64 %196, 1
%205 = icmp eq i64 %204, %42
br i1 %205, label %199, label %195
206: ; preds = %195, %206
%207 = phi i64 [ 0, %195 ], [ %213, %206 ]
%208 = add nsw i64 %207, %197
%209 = getelementptr inbounds double, double* %5, i64 %208
%210 = load double, double* %209
%211 = trunc i64 %207 to i32
%212 = call i32 @fprintf(i32* %194, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %198, i32 %211, double %210)
%213 = add nuw nsw i64 %207, 1
%214 = icmp eq i64 %213, %42
br i1 %214, label %203, label %206
215: ; preds = %199, %6
ret void
}