#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ arr_diff(double *, double *, size_t);
int /*<<< orphan*/ arr_init_linspace(double *, double, double, size_t);
double arr_mean(double *, size_t);
double arr_median(double *, size_t);
int /*<<< orphan*/ arr_sca_add(double *, double, size_t);
size_t arr_util_getstep(double, double, double);
size_t cmdarg(int, char **, char *, char *, int *, int *, int *, double *,
              double *, double *, int *, int *, int *, int /*<<< orphan*/ *,
              int /*<<< orphan*/ *, int *, int *, int /*<<< orphan*/ *,
              int /*<<< orphan*/ *);
double cos(double);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fouriermax(double *, double *, double *, double *, size_t,
                              size_t, double *, double *, double *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(double *);
double *malloc(size_t);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ readcols(char *, double *, double *, double *, size_t, int,
                            int, int);
double sin(double);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ writecols3(char *, double *, double *, double *, size_t, int,
                              int);
int main(int argc, char *argv[]) {
  size_t N = 0;
  size_t M = 0;
  char inname[100];
  char outname[100];
  char logname[100];
  double low, high, rate;
  int quiet = 0;
  int unit = 1;
  int prep = 1;
  int autosamp = 0;
  int fast = 0;
  int useweight = 0;
  int Nclean = 1;
  int filter = 0;
  N = cmdarg(argc, argv, inname, outname, &quiet, &unit, &prep, &low, &high,
             &rate, &autosamp, &fast, &useweight, NULL, NULL, &Nclean, &filter,
             NULL, NULL);
  if (quiet == 0 || fast == 1) {
    if (useweight != 0)
      printf("\nCLEANing the time series \"%s\" using weights...\n", inname);
    else
      printf("\nCLEANing the time series \"%s\" without weights...\n", inname);
  }
  if (quiet == 0)
    printf(" - Reading input\n");
  double *time = malloc(N * sizeof(double));
  double *flux = malloc(N * sizeof(double));
  double *weight = malloc(N * sizeof(double));
  readcols(inname, time, flux, weight, N, useweight, unit, quiet);
  if (fast == 0) {
    double *dt = malloc(N - 1 * sizeof(double));
    double nyquist;
    arr_diff(time, dt, N);
    nyquist = 1.0 / (2.0 * arr_median(dt, N - 1)) * 1e6;
    free(dt);
    int oversamp;
    if (autosamp != 0) {
      low = 5.0;
      high = nyquist;
      oversamp = 4;
    } else {
      oversamp = (int)rate;
    }
    double minsamp = 1.0e6 / (oversamp * (time[N - 1] - time[0]));
    rate = minsamp;
    if (quiet == 0) {
      printf(" -- INFO: Length of time series = %li\n", N);
      printf(" -- INFO: Nyquist frequency = %.2lf microHz\n", nyquist);
      printf(" -- INFO: Using %i times oversampling = %.3lf microHz\n",
             oversamp, minsamp);
    }
  } else {
    int oversamp = (int)rate;
    double minsamp = 1.0e6 / (oversamp * (time[N - 1] - time[0]));
    rate = minsamp;
  }
  M = arr_util_getstep(low, high, rate);
  double *freq = malloc(M * sizeof(double));
  arr_init_linspace(freq, low, rate, M);
  if (quiet == 0)
    printf(" -- INFO: Number of sampling frequencies = %li\n", M);
  double fmean = 0;
  if (prep != 0) {
    if (quiet == 0)
      printf(" - Subtracting the mean from time series\n");
    fmean = arr_mean(flux, N);
    arr_sca_add(flux, -fmean, N);
  } else {
    if (quiet == 0)
      printf(" - Time series used *without* mean subtraction!\n");
  }
  strcpy(logname, outname);
  strcat(logname, ".cleanlog");
  FILE *logfile = fopen(logname, "w");
  fprintf(logfile, "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
                   "~~~~~~~~~~\n");
  fprintf(logfile, "# Log of CLEAN on \"%s\"\n", inname);
  fprintf(logfile, "# Interval: [%.2lf, %.2lf] microHz\n", low, high);
  fprintf(logfile, "# Finding %i frequencies\n", Nclean);
  fprintf(logfile, "# \n");
  fprintf(logfile, "# %8s %11s %11s %12s %12s\n", "Number", "Frequency",
          "Power", "Alpha", "Beta");
  fprintf(logfile, "# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
                   "~~~~~~~~~~\n");
  double fmax, alpmax, betmax, powmax;
  if (quiet == 0) {
    printf(" - CLEANing %i frequencies in the range %.1lf to %.1lf"
           " microHz\n",
           Nclean, low, high);
    printf("\n %9s %11s %11s\n", "Number", "Frequency", "Power");
  }
  for (int i = 0; i < Nclean; ++i) {
    if (quiet == 0)
      printf(" %6i", i + 1);
    fmax = 0;
    alpmax = 0;
    betmax = 0;
    powmax = 0;
    fouriermax(time, flux, weight, freq, N, M, &fmax, &alpmax, &betmax,
               useweight);
    powmax = alpmax * alpmax + betmax * betmax;
    fprintf(logfile, " %6i %15.6lf %12.6lg %12.6lf %12.6lf\n", i + 1, fmax,
            powmax, alpmax, betmax);
    if (quiet == 0)
      printf(" %15.6lf %12.6lg \n", fmax, powmax);
    for (int j = 0; j < N; ++j) {
      flux[j] =
          flux[j] -
          alpmax * sin(6.28318530717958647692528676655900576839433879875e-6 *
                       fmax * time[j]) -
          betmax * cos(6.28318530717958647692528676655900576839433879875e-6 *
                       fmax * time[j]);
    }
  }
  fclose(logfile);
  if (quiet == 0)
    printf("\n");
  if (quiet == 0)
    printf(" - Saving to file \"%s\"\n", outname);
  if (prep != 0)
    arr_sca_add(flux, fmean, N);
  writecols3(outname, time, flux, weight, N, useweight, unit);
  free(time);
  free(flux);
  free(weight);
  free(freq);
  if (quiet == 0 || fast == 1)
    printf("Done!\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2c8,%rsp
movl   $0x0,-0x2c(%rbp)
mov    %edi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movl   $0x0,-0x1ac(%rbp)
movl   $0x1,-0x1b0(%rbp)
movl   $0x1,-0x1b4(%rbp)
movl   $0x0,-0x1b8(%rbp)
movl   $0x0,-0x1bc(%rbp)
movl   $0x0,-0x1c0(%rbp)
movl   $0x1,-0x1c4(%rbp)
movl   $0x0,-0x1c8(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x38(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
lea    -0x120(%rbp),%rcx
lea    -0x1ac(%rbp),%r8
lea    -0x1b0(%rbp),%r9
lea    -0x1b4(%rbp),%rax
mov    %rax,-0x260(%rbp)
lea    -0x198(%rbp),%r13
lea    -0x1a0(%rbp),%r12
lea    -0x1a8(%rbp),%r15
lea    -0x1b8(%rbp),%r14
lea    -0x1bc(%rbp),%rbx
lea    -0x1c0(%rbp),%r11
xor    %eax,%eax
lea    -0x1c4(%rbp),%r10
lea    -0x1c8(%rbp),%rax
mov    %rax,-0x258(%rbp)
mov    -0x260(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x258(%rbp),%rax
mov    %r13,0x8(%rsp)
mov    %r12,0x10(%rsp)
mov    %r15,0x18(%rsp)
mov    %r14,0x20(%rsp)
mov    %rbx,0x28(%rsp)
mov    %r11,0x30(%rsp)
movq   $0x0,0x38(%rsp)
movq   $0x0,0x40(%rsp)
mov    %r10,0x48(%rsp)
mov    %rax,0x50(%rsp)
movq   $0x0,0x58(%rsp)
movq   $0x0,0x60(%rsp)
call   10d0 <cmdarg@plt>
mov    %rax,-0x40(%rbp)
cmpl   $0x0,-0x1ac(%rbp)
je     13b5 <main+0x175>
cmpl   $0x1,-0x1bc(%rbp)
jne    13f6 <main+0x1b6>
cmpl   $0x0,-0x1c0(%rbp)
je     13dc <main+0x19c>
lea    -0xb0(%rbp),%rsi
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    13f1 <main+0x1b1>
lea    -0xb0(%rbp),%rsi
lea    0xc6f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    13f6 <main+0x1b6>
cmpl   $0x0,-0x1ac(%rbp)
jne    1411 <main+0x1d1>
lea    0xc82(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x40(%rbp),%rdi
shl    $0x3,%rdi
call   10e0 <malloc@plt>
mov    %rax,-0x1d0(%rbp)
mov    -0x40(%rbp),%rdi
shl    $0x3,%rdi
call   10e0 <malloc@plt>
mov    %rax,-0x1d8(%rbp)
mov    -0x40(%rbp),%rdi
shl    $0x3,%rdi
call   10e0 <malloc@plt>
mov    %rax,-0x1e0(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0x1d0(%rbp),%rsi
mov    -0x1d8(%rbp),%rdx
mov    -0x1e0(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x1c0(%rbp),%r9d
mov    -0x1b0(%rbp),%r10d
mov    -0x1ac(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1140 <readcols@plt>
cmpl   $0x0,-0x1bc(%rbp)
jne    1601 <main+0x3c1>
mov    -0x40(%rbp),%rdi
sub    $0x8,%rdi
call   10e0 <malloc@plt>
mov    %rax,-0x1e8(%rbp)
mov    -0x1d0(%rbp),%rdi
mov    -0x1e8(%rbp),%rsi
mov    -0x40(%rbp),%rdx
call   1070 <arr_diff@plt>
mov    -0x1e8(%rbp),%rdi
mov    -0x40(%rbp),%rsi
sub    $0x1,%rsi
call   1090 <arr_median@plt>
movsd  0xb2e(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xb1a(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  0xb06(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x1f0(%rbp)
ff
mov    -0x1e8(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x1b8(%rbp)
je     154e <main+0x30e>
movsd  0xaf1(%rip),%xmm0
movsd  %xmm0,-0x198(%rbp)
ff
movsd  -0x1f0(%rbp),%xmm0
ff
movsd  %xmm0,-0x1a0(%rbp)
ff
movl   $0x4,-0x1f4(%rbp)
jmp    155c <main+0x31c>
cvttsd2si -0x1a8(%rbp),%eax
ff
mov    %eax,-0x1f4(%rbp)
cvtsi2sdl -0x1f4(%rbp),%xmm1
ff
mov    -0x1d0(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x1d0(%rbp),%rax
subsd  (%rax),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xa71(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x200(%rbp)
ff
movsd  -0x200(%rbp),%xmm0
ff
movsd  %xmm0,-0x1a8(%rbp)
ff
cmpl   $0x0,-0x1ac(%rbp)
jne    15fc <main+0x3bc>
mov    -0x40(%rbp),%rsi
lea    0xadb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movsd  -0x1f0(%rbp),%xmm0
ff
lea    0xaec(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
mov    -0x1f4(%rbp),%esi
movsd  -0x200(%rbp),%xmm0
ff
lea    0xafd(%rip),%rdi
mov    $0x1,%al
call   1080 <printf@plt>
jmp    165e <main+0x41e>
cvttsd2si -0x1a8(%rbp),%eax
ff
mov    %eax,-0x204(%rbp)
cvtsi2sdl -0x204(%rbp),%xmm1
ff
mov    -0x1d0(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x1d0(%rbp),%rax
subsd  (%rax),%xmm0
mulsd  %xmm0,%xmm1
movsd  0x9be(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x210(%rbp)
ff
movsd  -0x210(%rbp),%xmm0
ff
movsd  %xmm0,-0x1a8(%rbp)
ff
movsd  -0x198(%rbp),%xmm0
ff
movsd  -0x1a0(%rbp),%xmm1
ff
movsd  -0x1a8(%rbp),%xmm2
ff
call   1060 <arr_util_getstep@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
shl    $0x3,%rdi
call   10e0 <malloc@plt>
mov    %rax,-0x218(%rbp)
mov    -0x218(%rbp),%rdi
movsd  -0x198(%rbp),%xmm0
ff
movsd  -0x1a8(%rbp),%xmm1
ff
mov    -0x48(%rbp),%rsi
call   1150 <arr_init_linspace@plt>
cmpl   $0x0,-0x1ac(%rbp)
jne    16d2 <main+0x492>
mov    -0x48(%rbp),%rsi
lea    0xa5e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x220(%rbp)
ff
cmpl   $0x0,-0x1b4(%rbp)
je     1751 <main+0x511>
cmpl   $0x0,-0x1ac(%rbp)
jne    1705 <main+0x4c5>
lea    0xa5b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1d8(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   10c0 <arr_mean@plt>
movsd  %xmm0,-0x220(%rbp)
ff
mov    -0x1d8(%rbp),%rdi
movsd  -0x220(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x40(%rbp),%rsi
call   1120 <arr_sca_add@plt>
jmp    1771 <main+0x531>
cmpl   $0x0,-0x1ac(%rbp)
jne    176c <main+0x52c>
lea    0xa1e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1771 <main+0x531>
lea    -0x190(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x190(%rbp),%rdi
lea    0xa22(%rip),%rsi
call   1130 <strcat@plt>
lea    -0x190(%rbp),%rdi
lea    0xa19(%rip),%rsi
call   1100 <fopen@plt>
mov    %rax,-0x228(%rbp)
mov    -0x228(%rbp),%rdi
lea    0xa01(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x228(%rbp),%rdi
lea    -0xb0(%rbp),%rdx
lea    0xa28(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x228(%rbp),%rdi
movsd  -0x198(%rbp),%xmm0
ff
movsd  -0x1a0(%rbp),%xmm1
ff
lea    0xa1b(%rip),%rsi
mov    $0x2,%al
call   10a0 <fprintf@plt>
mov    -0x228(%rbp),%rdi
mov    -0x1c4(%rbp),%edx
lea    0xa24(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x228(%rbp),%rdi
lea    0xa29(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x228(%rbp),%rdi
lea    0xa18(%rip),%rsi
lea    0xa2c(%rip),%rdx
lea    0xa2c(%rip),%rcx
lea    0xa2f(%rip),%r8
lea    0xa2e(%rip),%r9
lea    0xa2d(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x228(%rbp),%rdi
lea    0x93f(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
cmpl   $0x0,-0x1ac(%rbp)
jne    18dc <main+0x69c>
mov    -0x1c4(%rbp),%esi
movsd  -0x198(%rbp),%xmm0
ff
movsd  -0x1a0(%rbp),%xmm1
ff
lea    0x9e8(%rip),%rdi
mov    $0x2,%al
call   1080 <printf@plt>
lea    0xa1a(%rip),%rdi
lea    0x9b1(%rip),%rsi
lea    0x9b1(%rip),%rdx
lea    0x9b4(%rip),%rcx
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0x24c(%rbp)
mov    -0x24c(%rbp),%eax
cmp    -0x1c4(%rbp),%eax
jge    1b89 <main+0x949>
cmpl   $0x0,-0x1ac(%rbp)
jne    191c <main+0x6dc>
mov    -0x24c(%rbp),%esi
add    $0x1,%esi
lea    0x9d6(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x230(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x238(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x240(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x248(%rbp)
ff
mov    -0x1d0(%rbp),%rdi
mov    -0x1d8(%rbp),%rsi
mov    -0x1e0(%rbp),%rdx
mov    -0x218(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    -0x1c0(%rbp),%eax
lea    -0x230(%rbp),%rbx
lea    -0x238(%rbp),%r11
lea    -0x240(%rbp),%r10
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1110 <fouriermax@plt>
movsd  -0x238(%rbp),%xmm0
ff
movsd  -0x238(%rbp),%xmm2
ff
movsd  -0x240(%rbp),%xmm1
ff
mulsd  -0x240(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x248(%rbp)
ff
mov    -0x228(%rbp),%rdi
mov    -0x24c(%rbp),%edx
add    $0x1,%edx
movsd  -0x230(%rbp),%xmm0
ff
movsd  -0x248(%rbp),%xmm1
ff
movsd  -0x238(%rbp),%xmm2
ff
movsd  -0x240(%rbp),%xmm3
ff
lea    0x8eb(%rip),%rsi
mov    $0x4,%al
call   10a0 <fprintf@plt>
cmpl   $0x0,-0x1ac(%rbp)
jne    1a37 <main+0x7f7>
movsd  -0x230(%rbp),%xmm0
ff
movsd  -0x248(%rbp),%xmm1
ff
lea    0x8e6(%rip),%rdi
mov    $0x2,%al
call   1080 <printf@plt>
movl   $0x0,-0x250(%rbp)
movslq -0x250(%rbp),%rax
cmp    -0x40(%rbp),%rax
jae    1b70 <main+0x930>
mov    -0x1d8(%rbp),%rax
movslq -0x250(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x280(%rbp)
ff
movsd  -0x238(%rbp),%xmm0
ff
movsd  %xmm0,-0x278(%rbp)
ff
movsd  0x59b(%rip),%xmm0
mulsd  -0x230(%rbp),%xmm0
ff
mov    -0x1d0(%rbp),%rax
movslq -0x250(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   10b0 <sin@plt>
movsd  -0x280(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x278(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x270(%rbp)
ff
movsd  -0x240(%rbp),%xmm0
ff
movsd  %xmm0,-0x268(%rbp)
ff
movsd  0x529(%rip),%xmm0
mulsd  -0x230(%rbp),%xmm0
ff
mov    -0x1d0(%rbp),%rax
movslq -0x250(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
call   10f0 <cos@plt>
movsd  -0x270(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x268(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x1d8(%rbp),%rax
movslq -0x250(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x250(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x250(%rbp)
jmp    1a41 <main+0x801>
jmp    1b75 <main+0x935>
mov    -0x24c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24c(%rbp)
jmp    18e6 <main+0x6a6>
mov    -0x228(%rbp),%rdi
call   1050 <fclose@plt>
cmpl   $0x0,-0x1ac(%rbp)
jne    1bb0 <main+0x970>
lea    0x79e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpl   $0x0,-0x1ac(%rbp)
jne    1bd2 <main+0x992>
lea    -0x120(%rbp),%rsi
lea    0x75e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpl   $0x0,-0x1b4(%rbp)
je     1bf7 <main+0x9b7>
mov    -0x1d8(%rbp),%rdi
movsd  -0x220(%rbp),%xmm0
ff
mov    -0x40(%rbp),%rsi
call   1120 <arr_sca_add@plt>
lea    -0x120(%rbp),%rdi
mov    -0x1d0(%rbp),%rsi
mov    -0x1d8(%rbp),%rdx
mov    -0x1e0(%rbp),%rcx
mov    -0x40(%rbp),%r8
mov    -0x1c0(%rbp),%r9d
mov    -0x1b0(%rbp),%eax
mov    %eax,(%rsp)
call   1160 <writecols3@plt>
mov    -0x1d0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1d8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1e0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x218(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x1ac(%rbp)
je     1c76 <main+0xa36>
cmpl   $0x1,-0x1bc(%rbp)
jne    1c84 <main+0xa44>
lea    0x6c4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x2c8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1d8,%rsp
movl   $0x0,(%rsp)
movl   $0x1,0x1c(%rsp)
movl   $0x1,0x18(%rsp)
movl   $0x0,0x44(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x1,0x4(%rsp)
movl   $0x0,0x64(%rsp)
sub    $0x70,%rsp
xorpd  %xmm0,%xmm0
movupd %xmm0,0x58(%rsp)
lea    0xd4(%rsp),%rax
mov    %rax,0x50(%rsp)
lea    0x74(%rsp),%rax
mov    %rax,0x48(%rsp)
movupd %xmm0,0x38(%rsp)
lea    0x78(%rsp),%rax
mov    %rax,0x30(%rsp)
lea    0x7c(%rsp),%rax
mov    %rax,0x28(%rsp)
lea    0xb4(%rsp),%rax
mov    %rax,0x20(%rsp)
lea    0x90(%rsp),%rax
mov    %rax,0x18(%rsp)
lea    0xb8(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0xa8(%rsp),%rax
mov    %rax,0x8(%rsp)
lea    0x88(%rsp),%rax
mov    %rax,(%rsp)
lea    0x170(%rsp),%rdx
lea    0x100(%rsp),%rcx
lea    0x70(%rsp),%r8
lea    0x8c(%rsp),%r9
call   10f0 <cmdarg@plt>
add    $0x70,%rsp
mov    %rax,%r14
mov    (%rsp),%r12d
test   %r12d,%r12d
je     1378 <main+0x108>
cmpl   $0x1,0xc(%rsp)
jne    13b7 <main+0x147>
cmpl   $0x0,0x8(%rsp)
lea    0xcdd(%rip),%rax
lea    0xca5(%rip),%rdi
cmove  %rax,%rdi
lea    0x100(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%rsp),%r12d
test   %r12d,%r12d
jne    13b7 <main+0x147>
lea    0xf8e(%rip),%rdi
call   1060 <puts@plt>
mov    (%rsp),%r12d
lea    0x0(,%r14,8),%rbp
mov    %rbp,%rdi
call   1100 <malloc@plt>
mov    %rax,%r15
mov    %rbp,%rdi
call   1100 <malloc@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1100 <malloc@plt>
mov    %rax,%rcx
mov    0x8(%rsp),%r9d
mov    0x1c(%rsp),%eax
lea    0x100(%rsp),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %rcx,0x78(%rsp)
mov    %r14,%r8
push   %r12
push   %rax
call   1160 <readcols@plt>
add    $0x10,%rsp
cmpl   $0x0,0xc(%rsp)
je     1447 <main+0x1d7>
movsd  0x20(%rsp),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
movsd  -0x8(%r15,%r14,8),%xmm1
subsd  (%r15),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xbc8(%rip),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,0x20(%rsp)
jmp    1538 <main+0x2c8>
lea    -0x8(%r14),%rdi
call   1100 <malloc@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1090 <arr_diff@plt>
lea    -0x1(%r14),%rsi
mov    %rbp,%rdi
call   10b0 <arr_median@plt>
addsd  %xmm0,%xmm0
movsd  0xb8f(%rip),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xb7b(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %rbp,%rdi
call   1030 <free@plt>
cmpl   $0x0,0x44(%rsp)
je     14bc <main+0x24c>
movabs $0x4014000000000000,%rax
mov    %rax,0x38(%rsp)
movsd  0x10(%rsp),%xmm3
movsd  %xmm3,0x48(%rsp)
mov    $0x4,%ebp
jmp    14c2 <main+0x252>
cvttsd2si 0x20(%rsp),%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
movsd  -0x8(%r15,%r14,8),%xmm1
subsd  (%r15),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xb1f(%rip),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,0x20(%rsp)
cmpl   $0x0,(%rsp)
jne    1538 <main+0x2c8>
lea    0xb9c(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
movsd  %xmm2,0x28(%rsp)
call   10a0 <printf@plt>
lea    0xbac(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x1,%al
call   10a0 <printf@plt>
lea    0xbc5(%rip),%rdi
mov    %ebp,%esi
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   10a0 <printf@plt>
movsd  0x20(%rsp),%xmm2
movsd  0x38(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
call   1080 <arr_util_getstep@plt>
mov    %rax,%rbp
lea    0x0(,%rax,8),%rdi
call   1100 <malloc@plt>
movsd  0x38(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    %rax,0x70(%rsp)
mov    %rax,%rdi
mov    %rbp,0x68(%rsp)
mov    %rbp,%rsi
call   1180 <arr_init_linspace@plt>
cmpl   $0x0,(%rsp)
jne    1593 <main+0x323>
lea    0xb98(%rip),%rdi
mov    0x68(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
cmpl   $0x0,0x18(%rsp)
mov    (%rsp),%eax
je     15d4 <main+0x364>
test   %eax,%eax
jne    15ad <main+0x33d>
lea    0xd6b(%rip),%rdi
call   1060 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10e0 <arr_mean@plt>
movaps %xmm0,0x80(%rsp)
xorps  0xa59(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
call   1140 <arr_sca_add@plt>
jmp    15ef <main+0x37f>
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
test   %eax,%eax
jne    15ef <main+0x37f>
lea    0xcf9(%rip),%rdi
call   1060 <puts@plt>
lea    0x170(%rsp),%rbp
lea    0x90(%rsp),%rsi
mov    %rbp,%rdi
call   1050 <strcpy@plt>
lea    0xb41(%rip),%rsi
mov    %rbp,%rdi
call   1150 <strcat@plt>
lea    0xb3c(%rip),%rsi
mov    %rbp,%rdi
call   1120 <fopen@plt>
mov    %rax,%r12
lea    0xb2c(%rip),%r13
mov    $0x42,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %rax,%rcx
call   1170 <fwrite@plt>
lea    0xb53(%rip),%rsi
lea    0x100(%rsp),%rdx
mov    %r12,%rdi
xor    %eax,%eax
call   10c0 <fprintf@plt>
movsd  0x38(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
lea    0xb46(%rip),%rsi
mov    %r12,%rdi
mov    $0x2,%al
call   10c0 <fprintf@plt>
mov    0x4(%rsp),%edx
lea    0xb55(%rip),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   10c0 <fprintf@plt>
lea    0xb5e(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1170 <fwrite@plt>
sub    $0x8,%rsp
lea    0xb7d(%rip),%rbp
lea    0xb3e(%rip),%rsi
lea    0xb52(%rip),%rdx
lea    0xb52(%rip),%rcx
lea    0xb55(%rip),%r8
lea    0xb54(%rip),%r9
mov    %r12,%rdi
xor    %eax,%eax
push   %rbp
call   10c0 <fprintf@plt>
add    $0x10,%rsp
mov    $0x42,%esi
mov    $0x1,%edx
mov    %r13,%rdi
mov    %r12,%rcx
call   1170 <fwrite@plt>
cmpl   $0x0,(%rsp)
jne    1741 <main+0x4d1>
mov    0x4(%rsp),%esi
movsd  0x38(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
lea    0xb1e(%rip),%rdi
mov    $0x2,%al
call   10a0 <printf@plt>
lea    0xb50(%rip),%rdi
lea    0xae7(%rip),%rsi
lea    0xae7(%rip),%rdx
lea    0xaea(%rip),%rcx
xor    %eax,%eax
call   10a0 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    18d8 <main+0x668>
xor    %ebp,%ebp
jmp    175a <main+0x4ea>
cmp    0x4(%rsp),%ebp
jge    18d8 <main+0x668>
add    $0x1,%ebp
cmpl   $0x0,(%rsp)
jne    1773 <main+0x503>
lea    0xb1c(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
movq   $0x0,0x30(%rsp)
movq   $0x0,0x58(%rsp)
movq   $0x0,0x50(%rsp)
mov    0x8(%rsp),%eax
mov    %r15,%rdi
mov    %rbx,%rsi
mov    0x78(%rsp),%rdx
mov    0x70(%rsp),%rcx
mov    %r14,%r8
mov    0x68(%rsp),%r9
push   %rax
lea    0x58(%rsp),%rax
push   %rax
lea    0x68(%rsp),%rax
push   %rax
lea    0x48(%rsp),%rax
push   %rax
call   1130 <fouriermax@plt>
add    $0x20,%rsp
movsd  0x58(%rsp),%xmm2
movsd  0x50(%rsp),%xmm3
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x30(%rsp),%xmm0
mov    %r12,%rdi
lea    0xa95(%rip),%rsi
mov    %ebp,%edx
movsd  %xmm1,0x10(%rsp)
mov    $0x4,%al
call   10c0 <fprintf@plt>
cmpl   $0x0,(%rsp)
jne    1825 <main+0x5b5>
movsd  0x30(%rsp),%xmm0
lea    0xa99(%rip),%rdi
movsd  0x10(%rsp),%xmm1
mov    $0x2,%al
call   10a0 <printf@plt>
test   %r14,%r14
movsd  0x7e0(%rip),%xmm1
je     1750 <main+0x4e0>
xor    %r13d,%r13d
nopl   0x0(%rax)
movsd  (%rbx,%r13,8),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x30(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  (%r15,%r13,8),%xmm0
call   10d0 <sin@plt>
mulsd  0x28(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x30(%rsp),%xmm0
mulsd  0x773(%rip),%xmm0
mulsd  (%r15,%r13,8),%xmm0
call   1110 <cos@plt>
movsd  0x760(%rip),%xmm1
mulsd  0x28(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,(%rbx,%r13,8)
add    $0x1,%r13
cmp    %r13,%r14
jne    1840 <main+0x5d0>
jmp    1750 <main+0x4e0>
mov    %r12,%rdi
call   1070 <fclose@plt>
cmpl   $0x0,(%rsp)
jne    190c <main+0x69c>
mov    $0xa,%edi
call   1040 <putchar@plt>
cmpl   $0x0,(%rsp)
jne    190c <main+0x69c>
lea    0x9c7(%rip),%rdi
lea    0x90(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
cmpl   $0x0,0x18(%rsp)
je     1927 <main+0x6b7>
mov    %rbx,%rdi
movapd 0x80(%rsp),%xmm0
mov    %r14,%rsi
call   1140 <arr_sca_add@plt>
mov    0x8(%rsp),%r9d
mov    0x1c(%rsp),%eax
sub    $0x8,%rsp
lea    0x98(%rsp),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    0x80(%rsp),%rbp
mov    %rbp,%rcx
mov    %r14,%r8
push   %rax
call   1190 <writecols3@plt>
add    $0x10,%rsp
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x70(%rsp),%rdi
call   1030 <free@plt>
cmpl   $0x0,(%rsp)
je     1989 <main+0x719>
cmpl   $0x1,0xc(%rsp)
jne    1995 <main+0x725>
lea    0x94c(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
add    $0x1d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"\0ACLEANing the time series \22%s\22 using weights...\0A\00"
@.str.1 = [51 x i8] c"\0ACLEANing the time series \22%s\22 without weights...\0A\00"
@.str.2 = [18 x i8] c" - Reading input\0A\00"
@.str.3 = [39 x i8] c" -- INFO: Length of time series = %li\0A\00"
@.str.4 = [45 x i8] c" -- INFO: Nyquist frequency = %.2lf microHz\0A\00"
@.str.5 = [55 x i8] c" -- INFO: Using %i times oversampling = %.3lf microHz\0A\00"
@.str.6 = [48 x i8] c" -- INFO: Number of sampling frequencies = %li\0A\00"
@.str.7 = [42 x i8] c" - Subtracting the mean from time series\0A\00"
@.str.8 = [49 x i8] c" - Time series used *without* mean subtraction!\0A\00"
@.str.9 = [10 x i8] c".cleanlog\00"
@.str.10 = [2 x i8] c"w\00"
@.str.11 = [67 x i8] c"# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\0A\00"
@.str.12 = [24 x i8] c"# Log of CLEAN on \22%s\22\0A\00"
@.str.13 = [36 x i8] c"# Interval: [%.2lf, %.2lf] microHz\0A\00"
@.str.14 = [26 x i8] c"# Finding %i frequencies\0A\00"
@.str.15 = [4 x i8] c"# \0A\00"
@.str.16 = [27 x i8] c"# %8s %11s %11s %12s %12s\0A\00"
@.str.17 = [7 x i8] c"Number\00"
@.str.18 = [10 x i8] c"Frequency\00"
@.str.19 = [6 x i8] c"Power\00"
@.str.20 = [6 x i8] c"Alpha\00"
@.str.21 = [5 x i8] c"Beta\00"
@.str.22 = [64 x i8] c" - CLEANing %i frequencies in the range %.1lf to %.1lf microHz\0A\00"
@.str.23 = [17 x i8] c"\0A %9s %11s %11s\0A\00"
@.str.24 = [5 x i8] c" %6i\00"
@.str.25 = [38 x i8] c" %6i %15.6lf %12.6lg %12.6lf %12.6lf\0A\00"
@.str.26 = [19 x i8] c" %15.6lf %12.6lg \0A\00"
@.str.27 = [2 x i8] c"\0A\00"
@.str.28 = [24 x i8] c" - Saving to file \22%s\22\0A\00"
@.str.29 = [8 x i8] c"Done!\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca [100 x i8]
%9 = alloca [100 x i8]
%10 = alloca [100 x i8]
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca double*
%23 = alloca double*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double
%27 = alloca i32
%28 = alloca double
%29 = alloca i32
%30 = alloca double
%31 = alloca double*
%32 = alloca double
%33 = alloca i32*
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca i32
%39 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
store i64 0, i64* %7
store i32 0, i32* %14
store i32 1, i32* %15
store i32 1, i32* %16
store i32 0, i32* %17
store i32 0, i32* %18
store i32 0, i32* %19
store i32 1, i32* %20
store i32 0, i32* %21
%40 = load i32, i32* %4
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%44 = call i64 @cmdarg(i32 %40, i8** %41, i8* %42, i8* %43, i32* %14, i32* %15, i32* %16, double* %11, double* %12, double* %13, i32* %17, i32* %18, i32* %19, i32* null, i32* null, i32* %20, i32* %21, i32* null, i32* null)
store i64 %44, i64* %6
%45 = load i32, i32* %14
%46 = icmp eq i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %2
%48 = load i32, i32* %18
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %60
50: ; preds = %47, %2
%51 = load i32, i32* %19
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %54)
br label %59
56: ; preds = %50
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %56, %53
br label %60
60: ; preds = %59, %47
%61 = load i32, i32* %14
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %60
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %65
65: ; preds = %63, %60
%66 = load i64, i64* %6
%67 = mul i64 %66, 8
%68 = call double* @malloc(i64 %67)
store double* %68, double** %22
%69 = load i64, i64* %6
%70 = mul i64 %69, 8
%71 = call double* @malloc(i64 %70)
store double* %71, double** %23
%72 = load i64, i64* %6
%73 = mul i64 %72, 8
%74 = call double* @malloc(i64 %73)
store double* %74, double** %24
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%76 = load double*, double** %22
%77 = load double*, double** %23
%78 = load double*, double** %24
%79 = load i64, i64* %6
%80 = load i32, i32* %19
%81 = load i32, i32* %15
%82 = load i32, i32* %14
%83 = call i32 @readcols(i8* %75, double* %76, double* %77, double* %78, i64 %79, i32 %80, i32 %81, i32 %82)
%84 = load i32, i32* %18
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %136
86: ; preds = %65
%87 = load i64, i64* %6
%88 = sub i64 %87, 8
%89 = call double* @malloc(i64 %88)
store double* %89, double** %25
%90 = load double*, double** %22
%91 = load double*, double** %25
%92 = load i64, i64* %6
%93 = call i32 @arr_diff(double* %90, double* %91, i64 %92)
%94 = load double*, double** %25
%95 = load i64, i64* %6
%96 = sub i64 %95, 1
%97 = call double @arr_median(double* %94, i64 %96)
%98 = fmul double 2.000000e+00, %97
%99 = fdiv double 1.000000e+00, %98
%100 = fmul double %99, 1.000000e+06
store double %100, double* %26
%101 = load double*, double** %25
%102 = call i32 @free(double* %101)
%103 = load i32, i32* %17
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %107
105: ; preds = %86
store double 5.000000e+00, double* %11
%106 = load double, double* %26
store double %106, double* %12
store i32 4, i32* %27
br label %110
107: ; preds = %86
%108 = load double, double* %13
%109 = fptosi double %108 to i32
store i32 %109, i32* %27
br label %110
110: ; preds = %107, %105
%111 = load i32, i32* %27
%112 = sitofp i32 %111 to double
%113 = load double*, double** %22
%114 = load i64, i64* %6
%115 = sub i64 %114, 1
%116 = getelementptr inbounds double, double* %113, i64 %115
%117 = load double, double* %116
%118 = load double*, double** %22
%119 = getelementptr inbounds double, double* %118, i64 0
%120 = load double, double* %119
%121 = fsub double %117, %120
%122 = fmul double %112, %121
%123 = fdiv double 1.000000e+06, %122
store double %123, double* %28
%124 = load double, double* %28
store double %124, double* %13
%125 = load i32, i32* %14
%126 = icmp eq i32 %125, 0
br i1 %126, label %127, label %135
127: ; preds = %110
%128 = load i64, i64* %6
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i64 %128)
%130 = load double, double* %26
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), double %130)
%132 = load i32, i32* %27
%133 = load double, double* %28
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i32 %132, double %133)
br label %135
135: ; preds = %127, %110
br label %153
136: ; preds = %65
%137 = load double, double* %13
%138 = fptosi double %137 to i32
store i32 %138, i32* %29
%139 = load i32, i32* %29
%140 = sitofp i32 %139 to double
%141 = load double*, double** %22
%142 = load i64, i64* %6
%143 = sub i64 %142, 1
%144 = getelementptr inbounds double, double* %141, i64 %143
%145 = load double, double* %144
%146 = load double*, double** %22
%147 = getelementptr inbounds double, double* %146, i64 0
%148 = load double, double* %147
%149 = fsub double %145, %148
%150 = fmul double %140, %149
%151 = fdiv double 1.000000e+06, %150
store double %151, double* %30
%152 = load double, double* %30
store double %152, double* %13
br label %153
153: ; preds = %136, %135
%154 = load double, double* %11
%155 = load double, double* %12
%156 = load double, double* %13
%157 = call i64 @arr_util_getstep(double %154, double %155, double %156)
store i64 %157, i64* %7
%158 = load i64, i64* %7
%159 = mul i64 %158, 8
%160 = call double* @malloc(i64 %159)
store double* %160, double** %31
%161 = load double*, double** %31
%162 = load double, double* %11
%163 = load double, double* %13
%164 = load i64, i64* %7
%165 = call i32 @arr_init_linspace(double* %161, double %162, double %163, i64 %164)
%166 = load i32, i32* %14
%167 = icmp eq i32 %166, 0
br i1 %167, label %168, label %171
168: ; preds = %153
%169 = load i64, i64* %7
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i64 %169)
br label %171
171: ; preds = %168, %153
store double 0.000000e+00, double* %32
%172 = load i32, i32* %16
%173 = icmp ne i32 %172, 0
br i1 %173, label %174, label %188
174: ; preds = %171
%175 = load i32, i32* %14
%176 = icmp eq i32 %175, 0
br i1 %176, label %177, label %179
177: ; preds = %174
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
br label %179
179: ; preds = %177, %174
%180 = load double*, double** %23
%181 = load i64, i64* %6
%182 = call double @arr_mean(double* %180, i64 %181)
store double %182, double* %32
%183 = load double*, double** %23
%184 = load double, double* %32
%185 = fneg double %184
%186 = load i64, i64* %6
%187 = call i32 @arr_sca_add(double* %183, double %185, i64 %186)
br label %194
188: ; preds = %171
%189 = load i32, i32* %14
%190 = icmp eq i32 %189, 0
br i1 %190, label %191, label %193
191: ; preds = %188
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
br label %193
193: ; preds = %191, %188
br label %194
194: ; preds = %193, %179
%195 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%196 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%197 = call i32 @strcpy(i8* %195, i8* %196)
%198 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%199 = call i32 @strcat(i8* %198, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%200 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%201 = call i32* @fopen(i8* %200, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %201, i32** %33
%202 = load i32*, i32** %33
%203 = call i32 (i32*, i8*, ...) @fprintf(i32* %202, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0))
%204 = load i32*, i32** %33
%205 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%206 = call i32 (i32*, i8*, ...) @fprintf(i32* %204, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* %205)
%207 = load i32*, i32** %33
%208 = load double, double* %11
%209 = load double, double* %12
%210 = call i32 (i32*, i8*, ...) @fprintf(i32* %207, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), double %208, double %209)
%211 = load i32*, i32** %33
%212 = load i32, i32* %20
%213 = call i32 (i32*, i8*, ...) @fprintf(i32* %211, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 %212)
%214 = load i32*, i32** %33
%215 = call i32 (i32*, i8*, ...) @fprintf(i32* %214, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0))
%216 = load i32*, i32** %33
%217 = call i32 (i32*, i8*, ...) @fprintf(i32* %216, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%218 = load i32*, i32** %33
%219 = call i32 (i32*, i8*, ...) @fprintf(i32* %218, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0))
%220 = load i32, i32* %14
%221 = icmp eq i32 %220, 0
br i1 %221, label %222, label %228
222: ; preds = %194
%223 = load i32, i32* %20
%224 = load double, double* %11
%225 = load double, double* %12
%226 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.22, i64 0, i64 0), i32 %223, double %224, double %225)
%227 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
br label %228
228: ; preds = %222, %194
store i32 0, i32* %38
br label %229
229: ; preds = %313, %228
%230 = load i32, i32* %38
%231 = load i32, i32* %20
%232 = icmp slt i32 %230, %231
br i1 %232, label %233, label %316
233: ; preds = %229
%234 = load i32, i32* %14
%235 = icmp eq i32 %234, 0
br i1 %235, label %236, label %240
236: ; preds = %233
%237 = load i32, i32* %38
%238 = add nsw i32 %237, 1
%239 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i32 %238)
br label %240
240: ; preds = %236, %233
store double 0.000000e+00, double* %34
store double 0.000000e+00, double* %35
store double 0.000000e+00, double* %36
store double 0.000000e+00, double* %37
%241 = load double*, double** %22
%242 = load double*, double** %23
%243 = load double*, double** %24
%244 = load double*, double** %31
%245 = load i64, i64* %6
%246 = load i64, i64* %7
%247 = load i32, i32* %19
%248 = call i32 @fouriermax(double* %241, double* %242, double* %243, double* %244, i64 %245, i64 %246, double* %34, double* %35, double* %36, i32 %247)
%249 = load double, double* %35
%250 = load double, double* %35
%251 = load double, double* %36
%252 = load double, double* %36
%253 = fmul double %251, %252
%254 = call double @llvm.fmuladd.f64(double %249, double %250, double %253)
store double %254, double* %37
%255 = load i32*, i32** %33
%256 = load i32, i32* %38
%257 = add nsw i32 %256, 1
%258 = load double, double* %34
%259 = load double, double* %37
%260 = load double, double* %35
%261 = load double, double* %36
%262 = call i32 (i32*, i8*, ...) @fprintf(i32* %255, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.25, i64 0, i64 0), i32 %257, double %258, double %259, double %260, double %261)
%263 = load i32, i32* %14
%264 = icmp eq i32 %263, 0
br i1 %264, label %265, label %269
265: ; preds = %240
%266 = load double, double* %34
%267 = load double, double* %37
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.26, i64 0, i64 0), double %266, double %267)
br label %269
269: ; preds = %265, %240
store i32 0, i32* %39
br label %270
270: ; preds = %309, %269
%271 = load i32, i32* %39
%272 = sext i32 %271 to i64
%273 = load i64, i64* %6
%274 = icmp ult i64 %272, %273
br i1 %274, label %275, label %312
275: ; preds = %270
%276 = load double*, double** %23
%277 = load i32, i32* %39
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds double, double* %276, i64 %278
%280 = load double, double* %279
%281 = load double, double* %35
%282 = load double, double* %34
%283 = fmul double 0x3EDA5A84D380747E, %282
%284 = load double*, double** %22
%285 = load i32, i32* %39
%286 = sext i32 %285 to i64
%287 = getelementptr inbounds double, double* %284, i64 %286
%288 = load double, double* %287
%289 = fmul double %283, %288
%290 = call double @sin(double %289)
%291 = fneg double %281
%292 = call double @llvm.fmuladd.f64(double %291, double %290, double %280)
%293 = load double, double* %36
%294 = load double, double* %34
%295 = fmul double 0x3EDA5A84D380747E, %294
%296 = load double*, double** %22
%297 = load i32, i32* %39
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds double, double* %296, i64 %298
%300 = load double, double* %299
%301 = fmul double %295, %300
%302 = call double @cos(double %301)
%303 = fneg double %293
%304 = call double @llvm.fmuladd.f64(double %303, double %302, double %292)
%305 = load double*, double** %23
%306 = load i32, i32* %39
%307 = sext i32 %306 to i64
%308 = getelementptr inbounds double, double* %305, i64 %307
store double %304, double* %308
br label %309
309: ; preds = %275
%310 = load i32, i32* %39
%311 = add nsw i32 %310, 1
store i32 %311, i32* %39
br label %270
312: ; preds = %270
br label %313
313: ; preds = %312
%314 = load i32, i32* %38
%315 = add nsw i32 %314, 1
store i32 %315, i32* %38
br label %229
316: ; preds = %229
%317 = load i32*, i32** %33
%318 = call i32 @fclose(i32* %317)
%319 = load i32, i32* %14
%320 = icmp eq i32 %319, 0
br i1 %320, label %321, label %323
321: ; preds = %316
%322 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.27, i64 0, i64 0))
br label %323
323: ; preds = %321, %316
%324 = load i32, i32* %14
%325 = icmp eq i32 %324, 0
br i1 %325, label %326, label %329
326: ; preds = %323
%327 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%328 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.28, i64 0, i64 0), i8* %327)
br label %329
329: ; preds = %326, %323
%330 = load i32, i32* %16
%331 = icmp ne i32 %330, 0
br i1 %331, label %332, label %337
332: ; preds = %329
%333 = load double*, double** %23
%334 = load double, double* %32
%335 = load i64, i64* %6
%336 = call i32 @arr_sca_add(double* %333, double %334, i64 %335)
br label %337
337: ; preds = %332, %329
%338 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%339 = load double*, double** %22
%340 = load double*, double** %23
%341 = load double*, double** %24
%342 = load i64, i64* %6
%343 = load i32, i32* %19
%344 = load i32, i32* %15
%345 = call i32 @writecols3(i8* %338, double* %339, double* %340, double* %341, i64 %342, i32 %343, i32 %344)
%346 = load double*, double** %22
%347 = call i32 @free(double* %346)
%348 = load double*, double** %23
%349 = call i32 @free(double* %348)
%350 = load double*, double** %24
%351 = call i32 @free(double* %350)
%352 = load double*, double** %31
%353 = call i32 @free(double* %352)
%354 = load i32, i32* %14
%355 = icmp eq i32 %354, 0
br i1 %355, label %359, label %356
356: ; preds = %337
%357 = load i32, i32* %18
%358 = icmp eq i32 %357, 1
br i1 %358, label %359, label %361
359: ; preds = %356, %337
%360 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.29, i64 0, i64 0))
br label %361
361: ; preds = %359, %356
ret i32 0
}

LLVM IR (-O2):
@.str = [49 x i8] c"\0ACLEANing the time series \22%s\22 using weights...\0A\00"
@.str.1 = [51 x i8] c"\0ACLEANing the time series \22%s\22 without weights...\0A\00"
@.str.3 = [39 x i8] c" -- INFO: Length of time series = %li\0A\00"
@.str.4 = [45 x i8] c" -- INFO: Nyquist frequency = %.2lf microHz\0A\00"
@.str.5 = [55 x i8] c" -- INFO: Using %i times oversampling = %.3lf microHz\0A\00"
@.str.6 = [48 x i8] c" -- INFO: Number of sampling frequencies = %li\0A\00"
@.str.9 = [10 x i8] c".cleanlog\00"
@.str.10 = [2 x i8] c"w\00"
@.str.11 = [67 x i8] c"# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\0A\00"
@.str.12 = [24 x i8] c"# Log of CLEAN on \22%s\22\0A\00"
@.str.13 = [36 x i8] c"# Interval: [%.2lf, %.2lf] microHz\0A\00"
@.str.14 = [26 x i8] c"# Finding %i frequencies\0A\00"
@.str.15 = [4 x i8] c"# \0A\00"
@.str.16 = [27 x i8] c"# %8s %11s %11s %12s %12s\0A\00"
@.str.17 = [7 x i8] c"Number\00"
@.str.18 = [10 x i8] c"Frequency\00"
@.str.19 = [6 x i8] c"Power\00"
@.str.20 = [6 x i8] c"Alpha\00"
@.str.21 = [5 x i8] c"Beta\00"
@.str.22 = [64 x i8] c" - CLEANing %i frequencies in the range %.1lf to %.1lf microHz\0A\00"
@.str.23 = [17 x i8] c"\0A %9s %11s %11s\0A\00"
@.str.24 = [5 x i8] c" %6i\00"
@.str.25 = [38 x i8] c" %6i %15.6lf %12.6lg %12.6lf %12.6lf\0A\00"
@.str.26 = [19 x i8] c" %15.6lf %12.6lg \0A\00"
@.str.28 = [24 x i8] c" - Saving to file \22%s\22\0A\00"
@str = [7 x i8] c"Done!\0A\00"
@str.30 = [48 x i8] c" - Time series used *without* mean subtraction!\00"
@str.31 = [41 x i8] c" - Subtracting the mean from time series\00"
@str.32 = [17 x i8] c" - Reading input\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%23 = bitcast double* %6 to i8*
%24 = bitcast double* %7 to i8*
%25 = bitcast double* %8 to i8*
%26 = bitcast i32* %9 to i8*
store i32 0, i32* %9
%27 = bitcast i32* %10 to i8*
store i32 1, i32* %10
%28 = bitcast i32* %11 to i8*
store i32 1, i32* %11
%29 = bitcast i32* %12 to i8*
store i32 0, i32* %12
%30 = bitcast i32* %13 to i8*
store i32 0, i32* %13
%31 = bitcast i32* %14 to i8*
store i32 0, i32* %14
%32 = bitcast i32* %15 to i8*
store i32 1, i32* %15
%33 = bitcast i32* %16 to i8*
store i32 0, i32* %16
%34 = call i64 @cmdarg(i32 %0, i8** %1, i8* %20, i8* %21, i32* %9, i32* %10, i32* %11, double* %6, double* %7, double* %8, i32* %12, i32* %13, i32* %14, i32* null, i32* null, i32* %15, i32* %16, i32* null, i32* null)
%35 = load i32, i32* %9
%36 = icmp eq i32 %35, 0
%37 = load i32, i32* %13
%38 = icmp eq i32 %37, 1
%39 = select i1 %36, i1 true, i1 %38
br i1 %39, label %40, label %50
40: ; preds = %2
%41 = load i32, i32* %14
%42 = icmp eq i32 %41, 0
%43 = select i1 %42, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %43, i8* %20)
%45 = load i32, i32* %9
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %40
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.32, i64 0, i64 0))
%49 = load i32, i32* %9
br label %50
50: ; preds = %2, %47, %40
%51 = phi i32 [ %35, %2 ], [ %49, %47 ], [ %45, %40 ]
%52 = shl i64 %34, 3
%53 = call double* @malloc(i64 %52)
%54 = call double* @malloc(i64 %52)
%55 = call double* @malloc(i64 %52)
%56 = load i32, i32* %14
%57 = load i32, i32* %10
%58 = call i32 @readcols(i8* %20, double* %53, double* %54, double* %55, i64 %34, i32 %56, i32 %57, i32 %51)
%59 = load i32, i32* %13
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %93
61: ; preds = %50
%62 = add i64 %34, -8
%63 = call double* @malloc(i64 %62)
%64 = call i32 @arr_diff(double* %53, double* %63, i64 %34)
%65 = add i64 %34, -1
%66 = call double @arr_median(double* %63, i64 %65)
%67 = fmul double %66, 2.000000e+00
%68 = fdiv double 1.000000e+00, %67
%69 = fmul double %68, 1.000000e+06
%70 = call i32 @free(double* %63)
%71 = load i32, i32* %12
%72 = icmp eq i32 %71, 0
br i1 %72, label %74, label %73
73: ; preds = %61
store double 5.000000e+00, double* %6
store double %69, double* %7
br label %77
74: ; preds = %61
%75 = load double, double* %8
%76 = fptosi double %75 to i32
br label %77
77: ; preds = %74, %73
%78 = phi i32 [ 4, %73 ], [ %76, %74 ]
%79 = sitofp i32 %78 to double
%80 = getelementptr inbounds double, double* %53, i64 %65
%81 = load double, double* %80
%82 = load double, double* %53
%83 = fsub double %81, %82
%84 = fmul double %83, %79
%85 = fdiv double 1.000000e+06, %84
store double %85, double* %8
%86 = load i32, i32* %9
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %104
88: ; preds = %77
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i64 %34)
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), double %69)
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0), i32 %78, double %85)
%92 = load double, double* %8
br label %104
93: ; preds = %50
%94 = load double, double* %8
%95 = fptosi double %94 to i32
%96 = sitofp i32 %95 to double
%97 = add i64 %34, -1
%98 = getelementptr inbounds double, double* %53, i64 %97
%99 = load double, double* %98
%100 = load double, double* %53
%101 = fsub double %99, %100
%102 = fmul double %101, %96
%103 = fdiv double 1.000000e+06, %102
store double %103, double* %8
br label %104
104: ; preds = %77, %88, %93
%105 = phi double [ %85, %77 ], [ %92, %88 ], [ %103, %93 ]
%106 = load double, double* %6
%107 = load double, double* %7
%108 = call i64 @arr_util_getstep(double %106, double %107, double %105)
%109 = shl i64 %108, 3
%110 = call double* @malloc(i64 %109)
%111 = load double, double* %6
%112 = load double, double* %8
%113 = call i32 @arr_init_linspace(double* %110, double %111, double %112, i64 %108)
%114 = load i32, i32* %9
%115 = icmp eq i32 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %104
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i64 %108)
br label %118
118: ; preds = %116, %104
%119 = load i32, i32* %11
%120 = icmp eq i32 %119, 0
%121 = load i32, i32* %9
%122 = icmp eq i32 %121, 0
br i1 %120, label %130, label %123
123: ; preds = %118
br i1 %122, label %124, label %126
124: ; preds = %123
%125 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.31, i64 0, i64 0))
br label %126
126: ; preds = %124, %123
%127 = call double @arr_mean(double* %54, i64 %34)
%128 = fneg double %127
%129 = call i32 @arr_sca_add(double* %54, double %128, i64 %34)
br label %133
130: ; preds = %118
br i1 %122, label %131, label %133
131: ; preds = %130
%132 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.30, i64 0, i64 0))
br label %133
133: ; preds = %130, %131, %126
%134 = phi double [ %127, %126 ], [ 0.000000e+00, %131 ], [ 0.000000e+00, %130 ]
%135 = call i32 @strcpy(i8* %22, i8* %21)
%136 = call i32 @strcat(i8* %22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%137 = call i32* @fopen(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%138 = call i64 @fwrite(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0), i64 66, i64 1, i32* %137)
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %137, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* %20)
%140 = load double, double* %6
%141 = load double, double* %7
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %137, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i64 0, i64 0), double %140, double %141)
%143 = load i32, i32* %15
%144 = call i32 (i32*, i8*, ...) @fprintf(i32* %137, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 %143)
%145 = call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i64 3, i64 1, i32* %137)
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %137, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%147 = call i64 @fwrite(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.11, i64 0, i64 0), i64 66, i64 1, i32* %137)
%148 = bitcast double* %17 to i8*
%149 = bitcast double* %18 to i8*
%150 = bitcast double* %19 to i8*
%151 = load i32, i32* %9
%152 = icmp eq i32 %151, 0
br i1 %152, label %153, label %159
153: ; preds = %133
%154 = load i32, i32* %15
%155 = load double, double* %6
%156 = load double, double* %7
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.22, i64 0, i64 0), i32 %154, double %155, double %156)
%158 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
br label %159
159: ; preds = %153, %133
%160 = load i32, i32* %15
%161 = icmp sgt i32 %160, 0
br i1 %161, label %162, label %167
162: ; preds = %159
%163 = icmp eq i64 %34, 0
br label %171
164: ; preds = %193, %192
%165 = load i32, i32* %15
%166 = icmp slt i32 %175, %165
br i1 %166, label %171, label %167
167: ; preds = %164, %159
%168 = call i32 @fclose(i32* %137)
%169 = load i32, i32* %9
%170 = icmp eq i32 %169, 0
br i1 %170, label %216, label %222
171: ; preds = %162, %164
%172 = phi i32 [ 0, %162 ], [ %175, %164 ]
%173 = load i32, i32* %9
%174 = icmp eq i32 %173, 0
%175 = add nuw nsw i32 %172, 1
br i1 %174, label %176, label %178
176: ; preds = %171
%177 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i32 %175)
br label %178
178: ; preds = %171, %176
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
store double 0.000000e+00, double* %19
%179 = load i32, i32* %14
%180 = call i32 @fouriermax(double* %53, double* %54, double* %55, double* %110, i64 %34, i64 %108, double* %17, double* %18, double* %19, i32 %179)
%181 = load double, double* %18
%182 = load double, double* %19
%183 = fmul double %182, %182
%184 = call double @llvm.fmuladd.f64(double %181, double %181, double %183)
%185 = load double, double* %17
%186 = call i32 (i32*, i8*, ...) @fprintf(i32* %137, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.25, i64 0, i64 0), i32 %175, double %185, double %184, double %181, double %182)
%187 = load i32, i32* %9
%188 = icmp eq i32 %187, 0
br i1 %188, label %189, label %192
189: ; preds = %178
%190 = load double, double* %17
%191 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.26, i64 0, i64 0), double %190, double %184)
br label %192
192: ; preds = %189, %178
br i1 %163, label %164, label %193
193: ; preds = %192, %193
%194 = phi i64 [ %214, %193 ], [ 0, %192 ]
%195 = getelementptr inbounds double, double* %54, i64 %194
%196 = load double, double* %195
%197 = load double, double* %18
%198 = load double, double* %17
%199 = fmul double %198, 0x3EDA5A84D380747E
%200 = getelementptr inbounds double, double* %53, i64 %194
%201 = load double, double* %200
%202 = fmul double %199, %201
%203 = call double @sin(double %202)
%204 = fneg double %197
%205 = call double @llvm.fmuladd.f64(double %204, double %203, double %196)
%206 = load double, double* %19
%207 = load double, double* %17
%208 = fmul double %207, 0x3EDA5A84D380747E
%209 = load double, double* %200
%210 = fmul double %208, %209
%211 = call double @cos(double %210)
%212 = fneg double %206
%213 = call double @llvm.fmuladd.f64(double %212, double %211, double %205)
store double %213, double* %195
%214 = add nuw nsw i64 %194, 1
%215 = icmp eq i64 %214, %34
br i1 %215, label %164, label %193
216: ; preds = %167
%217 = call i32 @putchar(i32 10)
%218 = load i32, i32* %9
%219 = icmp eq i32 %218, 0
br i1 %219, label %220, label %222
220: ; preds = %216
%221 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.28, i64 0, i64 0), i8* %21)
br label %222
222: ; preds = %167, %220, %216
%223 = load i32, i32* %11
%224 = icmp eq i32 %223, 0
br i1 %224, label %227, label %225
225: ; preds = %222
%226 = call i32 @arr_sca_add(double* %54, double %134, i64 %34)
br label %227
227: ; preds = %225, %222
%228 = load i32, i32* %14
%229 = load i32, i32* %10
%230 = call i32 @writecols3(i8* %21, double* %53, double* %54, double* %55, i64 %34, i32 %228, i32 %229)
%231 = call i32 @free(double* %53)
%232 = call i32 @free(double* %54)
%233 = call i32 @free(double* %55)
%234 = call i32 @free(double* %110)
%235 = load i32, i32* %9
%236 = icmp eq i32 %235, 0
%237 = load i32, i32* %13
%238 = icmp eq i32 %237, 1
%239 = select i1 %236, i1 true, i1 %238
br i1 %239, label %240, label %242
240: ; preds = %227
%241 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %242
242: ; preds = %227, %240
ret i32 0
}