#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 EXIT_FAILURE;
double M_PI;
double RAND_MAX;
double cos(double);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(double *, int, int, int /*<<< orphan*/ *);
double log(double);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ rand();
int /*<<< orphan*/ scanf(char *, ...);
double sin(double);
double sqrt(double);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  double ox, oy, oz;
  double dx, dy, dz;
  int nx, ny, nz;
  int flag;
  int numpars;
  int dir;
  char sampout[20];
  FILE *fp;
  int i, j, k;
  double xx, yy, zz;
  double r1, r2, r3, r4;
  printf("Enter name of output file: \n");
  scanf("%s", sampout);
  printf("Grid (0), uniform rand (1), or normal rand (2): \n");
  scanf("%d", &flag);
  if (flag == 0 || flag == 3) {
    printf("Enter origin x, y, z: \n");
    scanf("%lf %lf %lf", &ox, &oy, &oz);
    printf("Enter grid spacing x, y, z: \n");
    scanf("%lf %lf %lf", &dx, &dy, &dz);
    printf("Enter number gridpoints nx, ny, nz: \n");
    scanf("%d %d %d", &nx, &ny, &nz);
    printf("Enter primary direction (0--x, 1--y, 2--z): \n");
    scanf("%d", &dir);
    fp = fopen(sampout, "wb");
    if (!fp) {
      perror("File opening failed");
      return EXIT_FAILURE;
    }
    if (flag == 0) {
      if (dir == 0) {
        for (i = 0; i < nx; i++) {
          for (j = 0; j < ny; j++) {
            for (k = 0; k < nz; k++) {
              xx = ox + i * dx;
              yy = oy + j * dy;
              zz = oz + k * dz;
              fwrite(&xx, sizeof(double), 1, fp);
              fwrite(&yy, sizeof(double), 1, fp);
              fwrite(&zz, sizeof(double), 1, fp);
            }
          }
        }
      } else if (dir == 1) {
        for (j = 0; j < ny; j++) {
          for (k = 0; k < nz; k++) {
            for (i = 0; i < nx; i++) {
              xx = ox + i * dx;
              yy = oy + j * dy;
              zz = oz + k * dz;
              fwrite(&xx, sizeof(double), 1, fp);
              fwrite(&yy, sizeof(double), 1, fp);
              fwrite(&zz, sizeof(double), 1, fp);
            }
          }
        }
      } else if (dir == 2) {
        for (k = 0; k < nz; k++) {
          for (i = 0; i < nx; i++) {
            for (j = 0; j < ny; j++) {
              xx = ox + i * dx;
              yy = oy + j * dy;
              zz = oz + k * dz;
              fwrite(&xx, sizeof(double), 1, fp);
              fwrite(&yy, sizeof(double), 1, fp);
              fwrite(&zz, sizeof(double), 1, fp);
            }
          }
        }
      }
    } else if (flag == 3) {
      zz = oz;
      for (i = 0; i < nx; i++) {
        for (j = 0; j < ny; j++) {
          xx = ox + i * dx;
          yy = oy + j * dy;
          fwrite(&xx, sizeof(double), 1, fp);
          fwrite(&yy, sizeof(double), 1, fp);
          fwrite(&zz, sizeof(double), 1, fp);
        }
      }
      zz = oz + (nz - 1) * dz;
      for (i = 0; i < nx; i++) {
        for (j = 0; j < ny; j++) {
          xx = ox + i * dx;
          yy = oy + j * dy;
          fwrite(&xx, sizeof(double), 1, fp);
          fwrite(&yy, sizeof(double), 1, fp);
          fwrite(&zz, sizeof(double), 1, fp);
        }
      }
      yy = oy;
      for (i = 0; i < nx; i++) {
        for (k = 1; k < nz - 1; k++) {
          xx = ox + i * dx;
          zz = oz + k * dz;
          fwrite(&xx, sizeof(double), 1, fp);
          fwrite(&yy, sizeof(double), 1, fp);
          fwrite(&zz, sizeof(double), 1, fp);
        }
      }
      yy = oy + (ny - 1) * dy;
      for (i = 0; i < nx; i++) {
        for (k = 1; k < nz - 1; k++) {
          xx = ox + i * dx;
          zz = oz + k * dz;
          fwrite(&xx, sizeof(double), 1, fp);
          fwrite(&yy, sizeof(double), 1, fp);
          fwrite(&zz, sizeof(double), 1, fp);
        }
      }
      xx = ox;
      for (j = 1; j < ny - 1; j++) {
        for (k = 1; k < nz - 1; k++) {
          yy = oy + j * dy;
          zz = oz + k * dz;
          fwrite(&xx, sizeof(double), 1, fp);
          fwrite(&yy, sizeof(double), 1, fp);
          fwrite(&zz, sizeof(double), 1, fp);
        }
      }
      xx = ox + (nx - 1) * dx;
      for (j = 1; j < ny - 1; j++) {
        for (k = 1; k < nz - 1; k++) {
          yy = oy + j * dy;
          zz = oz + k * dz;
          fwrite(&xx, sizeof(double), 1, fp);
          fwrite(&yy, sizeof(double), 1, fp);
          fwrite(&zz, sizeof(double), 1, fp);
        }
      }
    }
    fclose(fp);
  } else if (flag == 1 || flag == 2) {
    printf("Enter number of particles: \n");
    scanf("%d", &numpars);
    printf("Enter left limits x, y, z: \n");
    scanf("%lf %lf %lf", &ox, &oy, &oz);
    printf("Enter right limits x, y, z: \n");
    scanf("%lf %lf %lf", &dx, &dy, &dz);
    fp = fopen(sampout, "wb");
    if (!fp) {
      perror("File opening failed");
      return EXIT_FAILURE;
    }
    srand(time(NULL));
    if (flag == 1) {
      for (i = 0; i < numpars; i++) {
        xx = ox + (dx - ox) * ((double)rand()) / RAND_MAX;
        yy = oy + (dy - oy) * ((double)rand()) / RAND_MAX;
        zz = oz + (dz - oz) * ((double)rand()) / RAND_MAX;
        fwrite(&xx, sizeof(double), 1, fp);
        fwrite(&yy, sizeof(double), 1, fp);
        fwrite(&zz, sizeof(double), 1, fp);
      }
    } else if (flag == 1 || flag == 2) {
      for (i = 0; i < numpars; i++) {
        r1 = ((double)rand()) / RAND_MAX;
        r2 = ((double)rand()) / RAND_MAX;
        r3 = ((double)rand()) / RAND_MAX;
        r4 = ((double)rand()) / RAND_MAX;
        xx = sqrt(-2.0 * log(r1)) * cos(2.0 * M_PI * r2);
        yy = sqrt(-2.0 * log(r1)) * sin(2.0 * M_PI * r2);
        zz = sqrt(-2.0 * log(r3)) * cos(2.0 * M_PI * r4);
        xx = sqrt(dx - ox) * xx + (dx + ox) / 2.0;
        yy = sqrt(dy - oy) * yy + (dy + oy) / 2.0;
        xx = sqrt(dz - oz) * zz + (dz + oz) / 2.0;
        fwrite(&xx, sizeof(double), 1, fp);
        fwrite(&yy, sizeof(double), 1, fp);
        fwrite(&zz, sizeof(double), 1, fp);
      }
    }
    fclose(fp);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x1e27(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0x1e34(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0x1e29(%rip),%rdi
call   1040 <printf@plt>
lea    0x1ebd(%rip),%rdi
lea    -0x48(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
cmpl   $0x0,-0x48(%rbp)
je     1232 <main+0x62>
cmpl   $0x3,-0x48(%rbp)
jne    1cba <main+0xaea>
lea    0x1e29(%rip),%rdi
call   1040 <printf@plt>
lea    0x1e35(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0x1e27(%rip),%rdi
call   1040 <printf@plt>
lea    0x1e0f(%rip),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0x1e1f(%rip),%rdi
call   1040 <printf@plt>
lea    0x1e39(%rip),%rdi
lea    -0x3c(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x44(%rbp),%rcx
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0x1e28(%rip),%rdi
call   1040 <printf@plt>
lea    0x1e19(%rip),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    0x1e34(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
jne    12fe <main+0x12e>
lea    0x1e1c(%rip),%rdi
call   10c0 <perror@plt>
mov    0x3cdc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    21f9 <main+0x1029>
cmpl   $0x0,-0x48(%rbp)
jne    16b9 <main+0x4e9>
cmpl   $0x0,-0x50(%rbp)
jne    143e <main+0x26e>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1439 <main+0x269>
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1426 <main+0x256>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    1413 <main+0x243>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x7c(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x80(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x84(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1342 <main+0x172>
jmp    1418 <main+0x248>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    132c <main+0x15c>
jmp    142b <main+0x25b>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1319 <main+0x149>
jmp    16b4 <main+0x4e4>
cmpl   $0x1,-0x50(%rbp)
jne    1574 <main+0x3a4>
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    156f <main+0x39f>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    155c <main+0x38c>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1543 <main+0x373>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x7c(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x80(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x84(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    147b <main+0x2ab>
jmp    1548 <main+0x378>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1465 <main+0x295>
jmp    1561 <main+0x391>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    144f <main+0x27f>
jmp    16af <main+0x4df>
cmpl   $0x2,-0x50(%rbp)
jne    16aa <main+0x4da>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    16a5 <main+0x4d5>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    168c <main+0x4bc>
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1679 <main+0x4a9>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x7c(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x80(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x84(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    15b1 <main+0x3e1>
jmp    167e <main+0x4ae>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    159e <main+0x3ce>
jmp    1691 <main+0x4c1>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1588 <main+0x3b8>
jmp    16aa <main+0x4da>
jmp    16af <main+0x4df>
jmp    16b4 <main+0x4e4>
jmp    1cac <main+0xadc>
cmpl   $0x3,-0x48(%rbp)
jne    1ca7 <main+0xad7>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    17a3 <main+0x5d3>
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1790 <main+0x5c0>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x7c(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x80(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    16ea <main+0x51a>
jmp    1795 <main+0x5c5>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    16d7 <main+0x507>
movsd  -0x20(%rbp),%xmm1
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    189a <main+0x6ca>
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1887 <main+0x6b7>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x7c(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x80(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    17e1 <main+0x611>
jmp    188c <main+0x6bc>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    17ce <main+0x5fe>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    198e <main+0x7be>
movl   $0x1,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    197b <main+0x7ab>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x7c(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x84(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    18c4 <main+0x6f4>
jmp    1980 <main+0x7b0>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    18ae <main+0x6de>
movsd  -0x18(%rbp),%xmm1
mov    -0x40(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1a99 <main+0x8c9>
movl   $0x1,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1a86 <main+0x8b6>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x7c(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x84(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    19cf <main+0x7ff>
jmp    1a8b <main+0x8bb>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    19b9 <main+0x7e9>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x1,-0x80(%rbp)
mov    -0x80(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1b92 <main+0x9c2>
movl   $0x1,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1b7f <main+0x9af>
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x80(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x84(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1ac8 <main+0x8f8>
jmp    1b84 <main+0x9b4>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    1aad <main+0x8dd>
movsd  -0x10(%rbp),%xmm1
mov    -0x3c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movl   $0x1,-0x80(%rbp)
mov    -0x80(%rbp),%eax
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1ca2 <main+0xad2>
movl   $0x1,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    -0x44(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1c8f <main+0xabf>
movsd  -0x18(%rbp),%xmm1
cvtsi2sdl -0x80(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x84(%rbp),%xmm0
ff
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1bd8 <main+0xa08>
jmp    1c94 <main+0xac4>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    1bbd <main+0x9ed>
jmp    1ca7 <main+0xad7>
jmp    1cac <main+0xadc>
mov    -0x78(%rbp),%rdi
call   1030 <fclose@plt>
jmp    21f2 <main+0x1022>
cmpl   $0x1,-0x48(%rbp)
je     1cce <main+0xafe>
cmpl   $0x2,-0x48(%rbp)
jne    21ed <main+0x101d>
lea    0x1443(%rip),%rdi
call   1040 <printf@plt>
lea    0x13ef(%rip),%rdi
lea    -0x4c(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0x1442(%rip),%rdi
call   1040 <printf@plt>
lea    0x137b(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0x1439(%rip),%rdi
call   1040 <printf@plt>
lea    0x1355(%rip),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
mov    $0x0,%al
call   1080 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    0x13be(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x78(%rbp)
cmpq   $0x0,-0x78(%rbp)
jne    1d74 <main+0xba4>
lea    0x13a6(%rip),%rdi
call   10c0 <perror@plt>
mov    0x3266(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    21f9 <main+0x1029>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
cmpl   $0x1,-0x48(%rbp)
jne    1f04 <main+0xd34>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    1eff <main+0xd2f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
mov    $0x0,%al
call   10f0 <rand@plt>
movsd  -0xf0(%rbp),%xmm1
ff
movsd  -0xe8(%rbp),%xmm0
ff
cvtsi2sd %rax,%xmm2
mulsd  %xmm2,%xmm1
mov    0x31f9(%rip),%rax
divsd  (%rax),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
mov    $0x0,%al
call   10f0 <rand@plt>
movsd  -0xe0(%rbp),%xmm1
ff
movsd  -0xd8(%rbp),%xmm0
ff
cvtsi2sd %rax,%xmm2
mulsd  %xmm2,%xmm1
mov    0x31a3(%rip),%rax
divsd  (%rax),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
mov    $0x0,%al
call   10f0 <rand@plt>
movsd  -0xd0(%rbp),%xmm1
ff
movsd  -0xc8(%rbp),%xmm0
ff
cvtsi2sd %rax,%xmm2
mulsd  %xmm2,%xmm1
mov    0x314d(%rip),%rax
divsd  (%rax),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1d95 <main+0xbc5>
jmp    21e4 <main+0x1014>
cmpl   $0x1,-0x48(%rbp)
je     1f18 <main+0xd48>
cmpl   $0x2,-0x48(%rbp)
jne    21df <main+0x100f>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x4c(%rbp),%eax
jge    21da <main+0x100a>
mov    $0x0,%al
call   10f0 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x30a2(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    $0x0,%al
call   10f0 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x3083(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    $0x0,%al
call   10f0 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x3064(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    $0x0,%al
call   10f0 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x3045(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
call   10a0 <log@plt>
movaps %xmm0,%xmm1
movsd  0x1049(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   10d0 <sqrt@plt>
movsd  %xmm0,-0x108(%rbp)
ff
movsd  0x1028(%rip),%xmm0
mov    0x3009(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
call   1090 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x108(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
movsd  -0xa8(%rbp),%xmm0
call   10a0 <log@plt>
movaps %xmm0,%xmm1
movsd  0xfe9(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   10d0 <sqrt@plt>
movsd  %xmm0,-0x100(%rbp)
ff
movsd  0xfc8(%rip),%xmm0
mov    0x2fa9(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
call   1060 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
call   10a0 <log@plt>
movaps %xmm0,%xmm1
movsd  0xf89(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   10d0 <sqrt@plt>
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  0xf68(%rip),%xmm0
mov    0x2f49(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0xc0(%rbp),%xmm0
ff
call   1090 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0xf8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   10d0 <sqrt@plt>
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x28(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xf10(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   10d0 <sqrt@plt>
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x30(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xed3(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
call   10d0 <sqrt@plt>
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x38(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
movsd  0xe96(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x78(%rbp),%rcx
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0x98(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x78(%rbp),%rcx
lea    -0xa0(%rbp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10e0 <fwrite@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1f1f <main+0xd4f>
jmp    21df <main+0x100f>
jmp    21e4 <main+0x1014>
mov    -0x78(%rbp),%rdi
call   1030 <fclose@plt>
jmp    21f2 <main+0x1022>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
lea    0x1e5f(%rip),%rdi
call   1030 <puts@plt>
lea    0x1e24(%rip),%rdi
lea    0x80(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0x1e59(%rip),%rdi
call   1030 <puts@plt>
lea    0x1e17(%rip),%rdi
lea    0x70(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x70(%rsp),%ecx
cmp    $0x3,%ecx
je     1233 <main+0x63>
test   %ecx,%ecx
jne    1447 <main+0x277>
lea    0x1eaf(%rip),%rdi
call   1030 <puts@plt>
lea    0x1dd5(%rip),%rbx
lea    0x58(%rsp),%rsi
lea    0x38(%rsp),%rdx
lea    0x40(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0x1e9a(%rip),%rdi
call   1030 <puts@plt>
lea    0x60(%rsp),%rsi
lea    0x50(%rsp),%rdx
lea    0x48(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0x1e92(%rip),%rdi
call   1030 <puts@plt>
lea    0x1d90(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0x1e8e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1d6d(%rip),%rdi
lea    0x74(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0x1d5d(%rip),%rsi
lea    0x80(%rsp),%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     2101 <main+0xf31>
mov    %rax,%rbx
mov    0x70(%rsp),%eax
cmp    $0x3,%eax
je     17ac <main+0x5dc>
test   %eax,%eax
jne    20e5 <main+0xf15>
mov    0x74(%rsp),%eax
test   %eax,%eax
je     1d67 <main+0xb97>
cmp    $0x1,%eax
je     1e87 <main+0xcb7>
cmp    $0x2,%eax
jne    20e5 <main+0xf15>
mov    0x10(%rsp),%ecx
test   %ecx,%ecx
jle    20e5 <main+0xf15>
xor    %edx,%edx
mov    0x4(%rsp),%eax
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    1363 <main+0x193>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x10(%rsp),%ecx
mov    0x68(%rsp),%edx
add    $0x1,%edx
cmp    %ecx,%edx
jge    20e5 <main+0xf15>
test   %eax,%eax
jle    1358 <main+0x188>
mov    %edx,0x68(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
xor    %ebp,%ebp
mov    0x14(%rsp),%ecx
movsd  %xmm1,0x30(%rsp)
jmp    1387 <main+0x1b7>
add    $0x1,%ebp
cmp    %eax,%ebp
jge    1350 <main+0x180>
test   %ecx,%ecx
jle    1380 <main+0x1b0>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
movsd  0x60(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
mulsd  0x50(%rsp),%xmm0
addsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x48(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
movsd  0x30(%rsp),%xmm1
add    $0x1,%r13d
mov    0x14(%rsp),%ecx
cmp    %ecx,%r13d
jl     13a0 <main+0x1d0>
mov    0x4(%rsp),%eax
jmp    1380 <main+0x1b0>
add    $0xffffffff,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
ja     20ef <main+0xf1f>
lea    0x1c38(%rip),%rdi
call   1030 <puts@plt>
lea    0x1bc5(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0x1c35(%rip),%rdi
call   1030 <puts@plt>
lea    0x1b94(%rip),%rbx
lea    0x58(%rsp),%rsi
lea    0x38(%rsp),%rdx
lea    0x40(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0x1c25(%rip),%rdi
call   1030 <puts@plt>
lea    0x60(%rsp),%rsi
lea    0x50(%rsp),%rdx
lea    0x48(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0x1b64(%rip),%rsi
lea    0x80(%rsp),%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     2101 <main+0xf31>
mov    %rax,%rbx
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    0x70(%rsp),%eax
cmp    $0x1,%eax
je     1fa7 <main+0xdd7>
cmp    $0x2,%eax
jne    20e5 <main+0xf15>
cmpl   $0x0,0x4(%rsp)
jle    20e5 <main+0xf15>
mov    0x3ac5(%rip),%r13
mov    0x3ac6(%rip),%rbp
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
xor    %r14d,%r14d
jmp    15b9 <main+0x3e9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   10d0 <sqrt@plt>
movsd  0x48(%rsp),%xmm1
addsd  0x40(%rsp),%xmm1
mulsd  0x1aaf(%rip),%xmm1
mulsd  0x20(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rsp)
lea    0x28(%rsp),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
add    $0x1,%r14d
cmp    0x4(%rsp),%r14d
jge    20e5 <main+0xf15>
xor    %eax,%eax
call   10f0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  0x0(%r13),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   10f0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  0x0(%r13),%xmm0
movsd  %xmm0,0x30(%rsp)
xor    %eax,%eax
call   10f0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  0x0(%r13),%xmm0
movsd  %xmm0,0x68(%rsp)
xor    %eax,%eax
call   10f0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  0x0(%r13),%xmm0
movsd  %xmm0,0x78(%rsp)
movsd  0x8(%rsp),%xmm0
call   10a0 <log@plt>
movsd  0x19c8(%rip),%xmm1
mulsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    164b <main+0x47b>
call   10d0 <sqrt@plt>
movsd  0x0(%rbp),%xmm0
addsd  %xmm0,%xmm0
mulsd  0x30(%rsp),%xmm0
call   1090 <cos@plt>
movsd  0x8(%rsp),%xmm0
call   10a0 <log@plt>
mulsd  0x198e(%rip),%xmm0
ucomisd 0x1996(%rip),%xmm0
jb     1690 <main+0x4c0>
sqrtsd %xmm0,%xmm0
jmp    1695 <main+0x4c5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   10d0 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x30(%rsp),%xmm0
movsd  0x0(%rbp),%xmm1
addsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm0
call   1060 <sin@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x68(%rsp),%xmm0
call   10a0 <log@plt>
mulsd  0x192e(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     16f0 <main+0x520>
sqrtsd %xmm0,%xmm0
jmp    16f5 <main+0x525>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   10d0 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x78(%rsp),%xmm0
movsd  0x0(%rbp),%xmm1
addsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm0
call   1090 <cos@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x60(%rsp),%xmm0
subsd  0x58(%rsp),%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jae    173e <main+0x56e>
call   10d0 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  0x50(%rsp),%xmm0
subsd  0x38(%rsp),%xmm0
ucomisd %xmm2,%xmm0
jb     1760 <main+0x590>
sqrtsd %xmm0,%xmm0
jmp    1769 <main+0x599>
cs nopw 0x0(%rax,%rax,1)
call   10d0 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  0x50(%rsp),%xmm1
addsd  0x38(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm0
mulsd  0x1885(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x48(%rsp),%xmm0
subsd  0x40(%rsp),%xmm0
ucomisd %xmm2,%xmm0
jb     1540 <main+0x370>
sqrtsd %xmm0,%xmm0
jmp    1545 <main+0x375>
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    189a <main+0x6ca>
xor    %r13d,%r13d
mov    0x14(%rsp),%ecx
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    17ed <main+0x61d>
nopl   0x0(%rax)
add    $0x1,%r13d
cmp    %eax,%r13d
jge    1894 <main+0x6c4>
test   %ecx,%ecx
jle    17e0 <main+0x610>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x60(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x50(%rsp),%xmm1
movsd  %xmm0,0x28(%rsp)
addsd  0x38(%rsp),%xmm1
movsd  %xmm1,0x18(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
add    $0x1,%ebp
mov    0x14(%rsp),%ecx
cmp    %ecx,%ebp
jl     1810 <main+0x640>
mov    0x4(%rsp),%eax
jmp    17e0 <main+0x610>
movsd  0x40(%rsp),%xmm0
mov    0x10(%rsp),%ecx
add    $0xffffffff,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
mulsd  0x48(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
test   %eax,%eax
jle    1a77 <main+0x8a7>
xor    %r13d,%r13d
mov    0x14(%rsp),%ecx
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    18ed <main+0x71d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
cmp    %eax,%r13d
jge    1994 <main+0x7c4>
test   %ecx,%ecx
jle    18e0 <main+0x710>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x60(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x50(%rsp),%xmm1
movsd  %xmm0,0x28(%rsp)
addsd  0x38(%rsp),%xmm1
movsd  %xmm1,0x18(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
add    $0x1,%ebp
mov    0x14(%rsp),%ecx
cmp    %ecx,%ebp
jl     1910 <main+0x740>
mov    0x4(%rsp),%eax
jmp    18e0 <main+0x710>
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
test   %eax,%eax
jle    1a7d <main+0x8ad>
xor    %r13d,%r13d
mov    0x10(%rsp),%ecx
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    19cd <main+0x7fd>
add    $0x1,%r13d
cmp    %eax,%r13d
jge    1a77 <main+0x8a7>
cmp    $0x3,%ecx
jl     19c0 <main+0x7f0>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x60(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x48(%rsp),%xmm1
movsd  %xmm0,0x28(%rsp)
addsd  0x40(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
add    $0x1,%ebp
mov    0x10(%rsp),%ecx
lea    -0x1(%rcx),%eax
cmp    %eax,%ebp
jl     19f0 <main+0x820>
mov    0x4(%rsp),%eax
jmp    19c0 <main+0x7f0>
movsd  0x38(%rsp),%xmm0
mov    0x14(%rsp),%ecx
lea    -0x1(%rcx),%edx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
mulsd  0x50(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
test   %eax,%eax
jle    1b7b <main+0x9ab>
xor    %r13d,%r13d
mov    0x10(%rsp),%ecx
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    1acd <main+0x8fd>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
cmp    %eax,%r13d
jge    1b77 <main+0x9a7>
cmp    $0x3,%ecx
jl     1ac0 <main+0x8f0>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x60(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x48(%rsp),%xmm1
movsd  %xmm0,0x28(%rsp)
addsd  0x40(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
add    $0x1,%ebp
mov    0x10(%rsp),%ecx
lea    -0x1(%rcx),%eax
cmp    %eax,%ebp
jl     1af0 <main+0x920>
mov    0x4(%rsp),%eax
jmp    1ac0 <main+0x8f0>
mov    0x14(%rsp),%ecx
movsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
cmp    $0x3,%ecx
jl     1c71 <main+0xaa1>
mov    $0x1,%r13d
mov    0x10(%rsp),%eax
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    1bc0 <main+0x9f0>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
lea    -0x1(%rcx),%edx
cmp    %edx,%r13d
jge    1c67 <main+0xa97>
cmp    $0x3,%eax
jl     1bb0 <main+0x9e0>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
movsd  0x50(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x38(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x48(%rsp),%xmm1
movsd  %xmm0,0x18(%rsp)
addsd  0x40(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
add    $0x1,%ebp
mov    0x10(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    %ecx,%ebp
jl     1be0 <main+0xa10>
mov    0x14(%rsp),%ecx
jmp    1bb0 <main+0x9e0>
movsd  0x58(%rsp),%xmm0
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x60(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
cmp    $0x3,%ecx
jl     20e5 <main+0xf15>
mov    $0x1,%r13d
mov    0x10(%rsp),%eax
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    1cc0 <main+0xaf0>
nop
add    $0x1,%r13d
lea    -0x1(%rcx),%edx
cmp    %edx,%r13d
jge    20e5 <main+0xf15>
cmp    $0x3,%eax
jl     1cb0 <main+0xae0>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
movsd  0x50(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x38(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  0x48(%rsp),%xmm1
movsd  %xmm0,0x18(%rsp)
addsd  0x40(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
add    $0x1,%ebp
mov    0x10(%rsp),%eax
lea    -0x1(%rax),%ecx
cmp    %ecx,%ebp
jl     1ce0 <main+0xb10>
mov    0x14(%rsp),%ecx
jmp    1cb0 <main+0xae0>
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
jle    20e5 <main+0xf15>
xor    %edx,%edx
mov    0x14(%rsp),%eax
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    1da3 <main+0xbd3>
nopw   0x0(%rax,%rax,1)
mov    0x4(%rsp),%ecx
mov    0x68(%rsp),%edx
add    $0x1,%edx
cmp    %ecx,%edx
jge    20e5 <main+0xf15>
test   %eax,%eax
jle    1d98 <main+0xbc8>
mov    %edx,0x68(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
xor    %ebp,%ebp
mov    0x10(%rsp),%ecx
movsd  %xmm1,0x30(%rsp)
jmp    1dc7 <main+0xbf7>
add    $0x1,%ebp
cmp    %eax,%ebp
jge    1d90 <main+0xbc0>
test   %ecx,%ecx
jle    1dc0 <main+0xbf0>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
movsd  0x60(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x50(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x38(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
mulsd  0x48(%rsp),%xmm1
movsd  %xmm0,0x18(%rsp)
addsd  0x40(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
movsd  0x30(%rsp),%xmm1
add    $0x1,%r13d
mov    0x10(%rsp),%ecx
cmp    %ecx,%r13d
jl     1de0 <main+0xc10>
mov    0x14(%rsp),%eax
jmp    1dc0 <main+0xbf0>
mov    0x14(%rsp),%ecx
test   %ecx,%ecx
jle    20e5 <main+0xf15>
xor    %edx,%edx
mov    0x10(%rsp),%eax
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    1ec3 <main+0xcf3>
nopw   0x0(%rax,%rax,1)
mov    0x14(%rsp),%ecx
mov    0x68(%rsp),%edx
add    $0x1,%edx
cmp    %ecx,%edx
jge    20e5 <main+0xf15>
test   %eax,%eax
jle    1eb8 <main+0xce8>
mov    %edx,0x68(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
xor    %ebp,%ebp
mov    0x4(%rsp),%ecx
movsd  %xmm1,0x30(%rsp)
jmp    1ee7 <main+0xd17>
add    $0x1,%ebp
cmp    %eax,%ebp
jge    1eb0 <main+0xce0>
test   %ecx,%ecx
jle    1ee0 <main+0xd10>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
mulsd  0x60(%rsp),%xmm0
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x50(%rsp),%xmm0
mulsd  %xmm1,%xmm0
addsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x48(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
movsd  0x30(%rsp),%xmm1
add    $0x1,%r13d
mov    0x4(%rsp),%ecx
cmp    %ecx,%r13d
jl     1f00 <main+0xd30>
mov    0x10(%rsp),%eax
jmp    1ee0 <main+0xd10>
cmpl   $0x0,0x4(%rsp)
jle    20e5 <main+0xf15>
mov    0x3027(%rip),%r13
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%r15
lea    0x20(%rsp),%r12
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x60(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
xor    %eax,%eax
call   10f0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x30(%rsp),%xmm0
divsd  0x0(%r13),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x50(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
xor    %eax,%eax
call   10f0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x30(%rsp),%xmm0
divsd  0x0(%r13),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x48(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
xor    %eax,%eax
call   10f0 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x30(%rsp),%xmm0
divsd  0x0(%r13),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %r14,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r15,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
mov    %r12,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10e0 <fwrite@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1fd0 <main+0xe00>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xf2b(%rip),%rdi
call   10c0 <perror@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
jmp    20ef <main+0xf1f>

LLVM IR (-O0):
@.str = [29 x i8] c"Enter name of output file: \0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [50 x i8] c"Grid (0), uniform rand (1), or normal rand (2): \0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [24 x i8] c"Enter origin x, y, z: \0A\00"
@.str.5 = [12 x i8] c"%lf %lf %lf\00"
@.str.6 = [30 x i8] c"Enter grid spacing x, y, z: \0A\00"
@.str.7 = [38 x i8] c"Enter number gridpoints nx, ny, nz: \0A\00"
@.str.8 = [9 x i8] c"%d %d %d\00"
@.str.9 = [46 x i8] c"Enter primary direction (0--x, 1--y, 2--z): \0A\00"
@.str.10 = [3 x i8] c"wb\00"
@.str.11 = [20 x i8] c"File opening failed\00"
@EXIT_FAILURE = global i32 0
@.str.12 = [29 x i8] c"Enter number of particles: \0A\00"
@.str.13 = [29 x i8] c"Enter left limits x, y, z: \0A\00"
@.str.14 = [30 x i8] c"Enter right limits x, y, z: \0A\00"
@RAND_MAX = global double 0.000000e+00
@M_PI = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [20 x i8]
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
store i32 0, i32* %1
%26 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%27 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %11)
%31 = load i32, i32* %11
%32 = icmp eq i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %0
%34 = load i32, i32* %11
%35 = icmp eq i32 %34, 3
br i1 %35, label %36, label %453
36: ; preds = %33, %0
%37 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%38 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double* %2, double* %3, double* %4)
%39 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0))
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double* %5, double* %6, double* %7)
%41 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32* %8, i32* %9, i32* %10)
%43 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.9, i64 0, i64 0))
%44 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %13)
%45 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%46 = call i32* @fopen(i8* %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
store i32* %46, i32** %15
%47 = load i32*, i32** %15
%48 = icmp ne i32* %47, null
br i1 %48, label %52, label %49
49: ; preds = %36
%50 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%51 = load i32, i32* @EXIT_FAILURE
store i32 %51, i32* %1
br label %628
52: ; preds = %36
%53 = load i32, i32* %11
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %214
55: ; preds = %52
%56 = load i32, i32* %13
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %107
58: ; preds = %55
store i32 0, i32* %16
br label %59
59: ; preds = %103, %58
%60 = load i32, i32* %16
%61 = load i32, i32* %8
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %106
63: ; preds = %59
store i32 0, i32* %17
br label %64
64: ; preds = %99, %63
%65 = load i32, i32* %17
%66 = load i32, i32* %9
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %102
68: ; preds = %64
store i32 0, i32* %18
br label %69
69: ; preds = %95, %68
%70 = load i32, i32* %18
%71 = load i32, i32* %10
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %98
73: ; preds = %69
%74 = load double, double* %2
%75 = load i32, i32* %16
%76 = sitofp i32 %75 to double
%77 = load double, double* %5
%78 = call double @llvm.fmuladd.f64(double %76, double %77, double %74)
store double %78, double* %19
%79 = load double, double* %3
%80 = load i32, i32* %17
%81 = sitofp i32 %80 to double
%82 = load double, double* %6
%83 = call double @llvm.fmuladd.f64(double %81, double %82, double %79)
store double %83, double* %20
%84 = load double, double* %4
%85 = load i32, i32* %18
%86 = sitofp i32 %85 to double
%87 = load double, double* %7
%88 = call double @llvm.fmuladd.f64(double %86, double %87, double %84)
store double %88, double* %21
%89 = load i32*, i32** %15
%90 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %89)
%91 = load i32*, i32** %15
%92 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %91)
%93 = load i32*, i32** %15
%94 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %93)
br label %95
95: ; preds = %73
%96 = load i32, i32* %18
%97 = add nsw i32 %96, 1
store i32 %97, i32* %18
br label %69
98: ; preds = %69
br label %99
99: ; preds = %98
%100 = load i32, i32* %17
%101 = add nsw i32 %100, 1
store i32 %101, i32* %17
br label %64
102: ; preds = %64
br label %103
103: ; preds = %102
%104 = load i32, i32* %16
%105 = add nsw i32 %104, 1
store i32 %105, i32* %16
br label %59
106: ; preds = %59
br label %213
107: ; preds = %55
%108 = load i32, i32* %13
%109 = icmp eq i32 %108, 1
br i1 %109, label %110, label %159
110: ; preds = %107
store i32 0, i32* %17
br label %111
111: ; preds = %155, %110
%112 = load i32, i32* %17
%113 = load i32, i32* %9
%114 = icmp slt i32 %112, %113
br i1 %114, label %115, label %158
115: ; preds = %111
store i32 0, i32* %18
br label %116
116: ; preds = %151, %115
%117 = load i32, i32* %18
%118 = load i32, i32* %10
%119 = icmp slt i32 %117, %118
br i1 %119, label %120, label %154
120: ; preds = %116
store i32 0, i32* %16
br label %121
121: ; preds = %147, %120
%122 = load i32, i32* %16
%123 = load i32, i32* %8
%124 = icmp slt i32 %122, %123
br i1 %124, label %125, label %150
125: ; preds = %121
%126 = load double, double* %2
%127 = load i32, i32* %16
%128 = sitofp i32 %127 to double
%129 = load double, double* %5
%130 = call double @llvm.fmuladd.f64(double %128, double %129, double %126)
store double %130, double* %19
%131 = load double, double* %3
%132 = load i32, i32* %17
%133 = sitofp i32 %132 to double
%134 = load double, double* %6
%135 = call double @llvm.fmuladd.f64(double %133, double %134, double %131)
store double %135, double* %20
%136 = load double, double* %4
%137 = load i32, i32* %18
%138 = sitofp i32 %137 to double
%139 = load double, double* %7
%140 = call double @llvm.fmuladd.f64(double %138, double %139, double %136)
store double %140, double* %21
%141 = load i32*, i32** %15
%142 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %141)
%143 = load i32*, i32** %15
%144 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %143)
%145 = load i32*, i32** %15
%146 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %145)
br label %147
147: ; preds = %125
%148 = load i32, i32* %16
%149 = add nsw i32 %148, 1
store i32 %149, i32* %16
br label %121
150: ; preds = %121
br label %151
151: ; preds = %150
%152 = load i32, i32* %18
%153 = add nsw i32 %152, 1
store i32 %153, i32* %18
br label %116
154: ; preds = %116
br label %155
155: ; preds = %154
%156 = load i32, i32* %17
%157 = add nsw i32 %156, 1
store i32 %157, i32* %17
br label %111
158: ; preds = %111
br label %212
159: ; preds = %107
%160 = load i32, i32* %13
%161 = icmp eq i32 %160, 2
br i1 %161, label %162, label %211
162: ; preds = %159
store i32 0, i32* %18
br label %163
163: ; preds = %207, %162
%164 = load i32, i32* %18
%165 = load i32, i32* %10
%166 = icmp slt i32 %164, %165
br i1 %166, label %167, label %210
167: ; preds = %163
store i32 0, i32* %16
br label %168
168: ; preds = %203, %167
%169 = load i32, i32* %16
%170 = load i32, i32* %8
%171 = icmp slt i32 %169, %170
br i1 %171, label %172, label %206
172: ; preds = %168
store i32 0, i32* %17
br label %173
173: ; preds = %199, %172
%174 = load i32, i32* %17
%175 = load i32, i32* %9
%176 = icmp slt i32 %174, %175
br i1 %176, label %177, label %202
177: ; preds = %173
%178 = load double, double* %2
%179 = load i32, i32* %16
%180 = sitofp i32 %179 to double
%181 = load double, double* %5
%182 = call double @llvm.fmuladd.f64(double %180, double %181, double %178)
store double %182, double* %19
%183 = load double, double* %3
%184 = load i32, i32* %17
%185 = sitofp i32 %184 to double
%186 = load double, double* %6
%187 = call double @llvm.fmuladd.f64(double %185, double %186, double %183)
store double %187, double* %20
%188 = load double, double* %4
%189 = load i32, i32* %18
%190 = sitofp i32 %189 to double
%191 = load double, double* %7
%192 = call double @llvm.fmuladd.f64(double %190, double %191, double %188)
store double %192, double* %21
%193 = load i32*, i32** %15
%194 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %193)
%195 = load i32*, i32** %15
%196 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %195)
%197 = load i32*, i32** %15
%198 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %197)
br label %199
199: ; preds = %177
%200 = load i32, i32* %17
%201 = add nsw i32 %200, 1
store i32 %201, i32* %17
br label %173
202: ; preds = %173
br label %203
203: ; preds = %202
%204 = load i32, i32* %16
%205 = add nsw i32 %204, 1
store i32 %205, i32* %16
br label %168
206: ; preds = %168
br label %207
207: ; preds = %206
%208 = load i32, i32* %18
%209 = add nsw i32 %208, 1
store i32 %209, i32* %18
br label %163
210: ; preds = %163
br label %211
211: ; preds = %210, %159
br label %212
212: ; preds = %211, %158
br label %213
213: ; preds = %212, %106
br label %450
214: ; preds = %52
%215 = load i32, i32* %11
%216 = icmp eq i32 %215, 3
br i1 %216, label %217, label %449
217: ; preds = %214
%218 = load double, double* %4
store double %218, double* %21
store i32 0, i32* %16
br label %219
219: ; preds = %249, %217
%220 = load i32, i32* %16
%221 = load i32, i32* %8
%222 = icmp slt i32 %220, %221
br i1 %222, label %223, label %252
223: ; preds = %219
store i32 0, i32* %17
br label %224
224: ; preds = %245, %223
%225 = load i32, i32* %17
%226 = load i32, i32* %9
%227 = icmp slt i32 %225, %226
br i1 %227, label %228, label %248
228: ; preds = %224
%229 = load double, double* %2
%230 = load i32, i32* %16
%231 = sitofp i32 %230 to double
%232 = load double, double* %5
%233 = call double @llvm.fmuladd.f64(double %231, double %232, double %229)
store double %233, double* %19
%234 = load double, double* %3
%235 = load i32, i32* %17
%236 = sitofp i32 %235 to double
%237 = load double, double* %6
%238 = call double @llvm.fmuladd.f64(double %236, double %237, double %234)
store double %238, double* %20
%239 = load i32*, i32** %15
%240 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %239)
%241 = load i32*, i32** %15
%242 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %241)
%243 = load i32*, i32** %15
%244 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %243)
br label %245
245: ; preds = %228
%246 = load i32, i32* %17
%247 = add nsw i32 %246, 1
store i32 %247, i32* %17
br label %224
248: ; preds = %224
br label %249
249: ; preds = %248
%250 = load i32, i32* %16
%251 = add nsw i32 %250, 1
store i32 %251, i32* %16
br label %219
252: ; preds = %219
%253 = load double, double* %4
%254 = load i32, i32* %10
%255 = sub nsw i32 %254, 1
%256 = sitofp i32 %255 to double
%257 = load double, double* %7
%258 = call double @llvm.fmuladd.f64(double %256, double %257, double %253)
store double %258, double* %21
store i32 0, i32* %16
br label %259
259: ; preds = %289, %252
%260 = load i32, i32* %16
%261 = load i32, i32* %8
%262 = icmp slt i32 %260, %261
br i1 %262, label %263, label %292
263: ; preds = %259
store i32 0, i32* %17
br label %264
264: ; preds = %285, %263
%265 = load i32, i32* %17
%266 = load i32, i32* %9
%267 = icmp slt i32 %265, %266
br i1 %267, label %268, label %288
268: ; preds = %264
%269 = load double, double* %2
%270 = load i32, i32* %16
%271 = sitofp i32 %270 to double
%272 = load double, double* %5
%273 = call double @llvm.fmuladd.f64(double %271, double %272, double %269)
store double %273, double* %19
%274 = load double, double* %3
%275 = load i32, i32* %17
%276 = sitofp i32 %275 to double
%277 = load double, double* %6
%278 = call double @llvm.fmuladd.f64(double %276, double %277, double %274)
store double %278, double* %20
%279 = load i32*, i32** %15
%280 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %279)
%281 = load i32*, i32** %15
%282 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %281)
%283 = load i32*, i32** %15
%284 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %283)
br label %285
285: ; preds = %268
%286 = load i32, i32* %17
%287 = add nsw i32 %286, 1
store i32 %287, i32* %17
br label %264
288: ; preds = %264
br label %289
289: ; preds = %288
%290 = load i32, i32* %16
%291 = add nsw i32 %290, 1
store i32 %291, i32* %16
br label %259
292: ; preds = %259
%293 = load double, double* %3
store double %293, double* %20
store i32 0, i32* %16
br label %294
294: ; preds = %325, %292
%295 = load i32, i32* %16
%296 = load i32, i32* %8
%297 = icmp slt i32 %295, %296
br i1 %297, label %298, label %328
298: ; preds = %294
store i32 1, i32* %18
br label %299
299: ; preds = %321, %298
%300 = load i32, i32* %18
%301 = load i32, i32* %10
%302 = sub nsw i32 %301, 1
%303 = icmp slt i32 %300, %302
br i1 %303, label %304, label %324
304: ; preds = %299
%305 = load double, double* %2
%306 = load i32, i32* %16
%307 = sitofp i32 %306 to double
%308 = load double, double* %5
%309 = call double @llvm.fmuladd.f64(double %307, double %308, double %305)
store double %309, double* %19
%310 = load double, double* %4
%311 = load i32, i32* %18
%312 = sitofp i32 %311 to double
%313 = load double, double* %7
%314 = call double @llvm.fmuladd.f64(double %312, double %313, double %310)
store double %314, double* %21
%315 = load i32*, i32** %15
%316 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %315)
%317 = load i32*, i32** %15
%318 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %317)
%319 = load i32*, i32** %15
%320 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %319)
br label %321
321: ; preds = %304
%322 = load i32, i32* %18
%323 = add nsw i32 %322, 1
store i32 %323, i32* %18
br label %299
324: ; preds = %299
br label %325
325: ; preds = %324
%326 = load i32, i32* %16
%327 = add nsw i32 %326, 1
store i32 %327, i32* %16
br label %294
328: ; preds = %294
%329 = load double, double* %3
%330 = load i32, i32* %9
%331 = sub nsw i32 %330, 1
%332 = sitofp i32 %331 to double
%333 = load double, double* %6
%334 = call double @llvm.fmuladd.f64(double %332, double %333, double %329)
store double %334, double* %20
store i32 0, i32* %16
br label %335
335: ; preds = %366, %328
%336 = load i32, i32* %16
%337 = load i32, i32* %8
%338 = icmp slt i32 %336, %337
br i1 %338, label %339, label %369
339: ; preds = %335
store i32 1, i32* %18
br label %340
340: ; preds = %362, %339
%341 = load i32, i32* %18
%342 = load i32, i32* %10
%343 = sub nsw i32 %342, 1
%344 = icmp slt i32 %341, %343
br i1 %344, label %345, label %365
345: ; preds = %340
%346 = load double, double* %2
%347 = load i32, i32* %16
%348 = sitofp i32 %347 to double
%349 = load double, double* %5
%350 = call double @llvm.fmuladd.f64(double %348, double %349, double %346)
store double %350, double* %19
%351 = load double, double* %4
%352 = load i32, i32* %18
%353 = sitofp i32 %352 to double
%354 = load double, double* %7
%355 = call double @llvm.fmuladd.f64(double %353, double %354, double %351)
store double %355, double* %21
%356 = load i32*, i32** %15
%357 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %356)
%358 = load i32*, i32** %15
%359 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %358)
%360 = load i32*, i32** %15
%361 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %360)
br label %362
362: ; preds = %345
%363 = load i32, i32* %18
%364 = add nsw i32 %363, 1
store i32 %364, i32* %18
br label %340
365: ; preds = %340
br label %366
366: ; preds = %365
%367 = load i32, i32* %16
%368 = add nsw i32 %367, 1
store i32 %368, i32* %16
br label %335
369: ; preds = %335
%370 = load double, double* %2
store double %370, double* %19
store i32 1, i32* %17
br label %371
371: ; preds = %403, %369
%372 = load i32, i32* %17
%373 = load i32, i32* %9
%374 = sub nsw i32 %373, 1
%375 = icmp slt i32 %372, %374
br i1 %375, label %376, label %406
376: ; preds = %371
store i32 1, i32* %18
br label %377
377: ; preds = %399, %376
%378 = load i32, i32* %18
%379 = load i32, i32* %10
%380 = sub nsw i32 %379, 1
%381 = icmp slt i32 %378, %380
br i1 %381, label %382, label %402
382: ; preds = %377
%383 = load double, double* %3
%384 = load i32, i32* %17
%385 = sitofp i32 %384 to double
%386 = load double, double* %6
%387 = call double @llvm.fmuladd.f64(double %385, double %386, double %383)
store double %387, double* %20
%388 = load double, double* %4
%389 = load i32, i32* %18
%390 = sitofp i32 %389 to double
%391 = load double, double* %7
%392 = call double @llvm.fmuladd.f64(double %390, double %391, double %388)
store double %392, double* %21
%393 = load i32*, i32** %15
%394 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %393)
%395 = load i32*, i32** %15
%396 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %395)
%397 = load i32*, i32** %15
%398 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %397)
br label %399
399: ; preds = %382
%400 = load i32, i32* %18
%401 = add nsw i32 %400, 1
store i32 %401, i32* %18
br label %377
402: ; preds = %377
br label %403
403: ; preds = %402
%404 = load i32, i32* %17
%405 = add nsw i32 %404, 1
store i32 %405, i32* %17
br label %371
406: ; preds = %371
%407 = load double, double* %2
%408 = load i32, i32* %8
%409 = sub nsw i32 %408, 1
%410 = sitofp i32 %409 to double
%411 = load double, double* %5
%412 = call double @llvm.fmuladd.f64(double %410, double %411, double %407)
store double %412, double* %19
store i32 1, i32* %17
br label %413
413: ; preds = %445, %406
%414 = load i32, i32* %17
%415 = load i32, i32* %9
%416 = sub nsw i32 %415, 1
%417 = icmp slt i32 %414, %416
br i1 %417, label %418, label %448
418: ; preds = %413
store i32 1, i32* %18
br label %419
419: ; preds = %441, %418
%420 = load i32, i32* %18
%421 = load i32, i32* %10
%422 = sub nsw i32 %421, 1
%423 = icmp slt i32 %420, %422
br i1 %423, label %424, label %444
424: ; preds = %419
%425 = load double, double* %3
%426 = load i32, i32* %17
%427 = sitofp i32 %426 to double
%428 = load double, double* %6
%429 = call double @llvm.fmuladd.f64(double %427, double %428, double %425)
store double %429, double* %20
%430 = load double, double* %4
%431 = load i32, i32* %18
%432 = sitofp i32 %431 to double
%433 = load double, double* %7
%434 = call double @llvm.fmuladd.f64(double %432, double %433, double %430)
store double %434, double* %21
%435 = load i32*, i32** %15
%436 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %435)
%437 = load i32*, i32** %15
%438 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %437)
%439 = load i32*, i32** %15
%440 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %439)
br label %441
441: ; preds = %424
%442 = load i32, i32* %18
%443 = add nsw i32 %442, 1
store i32 %443, i32* %18
br label %419
444: ; preds = %419
br label %445
445: ; preds = %444
%446 = load i32, i32* %17
%447 = add nsw i32 %446, 1
store i32 %447, i32* %17
br label %413
448: ; preds = %413
br label %449
449: ; preds = %448, %214
br label %450
450: ; preds = %449, %213
%451 = load i32*, i32** %15
%452 = call i32 @fclose(i32* %451)
br label %627
453: ; preds = %33
%454 = load i32, i32* %11
%455 = icmp eq i32 %454, 1
br i1 %455, label %459, label %456
456: ; preds = %453
%457 = load i32, i32* %11
%458 = icmp eq i32 %457, 2
br i1 %458, label %459, label %626
459: ; preds = %456, %453
%460 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0))
%461 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %12)
%462 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
%463 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double* %2, double* %3, double* %4)
%464 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0))
%465 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double* %5, double* %6, double* %7)
%466 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%467 = call i32* @fopen(i8* %466, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
store i32* %467, i32** %15
%468 = load i32*, i32** %15
%469 = icmp ne i32* %468, null
br i1 %469, label %473, label %470
470: ; preds = %459
%471 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%472 = load i32, i32* @EXIT_FAILURE
store i32 %472, i32* %1
br label %628
473: ; preds = %459
%474 = call i32 @time(i32* null)
%475 = call i32 @srand(i32 %474)
%476 = load i32, i32* %11
%477 = icmp eq i32 %476, 1
br i1 %477, label %478, label %524
478: ; preds = %473
store i32 0, i32* %16
br label %479
479: ; preds = %520, %478
%480 = load i32, i32* %16
%481 = load i32, i32* %12
%482 = icmp slt i32 %480, %481
br i1 %482, label %483, label %523
483: ; preds = %479
%484 = load double, double* %2
%485 = load double, double* %5
%486 = load double, double* %2
%487 = fsub double %485, %486
%488 = call i64 (...) @rand()
%489 = sitofp i64 %488 to double
%490 = fmul double %487, %489
%491 = load double, double* @RAND_MAX
%492 = fdiv double %490, %491
%493 = fadd double %484, %492
store double %493, double* %19
%494 = load double, double* %3
%495 = load double, double* %6
%496 = load double, double* %3
%497 = fsub double %495, %496
%498 = call i64 (...) @rand()
%499 = sitofp i64 %498 to double
%500 = fmul double %497, %499
%501 = load double, double* @RAND_MAX
%502 = fdiv double %500, %501
%503 = fadd double %494, %502
store double %503, double* %20
%504 = load double, double* %4
%505 = load double, double* %7
%506 = load double, double* %4
%507 = fsub double %505, %506
%508 = call i64 (...) @rand()
%509 = sitofp i64 %508 to double
%510 = fmul double %507, %509
%511 = load double, double* @RAND_MAX
%512 = fdiv double %510, %511
%513 = fadd double %504, %512
store double %513, double* %21
%514 = load i32*, i32** %15
%515 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %514)
%516 = load i32*, i32** %15
%517 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %516)
%518 = load i32*, i32** %15
%519 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %518)
br label %520
520: ; preds = %483
%521 = load i32, i32* %16
%522 = add nsw i32 %521, 1
store i32 %522, i32* %16
br label %479
523: ; preds = %479
br label %623
524: ; preds = %473
%525 = load i32, i32* %11
%526 = icmp eq i32 %525, 1
br i1 %526, label %530, label %527
527: ; preds = %524
%528 = load i32, i32* %11
%529 = icmp eq i32 %528, 2
br i1 %529, label %530, label %622
530: ; preds = %527, %524
store i32 0, i32* %16
br label %531
531: ; preds = %618, %530
%532 = load i32, i32* %16
%533 = load i32, i32* %12
%534 = icmp slt i32 %532, %533
br i1 %534, label %535, label %621
535: ; preds = %531
%536 = call i64 (...) @rand()
%537 = sitofp i64 %536 to double
%538 = load double, double* @RAND_MAX
%539 = fdiv double %537, %538
store double %539, double* %22
%540 = call i64 (...) @rand()
%541 = sitofp i64 %540 to double
%542 = load double, double* @RAND_MAX
%543 = fdiv double %541, %542
store double %543, double* %23
%544 = call i64 (...) @rand()
%545 = sitofp i64 %544 to double
%546 = load double, double* @RAND_MAX
%547 = fdiv double %545, %546
store double %547, double* %24
%548 = call i64 (...) @rand()
%549 = sitofp i64 %548 to double
%550 = load double, double* @RAND_MAX
%551 = fdiv double %549, %550
store double %551, double* %25
%552 = load double, double* %22
%553 = call double @log(double %552)
%554 = fmul double -2.000000e+00, %553
%555 = call double @sqrt(double %554)
%556 = load double, double* @M_PI
%557 = fmul double 2.000000e+00, %556
%558 = load double, double* %23
%559 = fmul double %557, %558
%560 = call double @cos(double %559)
%561 = fmul double %555, %560
store double %561, double* %19
%562 = load double, double* %22
%563 = call double @log(double %562)
%564 = fmul double -2.000000e+00, %563
%565 = call double @sqrt(double %564)
%566 = load double, double* @M_PI
%567 = fmul double 2.000000e+00, %566
%568 = load double, double* %23
%569 = fmul double %567, %568
%570 = call double @sin(double %569)
%571 = fmul double %565, %570
store double %571, double* %20
%572 = load double, double* %24
%573 = call double @log(double %572)
%574 = fmul double -2.000000e+00, %573
%575 = call double @sqrt(double %574)
%576 = load double, double* @M_PI
%577 = fmul double 2.000000e+00, %576
%578 = load double, double* %25
%579 = fmul double %577, %578
%580 = call double @cos(double %579)
%581 = fmul double %575, %580
store double %581, double* %21
%582 = load double, double* %5
%583 = load double, double* %2
%584 = fsub double %582, %583
%585 = call double @sqrt(double %584)
%586 = load double, double* %19
%587 = load double, double* %5
%588 = load double, double* %2
%589 = fadd double %587, %588
%590 = fdiv double %589, 2.000000e+00
%591 = call double @llvm.fmuladd.f64(double %585, double %586, double %590)
store double %591, double* %19
%592 = load double, double* %6
%593 = load double, double* %3
%594 = fsub double %592, %593
%595 = call double @sqrt(double %594)
%596 = load double, double* %20
%597 = load double, double* %6
%598 = load double, double* %3
%599 = fadd double %597, %598
%600 = fdiv double %599, 2.000000e+00
%601 = call double @llvm.fmuladd.f64(double %595, double %596, double %600)
store double %601, double* %20
%602 = load double, double* %7
%603 = load double, double* %4
%604 = fsub double %602, %603
%605 = call double @sqrt(double %604)
%606 = load double, double* %21
%607 = load double, double* %7
%608 = load double, double* %4
%609 = fadd double %607, %608
%610 = fdiv double %609, 2.000000e+00
%611 = call double @llvm.fmuladd.f64(double %605, double %606, double %610)
store double %611, double* %19
%612 = load i32*, i32** %15
%613 = call i32 @fwrite(double* %19, i32 8, i32 1, i32* %612)
%614 = load i32*, i32** %15
%615 = call i32 @fwrite(double* %20, i32 8, i32 1, i32* %614)
%616 = load i32*, i32** %15
%617 = call i32 @fwrite(double* %21, i32 8, i32 1, i32* %616)
br label %618
618: ; preds = %535
%619 = load i32, i32* %16
%620 = add nsw i32 %619, 1
store i32 %620, i32* %16
br label %531
621: ; preds = %531
br label %622
622: ; preds = %621, %527
br label %623
623: ; preds = %622, %523
%624 = load i32*, i32** %15
%625 = call i32 @fclose(i32* %624)
br label %626
626: ; preds = %623, %456
br label %627
627: ; preds = %626, %450
store i32 0, i32* %1
br label %628
628: ; preds = %627, %470, %49
%629 = load i32, i32* %1
ret i32 %629
}

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