#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 */
scalar_t__ EOF;
int /*<<< orphan*/ dft(double *, long, double *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(double *);
long getfile(char *, int /*<<< orphan*/, long);
char *getout(int, char **, long *);
long lcan(int, char **, char, long);
scalar_t__ malloc(long);
int /*<<< orphan*/ nthstring(int, char **, int);
long pol_surr(long, double *, double *, double *, double *, long);
int /*<<< orphan*/ putcol(char *, long);
scalar_t__ readdum(int /*<<< orphan*/ *);
scalar_t__ readval(int /*<<< orphan*/ *, double *, long);
scalar_t__ realloc(double *, size_t);
int /*<<< orphan*/ rnd_init(unsigned long);
int /*<<< orphan*/ sort(long, double *);
int /*<<< orphan*/ sprintf(char *, char *, long);
double sqrt(double);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
long strip_primes(long);
scalar_t__ strlen(char *);
long time(int /*<<< orphan*/ *);
int /*<<< orphan*/ whatido(int, char **, char *, char *);
int main(int argc, char *argv[]) {
  double *y = NULL, *z = NULL, *ampl_org, *arr_sort, sy, sy2, syz;
  char file[512], *outfile;
  long number, col, iter, it, nmax, nexcl, n, i, seed = 67654748, filen, iget;
  FILE *fpin = stdin, *fpout = stdout;
  whatido(argc, argv, "create iterative surrogate data", argv[0]);
  nmax = lcan(argc, argv, 'l', 10000000);
  nexcl = lcan(argc, argv, 'x', 0);
  col = lcan(argc, argv, 'c', 0);
  number = lcan(argc, argv, 'n', 1);
  iter = lcan(argc, argv, 'i', 100000);
  seed = -lcan(argc, argv, 'I', seed);
  if (seed == 0)
    seed = time(NULL);
  rnd_init((unsigned long)seed);
  outfile = getout(argc, argv, &iget);
  col = getfile(file, nthstring(argc, argv, 1), col);
  if (file[0] == '-')
    file[0] = '\0';
  else {
    fprintf(stderr, "trying to open file %s\n", file);
    fpin = fopen(file, "r");
    if (fpin == NULL) {
      fprintf(stderr, "cannot open file %s\n", file);
      return 5;
    }
  }
  if (number > 1)
    iget = 1;
  if (iget) {
    if (file[0] == '\0')
      strcpy(file, "stdin");
    putcol(file, col);
    strcat(file, "_surr");
  } else
    file[0] = '\0';
  if (outfile[0] != '\0')
    strcpy(file, outfile);
  filen = (long)strlen(file);
  for (n = 0; n < nexcl; n++)
    if (readdum(fpin) == EOF)
      return 4;
  for (n = 0; n < nmax; n++) {
    y = (double *)realloc(y, (size_t)((n + 1) * sizeof(double)));
    if (readval(fpin, y + n, col) == EOF)
      break;
  }
  fprintf(stderr, "read %ld values\n", n);
  nmax = strip_primes(n);
  if (n != nmax)
    fprintf(stderr, "shortened to length: %ld\n", nmax);
  arr_sort = (double *)malloc((size_t)(nmax * sizeof(double)));
  ampl_org = (double *)malloc((size_t)((nmax / 2 + 1) * sizeof(double)));
  z = (double *)malloc(nmax * sizeof(double));
  if (arr_sort == NULL || ampl_org == NULL || z == NULL) {
    fprintf(stderr, "no memory\n");
    exit(5);
  }
  dft(y, nmax, ampl_org, NULL);
  for (i = 0; i < nmax; i++)
    arr_sort[i] = y[i];
  sort(nmax, arr_sort);
  for (i = 0; i < number; i++) {
    if (file[0] != '\0') {
      if (number > 1)
        sprintf(file + filen, "_%3.3ld", i + 1);
      fprintf(stderr, "%s ", file);
      fpout = fopen(file, "w");
      if (fpout == NULL) {
        fprintf(stderr, "cannot open file %s\n", file);
        return 5;
      }
    }
    it = pol_surr(nmax, y, z, arr_sort, ampl_org, iter);
    for (n = 0, sy = 0, sy2 = 0, syz = 0; n < nmax; n++) {
      sy += y[n];
      sy2 += y[n] * y[n];
      syz += (y[n] - z[n]) * (y[n] - z[n]);
    }
    sy = sqrt((sy2 / nmax) - (sy / nmax) * (sy / nmax));
    syz = sqrt(syz / nmax);
    fprintf(stderr, "(%ld iterations, relative discrepancy  %lf)\n", it,
            syz / sy);
    for (n = 0; n < nmax; n++)
      fprintf(fpout, "%lf %lf\n", y[n], z[n]);
    fclose(fpout);
  }
  free(y);
  free(arr_sort);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x408545c,-0x2a0(%rbp)
5c 54 08 04
mov    0x2d0d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x2b8(%rbp)
mov    0x2cdc(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x2c0(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xcf5(%rip),%rdx
call   10e0 <whatido@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x6c,%edx
mov    $0x989680,%ecx
call   1060 <lcan@plt>
mov    %rax,-0x280(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x78,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1060 <lcan@plt>
mov    %rax,-0x288(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x63,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1060 <lcan@plt>
mov    %rax,-0x268(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x6e,%edx
mov    $0x1,%ecx
call   1060 <lcan@plt>
mov    %rax,-0x260(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x69,%edx
mov    $0x186a0,%ecx
call   1060 <lcan@plt>
mov    %rax,-0x270(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x2a0(%rbp),%rcx
mov    $0x49,%edx
call   1060 <lcan@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x2a0(%rbp)
cmpq   $0x0,-0x2a0(%rbp)
jne    13e4 <main+0x144>
xor    %eax,%eax
mov    %eax,%edi
call   1120 <time@plt>
mov    %rax,-0x2a0(%rbp)
mov    -0x2a0(%rbp),%rdi
call   1100 <rnd_init@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x2b0(%rbp),%rdx
call   1050 <getout@plt>
mov    %rax,-0x258(%rbp)
lea    -0x250(%rbp),%rax
mov    %rax,-0x2c8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   10b0 <nthstring@plt>
mov    -0x2c8(%rbp),%rdi
mov    %eax,%esi
mov    -0x268(%rbp),%rdx
call   11c0 <getfile@plt>
mov    %rax,-0x268(%rbp)
movsbl -0x250(%rbp),%eax
cmp    $0x2d,%eax
jne    1461 <main+0x1c1>
movb   $0x0,-0x250(%rbp)
jmp    14d8 <main+0x238>
mov    0x2b68(%rip),%rax
mov    (%rax),%rdi
lea    -0x250(%rbp),%rdx
lea    0xba7(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
lea    -0x250(%rbp),%rdi
lea    0xbc9(%rip),%rsi
call   1150 <fopen@plt>
mov    %rax,-0x2b8(%rbp)
cmpq   $0x0,-0x2b8(%rbp)
jne    14d3 <main+0x233>
mov    0x2b21(%rip),%rax
mov    (%rax),%rdi
lea    -0x250(%rbp),%rdx
lea    0xb78(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x5,-0x4(%rbp)
jmp    1b2e <main+0x88e>
jmp    14d8 <main+0x238>
cmpq   $0x1,-0x260(%rbp)
01
jle    14f1 <main+0x251>
movq   $0x1,-0x2b0(%rbp)
cmpq   $0x0,-0x2b0(%rbp)
je     154d <main+0x2ad>
movsbl -0x250(%rbp),%eax
cmp    $0x0,%eax
jne    1522 <main+0x282>
lea    -0x250(%rbp),%rdi
lea    0xb30(%rip),%rsi
call   1080 <strcpy@plt>
lea    -0x250(%rbp),%rdi
mov    -0x268(%rbp),%rsi
call   1040 <putcol@plt>
lea    -0x250(%rbp),%rdi
lea    0xb10(%rip),%rsi
call   1170 <strcat@plt>
jmp    1554 <main+0x2b4>
movb   $0x0,-0x250(%rbp)
mov    -0x258(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     157a <main+0x2da>
lea    -0x250(%rbp),%rdi
mov    -0x258(%rbp),%rsi
call   1080 <strcpy@plt>
lea    -0x250(%rbp),%rdi
call   10c0 <strlen@plt>
mov    %rax,-0x2a8(%rbp)
movq   $0x0,-0x290(%rbp)
mov    -0x290(%rbp),%rax
cmp    -0x288(%rbp),%rax
jge    15f0 <main+0x350>
mov    -0x2b8(%rbp),%rdi
call   11b0 <readdum@plt>
mov    0x2a21(%rip),%rcx
cmp    (%rcx),%rax
jne    15d4 <main+0x334>
movl   $0x4,-0x4(%rbp)
jmp    1b2e <main+0x88e>
jmp    15d9 <main+0x339>
mov    -0x290(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x290(%rbp)
jmp    1598 <main+0x2f8>
movq   $0x0,-0x290(%rbp)
mov    -0x290(%rbp),%rax
cmp    -0x280(%rbp),%rax
jge    1681 <main+0x3e1>
mov    -0x18(%rbp),%rdi
mov    -0x290(%rbp),%rsi
add    $0x1,%rsi
shl    $0x3,%rsi
call   1140 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x2b8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x290(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x268(%rbp),%rdx
call   1070 <readval@plt>
mov    0x2989(%rip),%rcx
cmp    (%rcx),%rax
jne    1665 <main+0x3c5>
jmp    1681 <main+0x3e1>
jmp    166a <main+0x3ca>
mov    -0x290(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x290(%rbp)
jmp    15fb <main+0x35b>
mov    0x2948(%rip),%rax
mov    (%rax),%rdi
mov    -0x290(%rbp),%rdx
lea    0x9c0(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
mov    -0x290(%rbp),%rdi
call   1180 <strip_primes@plt>
mov    %rax,-0x280(%rbp)
mov    -0x290(%rbp),%rax
cmp    -0x280(%rbp),%rax
je     16e6 <main+0x446>
mov    0x2902(%rip),%rax
mov    (%rax),%rdi
mov    -0x280(%rbp),%rdx
lea    0x98b(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
mov    -0x280(%rbp),%rdi
shl    $0x3,%rdi
call   1130 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x280(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1130 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x280(%rbp),%rdi
shl    $0x3,%rdi
call   1130 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1754 <main+0x4b4>
cmpq   $0x0,-0x28(%rbp)
je     1754 <main+0x4b4>
cmpq   $0x0,-0x20(%rbp)
jne    1776 <main+0x4d6>
mov    0x2875(%rip),%rax
mov    (%rax),%rdi
lea    0x91f(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
mov    $0x5,%edi
call   11a0 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x280(%rbp),%rsi
mov    -0x28(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   10f0 <dft@plt>
movq   $0x0,-0x298(%rbp)
mov    -0x298(%rbp),%rax
cmp    -0x280(%rbp),%rax
jge    17e4 <main+0x544>
mov    -0x18(%rbp),%rax
mov    -0x298(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x298(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x298(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x298(%rbp)
jmp    1799 <main+0x4f9>
mov    -0x280(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10d0 <sort@plt>
movq   $0x0,-0x298(%rbp)
mov    -0x298(%rbp),%rax
cmp    -0x260(%rbp),%rax
jge    1b15 <main+0x875>
movsbl -0x250(%rbp),%eax
cmp    $0x0,%eax
je     18cd <main+0x62d>
cmpq   $0x1,-0x260(%rbp)
01
jle    1856 <main+0x5b6>
lea    -0x250(%rbp),%rdi
add    -0x2a8(%rbp),%rdi
mov    -0x298(%rbp),%rdx
add    $0x1,%rdx
lea    0x83e(%rip),%rsi
call   1190 <sprintf@plt>
mov    0x2773(%rip),%rax
mov    (%rax),%rdi
lea    -0x250(%rbp),%rdx
lea    0x829(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
lea    -0x250(%rbp),%rdi
lea    0x818(%rip),%rsi
call   1150 <fopen@plt>
mov    %rax,-0x2c0(%rbp)
cmpq   $0x0,-0x2c0(%rbp)
jne    18c8 <main+0x628>
mov    0x272c(%rip),%rax
mov    (%rax),%rdi
lea    -0x250(%rbp),%rdx
lea    0x783(%rip),%rsi
mov    $0x0,%al
call   1110 <fprintf@plt>
movl   $0x5,-0x4(%rbp)
jmp    1b2e <main+0x88e>
jmp    18cd <main+0x62d>
mov    -0x280(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x270(%rbp),%r9
call   1090 <pol_surr@plt>
mov    %rax,-0x278(%rbp)
movq   $0x0,-0x290(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x290(%rbp),%rax
cmp    -0x280(%rbp),%rax
jge    19e3 <main+0x743>
mov    -0x18(%rbp),%rax
mov    -0x290(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x290(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x290(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x290(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x290(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x290(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x20(%rbp),%rax
mov    -0x290(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x290(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x290(%rbp)
jmp    191a <main+0x67a>
movsd  -0x40(%rbp),%xmm1
cvtsi2sdq -0x280(%rbp),%xmm0
ff ff
divsd  %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
cvtsi2sdq -0x280(%rbp),%xmm2
ff ff
divsd  %xmm2,%xmm0
movsd  -0x38(%rbp),%xmm2
cvtsi2sdq -0x280(%rbp),%xmm3
ff ff
divsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1160 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x48(%rbp),%xmm0
cvtsi2sdq -0x280(%rbp),%xmm1
ff ff
divsd  %xmm1,%xmm0
call   1160 <sqrt@plt>
movsd  %xmm0,-0x48(%rbp)
mov    0x256b(%rip),%rax
mov    (%rax),%rdi
mov    -0x278(%rbp),%rdx
movsd  -0x48(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
lea    0x61d(%rip),%rsi
mov    $0x1,%al
call   1110 <fprintf@plt>
movq   $0x0,-0x290(%rbp)
mov    -0x290(%rbp),%rax
cmp    -0x280(%rbp),%rax
jge    1af2 <main+0x852>
mov    -0x2c0(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x290(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
mov    -0x290(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0x5f6(%rip),%rsi
mov    $0x2,%al
call   1110 <fprintf@plt>
mov    -0x290(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x290(%rbp)
jmp    1a92 <main+0x7f2>
mov    -0x2c0(%rbp),%rdi
call   10a0 <fclose@plt>
mov    -0x298(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x298(%rbp)
jmp    17ff <main+0x55f>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x288,%rsp
mov    %rsi,%rbp
mov    %edi,%r15d
mov    0x2d1a(%rip),%rax
mov    (%rax),%r13
mov    0x2cf0(%rip),%rax
mov    (%rax),%rax
mov    %rax,0x20(%rsp)
mov    (%rsi),%rcx
lea    0xd1e(%rip),%rdx
call   10e0 <whatido@plt>
mov    $0x989680,%ecx
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x6c,%edx
call   1060 <lcan@plt>
mov    %rax,%r12
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x78,%edx
xor    %ecx,%ecx
call   1060 <lcan@plt>
mov    %rax,%rbx
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x63,%edx
xor    %ecx,%ecx
call   1060 <lcan@plt>
mov    %rax,0x8(%rsp)
mov    $0x1,%ecx
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x6e,%edx
call   1060 <lcan@plt>
mov    %rax,0x18(%rsp)
mov    $0x186a0,%ecx
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x69,%edx
call   1060 <lcan@plt>
mov    %rax,0x78(%rsp)
mov    $0x408545c,%ecx
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x49,%edx
call   1060 <lcan@plt>
test   %rax,%rax
je     1386 <main+0xd6>
neg    %rax
jmp    138d <main+0xdd>
xor    %edi,%edi
call   1120 <time@plt>
mov    %rax,%rdi
call   1100 <rnd_init@plt>
lea    0x48(%rsp),%rdx
mov    %r15d,%edi
mov    %rbp,%rsi
call   1050 <getout@plt>
mov    %rax,%r14
mov    %r15d,%edi
mov    %rbp,%rsi
mov    $0x1,%edx
call   10b0 <nthstring@plt>
lea    0x80(%rsp),%rdi
mov    %eax,%esi
mov    0x8(%rsp),%rdx
call   11d0 <getfile@plt>
mov    %rax,0x8(%rsp)
cmpb   $0x2d,0x80(%rsp)
2d
jne    13e5 <main+0x135>
movb   $0x0,0x80(%rsp)
jmp    1423 <main+0x173>
mov    0x2be4(%rip),%r15
mov    (%r15),%rdi
lea    0xc32(%rip),%rsi
lea    0x80(%rsp),%rbp
mov    %rbp,%rdx
xor    %eax,%eax
call   1110 <fprintf@plt>
lea    0xc50(%rip),%rsi
mov    %rbp,%rdi
call   1150 <fopen@plt>
mov    %rax,%r13
test   %rax,%rax
je     16aa <main+0x3fa>
cmpq   $0x2,0x18(%rsp)
jl     1436 <main+0x186>
movq   $0x1,0x48(%rsp)
jmp    1442 <main+0x192>
cmpq   $0x0,0x48(%rsp)
je     16b2 <main+0x402>
cmpb   $0x0,0x80(%rsp)
jne    1460 <main+0x1b0>
lea    0xc02(%rip),%rsi
lea    0x80(%rsp),%rdi
call   1080 <strcpy@plt>
lea    0x80(%rsp),%rbp
mov    %rbp,%rdi
mov    0x8(%rsp),%rsi
call   1040 <putcol@plt>
lea    0xbdf(%rip),%rsi
mov    %rbp,%rdi
call   1170 <strcat@plt>
cmpb   $0x0,(%r14)
je     149a <main+0x1ea>
lea    0x80(%rsp),%rdi
mov    %r14,%rsi
call   1080 <strcpy@plt>
lea    0x80(%rsp),%rdi
call   10c0 <strlen@plt>
mov    %rax,%r14
test   %rbx,%rbx
jle    14d8 <main+0x228>
mov    0x2b2a(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    %r13,%rdi
call   11c0 <readdum@plt>
cmp    0x0(%rbp),%rax
je     16a0 <main+0x3f0>
add    $0xffffffffffffffff,%rbx
jne    14c0 <main+0x210>
mov    %r14,0x10(%rsp)
xor    %r14d,%r14d
test   %r12,%r12
cmovle %r14,%r12
mov    $0x1,%ebx
mov    $0x8,%ebp
mov    0x2ae8(%rip),%r15
nopl   0x0(%rax,%rax,1)
lea    (%r12,%rbx,1),%rax
cmp    $0x1,%rax
je     1540 <main+0x290>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1140 <realloc@plt>
mov    %rax,%r14
lea    (%rax,%rbp,1),%rsi
add    $0xfffffffffffffff8,%rsi
mov    %r13,%rdi
mov    0x8(%rsp),%rdx
call   1070 <readval@plt>
add    $0xffffffffffffffff,%rbx
add    $0x8,%rbp
cmp    (%r15),%rax
jne    1500 <main+0x250>
neg    %rbx
mov    %rbx,%r12
mov    0x2a89(%rip),%rax
mov    (%rax),%rdi
lea    0xb10(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1110 <fprintf@plt>
mov    %r12,%rdi
call   1180 <strip_primes@plt>
mov    %rax,%r13
cmp    %rax,%r12
je     1586 <main+0x2d6>
mov    0x2a5e(%rip),%rax
mov    (%rax),%rdi
lea    0xaf6(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1110 <fprintf@plt>
lea    0x0(,%r13,8),%rbp
mov    %rbp,%rdi
call   1130 <malloc@plt>
mov    %rax,%rbx
mov    %r13,%rax
shr    $0x3f,%rax
add    %r13,%rax
and    $0xfffffffffffffffe,%rax
lea    0x8(,%rax,4),%rdi
call   1130 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %rbp,%rdi
call   1130 <malloc@plt>
test   %rbx,%rbx
je     1b52 <main+0x8a2>
cmpq   $0x0,0x30(%rsp)
je     1b52 <main+0x8a2>
mov    %rax,%r15
test   %rax,%rax
je     1b52 <main+0x8a2>
mov    %r14,%rdi
mov    %r13,%rsi
mov    0x30(%rsp),%rdx
xor    %ecx,%ecx
call   10f0 <dft@plt>
test   %r13,%r13
mov    0x20(%rsp),%r12
jle    17a8 <main+0x4f8>
cmp    $0x4,%r13
jb     1622 <main+0x372>
lea    (%r14,%r13,8),%rax
cmp    %rax,%rbx
jae    16c9 <main+0x419>
lea    (%rbx,%r13,8),%rax
cmp    %rax,%r14
jae    16c9 <main+0x419>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
add    %r13,%rcx
mov    %r13,%rdx
and    $0x3,%rdx
je     1655 <main+0x3a5>
cs nopw 0x0(%rax,%rax,1)
movsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    1640 <main+0x390>
cmp    $0x3,%rcx
jb     17a8 <main+0x4f8>
nop
movsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x8(%r14,%rax,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
movsd  0x10(%r14,%rax,8),%xmm0
movsd  %xmm0,0x10(%rbx,%rax,8)
movsd  0x18(%r14,%rax,8),%xmm0
movsd  %xmm0,0x18(%rbx,%rax,8)
add    $0x4,%rax
cmp    %rax,%r13
jne    1660 <main+0x3b0>
jmp    17a8 <main+0x4f8>
mov    $0x4,%eax
jmp    1b40 <main+0x890>
mov    (%r15),%rdi
jmp    1b25 <main+0x875>
movb   $0x0,0x80(%rsp)
cmpb   $0x0,(%r14)
jne    148a <main+0x1da>
jmp    149a <main+0x1ea>
mov    %r13,%rax
and    $0xfffffffffffffffc,%rax
lea    -0x4(%rax),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0xc,%rsi
jae    16ee <main+0x43e>
xor    %esi,%esi
jmp    1764 <main+0x4b4>
and    $0xfffffffffffffffc,%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movups (%r14,%rsi,8),%xmm0
movups 0x10(%r14,%rsi,8),%xmm1
movups %xmm0,(%rbx,%rsi,8)
movups %xmm1,0x10(%rbx,%rsi,8)
movups 0x20(%r14,%rsi,8),%xmm0
movups 0x30(%r14,%rsi,8),%xmm1
movups %xmm0,0x20(%rbx,%rsi,8)
movups %xmm1,0x30(%rbx,%rsi,8)
movups 0x40(%r14,%rsi,8),%xmm0
movups 0x50(%r14,%rsi,8),%xmm1
movups %xmm0,0x40(%rbx,%rsi,8)
movups %xmm1,0x50(%rbx,%rsi,8)
movupd 0x60(%r14,%rsi,8),%xmm0
movupd 0x70(%r14,%rsi,8),%xmm1
movupd %xmm0,0x60(%rbx,%rsi,8)
movupd %xmm1,0x70(%rbx,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rdx
jne    1700 <main+0x450>
test   %rcx,%rcx
je     179f <main+0x4ef>
lea    (%rbx,%rsi,8),%rdx
add    $0x10,%rdx
lea    (%r14,%rsi,8),%rsi
add    $0x10,%rsi
shl    $0x5,%rcx
xor    %edi,%edi
nop
movupd -0x10(%rsi,%rdi,1),%xmm0
movupd (%rsi,%rdi,1),%xmm1
movupd %xmm0,-0x10(%rdx,%rdi,1)
movupd %xmm1,(%rdx,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%rcx
jne    1780 <main+0x4d0>
cmp    %rax,%r13
jne    1624 <main+0x374>
mov    %r13,%rdi
mov    %rbx,%rsi
call   10d0 <sort@plt>
cmpq   $0x0,0x18(%rsp)
jle    1b07 <main+0x857>
xorps  %xmm0,%xmm0
cvtsi2sd %r13,%xmm0
mov    0x10(%rsp),%rax
add    %rsp,%rax
add    $0x80,%rax
mov    %rax,0x50(%rsp)
xorpd  %xmm1,%xmm1
movsd  %xmm0,0x10(%rsp)
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
mov    %r13,%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,0x68(%rsp)
movsd  %xmm2,0x38(%rsp)
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
movsd  %xmm0,0x60(%rsp)
movsd  %xmm1,0x40(%rsp)
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
movsd  %xmm0,0x58(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
mov    %rbx,0x70(%rsp)
jmp    1888 <main+0x5d8>
nopl   0x0(%rax,%rax,1)
divsd  %xmm1,%xmm0
mov    0x2785(%rip),%rax
mov    (%rax),%rdi
lea    0x850(%rip),%rsi
mov    %rbp,%rdx
mov    $0x1,%al
call   1110 <fprintf@plt>
mov    %r12,%rdi
call   10a0 <fclose@plt>
mov    0x8(%rsp),%rcx
add    $0x1,%rcx
mov    %rcx,%rax
mov    %rcx,0x8(%rsp)
cmp    0x18(%rsp),%rcx
mov    0x70(%rsp),%rbx
je     1b07 <main+0x857>
cmpb   $0x0,0x80(%rsp)
je     18f2 <main+0x642>
cmpq   $0x2,0x18(%rsp)
jl     18b4 <main+0x604>
mov    0x8(%rsp),%rax
lea    0x1(%rax),%rdx
mov    0x50(%rsp),%rdi
lea    0x7e8(%rip),%rsi
call   1190 <sprintf@plt>
mov    0x2715(%rip),%rax
mov    (%rax),%rdi
lea    0x7da(%rip),%rsi
lea    0x80(%rsp),%rbp
mov    %rbp,%rdx
xor    %eax,%eax
call   1110 <fprintf@plt>
mov    %rbp,%rdi
lea    0x7c2(%rip),%rsi
call   1150 <fopen@plt>
mov    %rax,%r12
test   %rax,%rax
je     1b1b <main+0x86b>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    0x30(%rsp),%r8
mov    0x78(%rsp),%r9
call   1090 <pol_surr@plt>
mov    %rax,%rbp
test   %r13,%r13
jle    1930 <main+0x680>
cmp    $0x1,%r13
mov    0x68(%rsp),%rcx
jne    1990 <main+0x6e0>
xorpd  %xmm4,%xmm4
xorpd  %xmm1,%xmm1
xor    %eax,%eax
jmp    19ef <main+0x73f>
nop
movsd  0x38(%rsp),%xmm0
ucomisd 0x6c2(%rip),%xmm0
movsd  0x60(%rsp),%xmm1
jae    1955 <main+0x6a5>
movsd  0x38(%rsp),%xmm0
call   1160 <sqrt@plt>
movapd %xmm0,%xmm1
movsd  0x40(%rsp),%xmm0
ucomisd 0x69d(%rip),%xmm0
movsd  0x58(%rsp),%xmm0
jae    1840 <main+0x590>
movsd  0x40(%rsp),%xmm0
movsd  %xmm1,0x20(%rsp)
call   1160 <sqrt@plt>
movsd  0x20(%rsp),%xmm1
jmp    1840 <main+0x590>
nopl   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rax,8),%xmm2
movsd  0x8(%r14,%rax,8),%xmm4
movapd %xmm2,%xmm3
subsd  (%r15,%rax,8),%xmm3
addsd  %xmm2,%xmm1
unpcklpd %xmm3,%xmm2
mulpd  %xmm2,%xmm2
addpd  %xmm0,%xmm2
addsd  %xmm4,%xmm1
movapd %xmm4,%xmm0
subsd  0x8(%r15,%rax,8),%xmm0
unpcklpd %xmm0,%xmm4
mulpd  %xmm4,%xmm4
addpd  %xmm2,%xmm4
add    $0x2,%rax
movapd %xmm4,%xmm0
cmp    %rax,%rcx
jne    19a0 <main+0x6f0>
test   $0x1,%r13b
je     1a15 <main+0x765>
movsd  (%r14,%rax,8),%xmm0
movapd %xmm0,%xmm2
subsd  (%r15,%rax,8),%xmm2
addsd  %xmm0,%xmm1
unpcklpd %xmm2,%xmm0
mulpd  %xmm0,%xmm0
addpd  %xmm0,%xmm4
movapd %xmm4,%xmm0
movsd  0x10(%rsp),%xmm2
divsd  %xmm2,%xmm0
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
ucomisd 0x5c9(%rip),%xmm0
jb     1a50 <main+0x7a0>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    1a65 <main+0x7b5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm4,0x20(%rsp)
call   1160 <sqrt@plt>
movapd 0x20(%rsp),%xmm4
movapd %xmm0,%xmm1
unpckhpd %xmm4,%xmm4
divsd  0x10(%rsp),%xmm4
ucomisd 0x589(%rip),%xmm4
jb     1a90 <main+0x7e0>
xorps  %xmm0,%xmm0
sqrtsd %xmm4,%xmm0
jmp    1aa5 <main+0x7f5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd %xmm4,%xmm0
movsd  %xmm1,0x20(%rsp)
call   1160 <sqrt@plt>
movsd  0x20(%rsp),%xmm1
divsd  %xmm1,%xmm0
mov    0x2520(%rip),%rax
mov    (%rax),%rdi
lea    0x5eb(%rip),%rsi
mov    %rbp,%rdx
mov    $0x1,%al
call   1110 <fprintf@plt>
test   %r13,%r13
lea    0x604(%rip),%rbp
jle    185f <main+0x5af>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
movsd  (%r15,%rbx,8),%xmm1
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x2,%al
call   1110 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1ae0 <main+0x830>
jmp    185f <main+0x5af>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
jmp    1b40 <main+0x890>
mov    0x24ae(%rip),%rax
mov    (%rax),%rdi
lea    0x514(%rip),%rsi
lea    0x80(%rsp),%rdx
xor    %eax,%eax
call   1110 <fprintf@plt>
mov    $0x5,%eax
add    $0x288,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2477(%rip),%rax
mov    (%rax),%rcx
lea    0x529(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
call   11b0 <fwrite@plt>
mov    $0x5,%edi
call   11a0 <exit@plt>

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
@.str = [32 x i8] c"create iterative surrogate data\00"
@stderr = global i32* null
@.str.1 = [24 x i8] c"trying to open file %s\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [21 x i8] c"cannot open file %s\0A\00"
@.str.4 = [6 x i8] c"stdin\00"
@.str.5 = [6 x i8] c"_surr\00"
@EOF = global i64 0
@.str.6 = [17 x i8] c"read %ld values\0A\00"
@.str.7 = [26 x i8] c"shortened to length: %ld\0A\00"
@.str.8 = [11 x i8] c"no memory\0A\00"
@.str.9 = [8 x i8] c"_%3.3ld\00"
@.str.10 = [4 x i8] c"%s \00"
@.str.11 = [2 x i8] c"w\00"
@.str.12 = [45 x i8] c"(%ld iterations, relative discrepancy %lf)\0A\00"
@.str.13 = [9 x i8] c"%lf %lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca [512 x i8]
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
%22 = alloca i64
%23 = alloca i64
%24 = alloca i64
%25 = alloca i64
%26 = alloca i32*
%27 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double* null, double** %6
store double* null, double** %7
store i64 67654748, i64* %23
%28 = load i32*, i32** @stdin
store i32* %28, i32** %26
%29 = load i32*, i32** @stdout
store i32* %29, i32** %27
%30 = load i32, i32* %4
%31 = load i8**, i8*** %5
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 0
%34 = load i8*, i8** %33
%35 = call i32 @whatido(i32 %30, i8** %31, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %34)
%36 = load i32, i32* %4
%37 = load i8**, i8*** %5
%38 = call i64 @lcan(i32 %36, i8** %37, i8 signext 108, i64 10000000)
store i64 %38, i64* %19
%39 = load i32, i32* %4
%40 = load i8**, i8*** %5
%41 = call i64 @lcan(i32 %39, i8** %40, i8 signext 120, i64 0)
store i64 %41, i64* %20
%42 = load i32, i32* %4
%43 = load i8**, i8*** %5
%44 = call i64 @lcan(i32 %42, i8** %43, i8 signext 99, i64 0)
store i64 %44, i64* %16
%45 = load i32, i32* %4
%46 = load i8**, i8*** %5
%47 = call i64 @lcan(i32 %45, i8** %46, i8 signext 110, i64 1)
store i64 %47, i64* %15
%48 = load i32, i32* %4
%49 = load i8**, i8*** %5
%50 = call i64 @lcan(i32 %48, i8** %49, i8 signext 105, i64 100000)
store i64 %50, i64* %17
%51 = load i32, i32* %4
%52 = load i8**, i8*** %5
%53 = load i64, i64* %23
%54 = call i64 @lcan(i32 %51, i8** %52, i8 signext 73, i64 %53)
%55 = sub nsw i64 0, %54
store i64 %55, i64* %23
%56 = load i64, i64* %23
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %2
%59 = call i64 @time(i32* null)
store i64 %59, i64* %23
br label %60
60: ; preds = %58, %2
%61 = load i64, i64* %23
%62 = call i32 @rnd_init(i64 %61)
%63 = load i32, i32* %4
%64 = load i8**, i8*** %5
%65 = call i8* @getout(i32 %63, i8** %64, i64* %25)
store i8* %65, i8** %14
%66 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%67 = load i32, i32* %4
%68 = load i8**, i8*** %5
%69 = call i32 @nthstring(i32 %67, i8** %68, i32 1)
%70 = load i64, i64* %16
%71 = call i64 @getfile(i8* %66, i32 %69, i64 %70)
store i64 %71, i64* %16
%72 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 45
br i1 %75, label %76, label %78
76: ; preds = %60
%77 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
store i8 0, i8* %77
br label %91
78: ; preds = %60
%79 = load i32*, i32** @stderr
%80 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %80)
%82 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%83 = call i32* @fopen(i8* %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %83, i32** %26
%84 = load i32*, i32** %26
%85 = icmp eq i32* %84, null
br i1 %85, label %86, label %90
86: ; preds = %78
%87 = load i32*, i32** @stderr
%88 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%89 = call i32 (i32*, i8*, ...) @fprintf(i32* %87, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %88)
store i32 5, i32* %3
br label %370
90: ; preds = %78
br label %91
91: ; preds = %90, %76
%92 = load i64, i64* %15
%93 = icmp sgt i64 %92, 1
br i1 %93, label %94, label %95
94: ; preds = %91
store i64 1, i64* %25
br label %95
95: ; preds = %94, %91
%96 = load i64, i64* %25
%97 = icmp ne i64 %96, 0
br i1 %97, label %98, label %112
98: ; preds = %95
%99 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 0
br i1 %102, label %103, label %106
103: ; preds = %98
%104 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%105 = call i32 @strcpy(i8* %104, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %106
106: ; preds = %103, %98
%107 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%108 = load i64, i64* %16
%109 = call i32 @putcol(i8* %107, i64 %108)
%110 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%111 = call i32 @strcat(i8* %110, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %114
112: ; preds = %95
%113 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
store i8 0, i8* %113
br label %114
114: ; preds = %112, %106
%115 = load i8*, i8** %14
%116 = getelementptr inbounds i8, i8* %115, i64 0
%117 = load i8, i8* %116
%118 = sext i8 %117 to i32
%119 = icmp ne i32 %118, 0
br i1 %119, label %120, label %124
120: ; preds = %114
%121 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%122 = load i8*, i8** %14
%123 = call i32 @strcpy(i8* %121, i8* %122)
br label %124
124: ; preds = %120, %114
%125 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%126 = call i64 @strlen(i8* %125)
store i64 %126, i64* %24
store i64 0, i64* %21
br label %127
127: ; preds = %138, %124
%128 = load i64, i64* %21
%129 = load i64, i64* %20
%130 = icmp slt i64 %128, %129
br i1 %130, label %131, label %141
131: ; preds = %127
%132 = load i32*, i32** %26
%133 = call i64 @readdum(i32* %132)
%134 = load i64, i64* @EOF
%135 = icmp eq i64 %133, %134
br i1 %135, label %136, label %137
136: ; preds = %131
store i32 4, i32* %3
br label %370
137: ; preds = %131
br label %138
138: ; preds = %137
%139 = load i64, i64* %21
%140 = add nsw i64 %139, 1
store i64 %140, i64* %21
br label %127
141: ; preds = %127
store i64 0, i64* %21
br label %142
142: ; preds = %163, %141
%143 = load i64, i64* %21
%144 = load i64, i64* %19
%145 = icmp slt i64 %143, %144
br i1 %145, label %146, label %166
146: ; preds = %142
%147 = load double*, double** %6
%148 = load i64, i64* %21
%149 = add nsw i64 %148, 1
%150 = mul i64 %149, 8
%151 = call i64 @realloc(double* %147, i64 %150)
%152 = inttoptr i64 %151 to double*
store double* %152, double** %6
%153 = load i32*, i32** %26
%154 = load double*, double** %6
%155 = load i64, i64* %21
%156 = getelementptr inbounds double, double* %154, i64 %155
%157 = load i64, i64* %16
%158 = call i64 @readval(i32* %153, double* %156, i64 %157)
%159 = load i64, i64* @EOF
%160 = icmp eq i64 %158, %159
br i1 %160, label %161, label %162
161: ; preds = %146
br label %166
162: ; preds = %146
br label %163
163: ; preds = %162
%164 = load i64, i64* %21
%165 = add nsw i64 %164, 1
store i64 %165, i64* %21
br label %142
166: ; preds = %161, %142
%167 = load i32*, i32** @stderr
%168 = load i64, i64* %21
%169 = call i32 (i32*, i8*, ...) @fprintf(i32* %167, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i64 %168)
%170 = load i64, i64* %21
%171 = call i64 @strip_primes(i64 %170)
store i64 %171, i64* %19
%172 = load i64, i64* %21
%173 = load i64, i64* %19
%174 = icmp ne i64 %172, %173
br i1 %174, label %175, label %179
175: ; preds = %166
%176 = load i32*, i32** @stderr
%177 = load i64, i64* %19
%178 = call i32 (i32*, i8*, ...) @fprintf(i32* %176, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i64 %177)
br label %179
179: ; preds = %175, %166
%180 = load i64, i64* %19
%181 = mul i64 %180, 8
%182 = call i64 @malloc(i64 %181)
%183 = inttoptr i64 %182 to double*
store double* %183, double** %9
%184 = load i64, i64* %19
%185 = sdiv i64 %184, 2
%186 = add nsw i64 %185, 1
%187 = mul i64 %186, 8
%188 = call i64 @malloc(i64 %187)
%189 = inttoptr i64 %188 to double*
store double* %189, double** %8
%190 = load i64, i64* %19
%191 = mul i64 %190, 8
%192 = call i64 @malloc(i64 %191)
%193 = inttoptr i64 %192 to double*
store double* %193, double** %7
%194 = load double*, double** %9
%195 = icmp eq double* %194, null
br i1 %195, label %202, label %196
196: ; preds = %179
%197 = load double*, double** %8
%198 = icmp eq double* %197, null
br i1 %198, label %202, label %199
199: ; preds = %196
%200 = load double*, double** %7
%201 = icmp eq double* %200, null
br i1 %201, label %202, label %206
202: ; preds = %199, %196, %179
%203 = load i32*, i32** @stderr
%204 = call i32 (i32*, i8*, ...) @fprintf(i32* %203, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%205 = call i32 @exit(i32 5)
unreachable
206: ; preds = %199
%207 = load double*, double** %6
%208 = load i64, i64* %19
%209 = load double*, double** %8
%210 = call i32 @dft(double* %207, i64 %208, double* %209, i32* null)
store i64 0, i64* %22
br label %211
211: ; preds = %223, %206
%212 = load i64, i64* %22
%213 = load i64, i64* %19
%214 = icmp slt i64 %212, %213
br i1 %214, label %215, label %226
215: ; preds = %211
%216 = load double*, double** %6
%217 = load i64, i64* %22
%218 = getelementptr inbounds double, double* %216, i64 %217
%219 = load double, double* %218
%220 = load double*, double** %9
%221 = load i64, i64* %22
%222 = getelementptr inbounds double, double* %220, i64 %221
store double %219, double* %222
br label %223
223: ; preds = %215
%224 = load i64, i64* %22
%225 = add nsw i64 %224, 1
store i64 %225, i64* %22
br label %211
226: ; preds = %211
%227 = load i64, i64* %19
%228 = load double*, double** %9
%229 = call i32 @sort(i64 %227, double* %228)
store i64 0, i64* %22
br label %230
230: ; preds = %362, %226
%231 = load i64, i64* %22
%232 = load i64, i64* %15
%233 = icmp slt i64 %231, %232
br i1 %233, label %234, label %365
234: ; preds = %230
%235 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%236 = load i8, i8* %235
%237 = sext i8 %236 to i32
%238 = icmp ne i32 %237, 0
br i1 %238, label %239, label %262
239: ; preds = %234
%240 = load i64, i64* %15
%241 = icmp sgt i64 %240, 1
br i1 %241, label %242, label %249
242: ; preds = %239
%243 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%244 = load i64, i64* %24
%245 = getelementptr inbounds i8, i8* %243, i64 %244
%246 = load i64, i64* %22
%247 = add nsw i64 %246, 1
%248 = call i32 @sprintf(i8* %245, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i64 %247)
br label %249
249: ; preds = %242, %239
%250 = load i32*, i32** @stderr
%251 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%252 = call i32 (i32*, i8*, ...) @fprintf(i32* %250, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %251)
%253 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%254 = call i32* @fopen(i8* %253, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
store i32* %254, i32** %27
%255 = load i32*, i32** %27
%256 = icmp eq i32* %255, null
br i1 %256, label %257, label %261
257: ; preds = %249
%258 = load i32*, i32** @stderr
%259 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%260 = call i32 (i32*, i8*, ...) @fprintf(i32* %258, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %259)
store i32 5, i32* %3
br label %370
261: ; preds = %249
br label %262
262: ; preds = %261, %234
%263 = load i64, i64* %19
%264 = load double*, double** %6
%265 = load double*, double** %7
%266 = load double*, double** %9
%267 = load double*, double** %8
%268 = load i64, i64* %17
%269 = call i64 @pol_surr(i64 %263, double* %264, double* %265, double* %266, double* %267, i64 %268)
store i64 %269, i64* %18
store i64 0, i64* %21
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
store double 0.000000e+00, double* %12
br label %270
270: ; preds = %311, %262
%271 = load i64, i64* %21
%272 = load i64, i64* %19
%273 = icmp slt i64 %271, %272
br i1 %273, label %274, label %314
274: ; preds = %270
%275 = load double*, double** %6
%276 = load i64, i64* %21
%277 = getelementptr inbounds double, double* %275, i64 %276
%278 = load double, double* %277
%279 = load double, double* %10
%280 = fadd double %279, %278
store double %280, double* %10
%281 = load double*, double** %6
%282 = load i64, i64* %21
%283 = getelementptr inbounds double, double* %281, i64 %282
%284 = load double, double* %283
%285 = load double*, double** %6
%286 = load i64, i64* %21
%287 = getelementptr inbounds double, double* %285, i64 %286
%288 = load double, double* %287
%289 = load double, double* %11
%290 = call double @llvm.fmuladd.f64(double %284, double %288, double %289)
store double %290, double* %11
%291 = load double*, double** %6
%292 = load i64, i64* %21
%293 = getelementptr inbounds double, double* %291, i64 %292
%294 = load double, double* %293
%295 = load double*, double** %7
%296 = load i64, i64* %21
%297 = getelementptr inbounds double, double* %295, i64 %296
%298 = load double, double* %297
%299 = fsub double %294, %298
%300 = load double*, double** %6
%301 = load i64, i64* %21
%302 = getelementptr inbounds double, double* %300, i64 %301
%303 = load double, double* %302
%304 = load double*, double** %7
%305 = load i64, i64* %21
%306 = getelementptr inbounds double, double* %304, i64 %305
%307 = load double, double* %306
%308 = fsub double %303, %307
%309 = load double, double* %12
%310 = call double @llvm.fmuladd.f64(double %299, double %308, double %309)
store double %310, double* %12
br label %311
311: ; preds = %274
%312 = load i64, i64* %21
%313 = add nsw i64 %312, 1
store i64 %313, i64* %21
br label %270
314: ; preds = %270
%315 = load double, double* %11
%316 = load i64, i64* %19
%317 = sitofp i64 %316 to double
%318 = fdiv double %315, %317
%319 = load double, double* %10
%320 = load i64, i64* %19
%321 = sitofp i64 %320 to double
%322 = fdiv double %319, %321
%323 = load double, double* %10
%324 = load i64, i64* %19
%325 = sitofp i64 %324 to double
%326 = fdiv double %323, %325
%327 = fneg double %322
%328 = call double @llvm.fmuladd.f64(double %327, double %326, double %318)
%329 = call double @sqrt(double %328)
store double %329, double* %10
%330 = load double, double* %12
%331 = load i64, i64* %19
%332 = sitofp i64 %331 to double
%333 = fdiv double %330, %332
%334 = call double @sqrt(double %333)
store double %334, double* %12
%335 = load i32*, i32** @stderr
%336 = load i64, i64* %18
%337 = load double, double* %12
%338 = load double, double* %10
%339 = fdiv double %337, %338
%340 = call i32 (i32*, i8*, ...) @fprintf(i32* %335, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0), i64 %336, double %339)
store i64 0, i64* %21
br label %341
341: ; preds = %356, %314
%342 = load i64, i64* %21
%343 = load i64, i64* %19
%344 = icmp slt i64 %342, %343
br i1 %344, label %345, label %359
345: ; preds = %341
%346 = load i32*, i32** %27
%347 = load double*, double** %6
%348 = load i64, i64* %21
%349 = getelementptr inbounds double, double* %347, i64 %348
%350 = load double, double* %349
%351 = load double*, double** %7
%352 = load i64, i64* %21
%353 = getelementptr inbounds double, double* %351, i64 %352
%354 = load double, double* %353
%355 = call i32 (i32*, i8*, ...) @fprintf(i32* %346, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), double %350, double %354)
br label %356
356: ; preds = %345
%357 = load i64, i64* %21
%358 = add nsw i64 %357, 1
store i64 %358, i64* %21
br label %341
359: ; preds = %341
%360 = load i32*, i32** %27
%361 = call i32 @fclose(i32* %360)
br label %362
362: ; preds = %359
%363 = load i64, i64* %22
%364 = add nsw i64 %363, 1
store i64 %364, i64* %22
br label %230
365: ; preds = %230
%366 = load double*, double** %6
%367 = call i32 @free(double* %366)
%368 = load double*, double** %9
%369 = call i32 @free(double* %368)
store i32 0, i32* %3
br label %370
370: ; preds = %365, %257, %136, %86
%371 = load i32, i32* %3
ret i32 %371
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
@.str = [32 x i8] c"create iterative surrogate data\00"
@stderr = global i32* null
@.str.1 = [24 x i8] c"trying to open file %s\0A\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [21 x i8] c"cannot open file %s\0A\00"
@.str.4 = [6 x i8] c"stdin\00"
@.str.5 = [6 x i8] c"_surr\00"
@EOF = global i64 0
@.str.6 = [17 x i8] c"read %ld values\0A\00"
@.str.7 = [26 x i8] c"shortened to length: %ld\0A\00"
@.str.8 = [11 x i8] c"no memory\0A\00"
@.str.9 = [8 x i8] c"_%3.3ld\00"
@.str.10 = [4 x i8] c"%s \00"
@.str.11 = [2 x i8] c"w\00"
@.str.12 = [45 x i8] c"(%ld iterations, relative discrepancy %lf)\0A\00"
@.str.13 = [9 x i8] c"%lf %lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [512 x i8]
%4 = alloca i64
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%6 = bitcast i64* %4 to i8*
%7 = load i32*, i32** @stdin
%8 = load i32*, i32** @stdout
%9 = load i8*, i8** %1
%10 = tail call i32 @whatido(i32 %0, i8** %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = tail call i64 @lcan(i32 %0, i8** %1, i8 signext 108, i64 10000000)
%12 = tail call i64 @lcan(i32 %0, i8** %1, i8 signext 120, i64 0)
%13 = tail call i64 @lcan(i32 %0, i8** %1, i8 signext 99, i64 0)
%14 = tail call i64 @lcan(i32 %0, i8** %1, i8 signext 110, i64 1)
%15 = tail call i64 @lcan(i32 %0, i8** %1, i8 signext 105, i64 100000)
%16 = tail call i64 @lcan(i32 %0, i8** %1, i8 signext 73, i64 67654748)
%17 = sub nsw i64 0, %16
%18 = icmp eq i64 %16, 0
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = tail call i64 @time(i32* null)
br label %21
21: ; preds = %19, %2
%22 = phi i64 [ %20, %19 ], [ %17, %2 ]
%23 = tail call i32 @rnd_init(i64 %22)
%24 = call i8* @getout(i32 %0, i8** %1, i64* %4)
%25 = call i32 @nthstring(i32 %0, i8** %1, i32 1)
%26 = call i64 @getfile(i8* %5, i32 %25, i64 %13)
%27 = load i8, i8* %5
%28 = icmp eq i8 %27, 45
br i1 %28, label %29, label %30
29: ; preds = %21
store i8 0, i8* %5
br label %38
30: ; preds = %21
%31 = load i32*, i32** @stderr
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%33 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp eq i32* %33, null
br i1 %34, label %35, label %38
35: ; preds = %30
%36 = load i32*, i32** @stderr
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %36, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %5)
br label %362
38: ; preds = %30, %29
%39 = phi i32* [ %7, %29 ], [ %33, %30 ]
%40 = icmp sgt i64 %14, 1
br i1 %40, label %41, label %42
41: ; preds = %38
store i64 1, i64* %4
br label %45
42: ; preds = %38
%43 = load i64, i64* %4
%44 = icmp eq i64 %43, 0
br i1 %44, label %53, label %45
45: ; preds = %41, %42
%46 = load i8, i8* %5
%47 = icmp eq i8 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %50
50: ; preds = %48, %45
%51 = call i32 @putcol(i8* %5, i64 %26)
%52 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %54
53: ; preds = %42
store i8 0, i8* %5
br label %54
54: ; preds = %53, %50
%55 = load i8, i8* %24
%56 = icmp eq i8 %55, 0
br i1 %56, label %59, label %57
57: ; preds = %54
%58 = call i32 @strcpy(i8* %5, i8* %24)
br label %59
59: ; preds = %57, %54
%60 = call i64 @strlen(i8* %5)
%61 = icmp sgt i64 %12, 0
br i1 %61, label %66, label %64
62: ; preds = %66
%63 = icmp eq i64 %71, %12
br i1 %63, label %64, label %66
64: ; preds = %62, %59
%65 = call i64 @llvm.smax.i64(i64 %11, i64 0)
br label %72
66: ; preds = %59, %62
%67 = phi i64 [ %71, %62 ], [ 0, %59 ]
%68 = call i64 @readdum(i32* %39)
%69 = load i64, i64* @EOF
%70 = icmp eq i64 %68, %69
%71 = add nuw nsw i64 %67, 1
br i1 %70, label %362, label %62
72: ; preds = %64, %76
%73 = phi double* [ %80, %76 ], [ null, %64 ]
%74 = phi i64 [ %77, %76 ], [ 0, %64 ]
%75 = icmp eq i64 %74, %65
br i1 %75, label %87, label %76
76: ; preds = %72
%77 = add nuw i64 %74, 1
%78 = shl i64 %77, 3
%79 = call i64 @realloc(double* %73, i64 %78)
%80 = inttoptr i64 %79 to double*
%81 = getelementptr inbounds double, double* %80, i64 %74
%82 = call i64 @readval(i32* %39, double* %81, i64 %26)
%83 = load i64, i64* @EOF
%84 = icmp eq i64 %82, %83
br i1 %84, label %85, label %72
85: ; preds = %76
%86 = inttoptr i64 %79 to double*
br label %87
87: ; preds = %72, %85
%88 = phi i64 [ %74, %85 ], [ %65, %72 ]
%89 = phi double* [ %86, %85 ], [ %73, %72 ]
%90 = load i32*, i32** @stderr
%91 = call i32 (i32*, i8*, ...) @fprintf(i32* %90, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i64 %88)
%92 = call i64 @strip_primes(i64 %88)
%93 = icmp eq i64 %88, %92
br i1 %93, label %97, label %94
94: ; preds = %87
%95 = load i32*, i32** @stderr
%96 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i64 %92)
br label %97
97: ; preds = %94, %87
%98 = shl i64 %92, 3
%99 = call i64 @malloc(i64 %98)
%100 = inttoptr i64 %99 to double*
%101 = inttoptr i64 %99 to i8*
%102 = sdiv i64 %92, 2
%103 = shl i64 %102, 3
%104 = add i64 %103, 8
%105 = call i64 @malloc(i64 %104)
%106 = inttoptr i64 %105 to double*
%107 = call i64 @malloc(i64 %98)
%108 = inttoptr i64 %107 to double*
%109 = icmp eq i64 %99, 0
%110 = icmp eq i64 %105, 0
%111 = select i1 %109, i1 true, i1 %110
%112 = icmp eq i64 %107, 0
%113 = select i1 %111, i1 true, i1 %112
br i1 %113, label %114, label %118
114: ; preds = %97
%115 = load i32*, i32** @stderr
%116 = call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i64 10, i64 1, i32* %115)
%117 = call i32 @exit(i32 5)
unreachable
118: ; preds = %97
%119 = call i32 @dft(double* %89, i64 %92, double* %106, i32* null)
%120 = icmp sgt i64 %92, 0
br i1 %120, label %121, label %246
121: ; preds = %118
%122 = icmp ult i64 %92, 4
br i1 %122, label %209, label %123
123: ; preds = %121
%124 = getelementptr double, double* %100, i64 %92
%125 = getelementptr double, double* %89, i64 %92
%126 = bitcast double* %125 to i8*
%127 = icmp ult i8* %101, %126
%128 = icmp ult double* %89, %124
%129 = and i1 %127, %128
br i1 %129, label %209, label %130
130: ; preds = %123
%131 = and i64 %92, -4
%132 = add i64 %131, -4
%133 = lshr exact i64 %132, 2
%134 = add nuw nsw i64 %133, 1
%135 = and i64 %134, 3
%136 = icmp ult i64 %132, 12
br i1 %136, label %188, label %137
137: ; preds = %130
%138 = and i64 %134, 9223372036854775804
br label %139
139: ; preds = %139, %137
%140 = phi i64 [ 0, %137 ], [ %185, %139 ]
%141 = phi i64 [ 0, %137 ], [ %186, %139 ]
%142 = getelementptr inbounds double, double* %89, i64 %140
%143 = bitcast double* %142 to <2 x double>*
%144 = load <2 x double>, <2 x double>* %143
%145 = getelementptr inbounds double, double* %142, i64 2
%146 = bitcast double* %145 to <2 x double>*
%147 = load <2 x double>, <2 x double>* %146
%148 = getelementptr inbounds double, double* %100, i64 %140
%149 = bitcast double* %148 to <2 x double>*
store <2 x double> %144, <2 x double>* %149
%150 = getelementptr inbounds double, double* %148, i64 2
%151 = bitcast double* %150 to <2 x double>*
store <2 x double> %147, <2 x double>* %151
%152 = or i64 %140, 4
%153 = getelementptr inbounds double, double* %89, i64 %152
%154 = bitcast double* %153 to <2 x double>*
%155 = load <2 x double>, <2 x double>* %154
%156 = getelementptr inbounds double, double* %153, i64 2
%157 = bitcast double* %156 to <2 x double>*
%158 = load <2 x double>, <2 x double>* %157
%159 = getelementptr inbounds double, double* %100, i64 %152
%160 = bitcast double* %159 to <2 x double>*
store <2 x double> %155, <2 x double>* %160
%161 = getelementptr inbounds double, double* %159, i64 2
%162 = bitcast double* %161 to <2 x double>*
store <2 x double> %158, <2 x double>* %162
%163 = or i64 %140, 8
%164 = getelementptr inbounds double, double* %89, i64 %163
%165 = bitcast double* %164 to <2 x double>*
%166 = load <2 x double>, <2 x double>* %165
%167 = getelementptr inbounds double, double* %164, i64 2
%168 = bitcast double* %167 to <2 x double>*
%169 = load <2 x double>, <2 x double>* %168
%170 = getelementptr inbounds double, double* %100, i64 %163
%171 = bitcast double* %170 to <2 x double>*
store <2 x double> %166, <2 x double>* %171
%172 = getelementptr inbounds double, double* %170, i64 2
%173 = bitcast double* %172 to <2 x double>*
store <2 x double> %169, <2 x double>* %173
%174 = or i64 %140, 12
%175 = getelementptr inbounds double, double* %89, i64 %174
%176 = bitcast double* %175 to <2 x double>*
%177 = load <2 x double>, <2 x double>* %176
%178 = getelementptr inbounds double, double* %175, i64 2
%179 = bitcast double* %178 to <2 x double>*
%180 = load <2 x double>, <2 x double>* %179
%181 = getelementptr inbounds double, double* %100, i64 %174
%182 = bitcast double* %181 to <2 x double>*
store <2 x double> %177, <2 x double>* %182
%183 = getelementptr inbounds double, double* %181, i64 2
%184 = bitcast double* %183 to <2 x double>*
store <2 x double> %180, <2 x double>* %184
%185 = add nuw i64 %140, 16
%186 = add nuw i64 %141, 4
%187 = icmp eq i64 %186, %138
br i1 %187, label %188, label %139
188: ; preds = %139, %130
%189 = phi i64 [ 0, %130 ], [ %185, %139 ]
%190 = icmp eq i64 %135, 0
br i1 %190, label %207, label %191
191: ; preds = %188, %191
%192 = phi i64 [ %204, %191 ], [ %189, %188 ]
%193 = phi i64 [ %205, %191 ], [ 0, %188 ]
%194 = getelementptr inbounds double, double* %89, i64 %192
%195 = bitcast double* %194 to <2 x double>*
%196 = load <2 x double>, <2 x double>* %195
%197 = getelementptr inbounds double, double* %194, i64 2
%198 = bitcast double* %197 to <2 x double>*
%199 = load <2 x double>, <2 x double>* %198
%200 = getelementptr inbounds double, double* %100, i64 %192
%201 = bitcast double* %200 to <2 x double>*
store <2 x double> %196, <2 x double>* %201
%202 = getelementptr inbounds double, double* %200, i64 2
%203 = bitcast double* %202 to <2 x double>*
store <2 x double> %199, <2 x double>* %203
%204 = add nuw i64 %192, 4
%205 = add i64 %193, 1
%206 = icmp eq i64 %205, %135
br i1 %206, label %207, label %191
207: ; preds = %191, %188
%208 = icmp eq i64 %92, %131
br i1 %208, label %246, label %209
209: ; preds = %123, %121, %207
%210 = phi i64 [ 0, %123 ], [ 0, %121 ], [ %131, %207 ]
%211 = xor i64 %210, -1
%212 = add i64 %92, %211
%213 = and i64 %92, 3
%214 = icmp eq i64 %213, 0
br i1 %214, label %224, label %215
215: ; preds = %209, %215
%216 = phi i64 [ %221, %215 ], [ %210, %209 ]
%217 = phi i64 [ %222, %215 ], [ 0, %209 ]
%218 = getelementptr inbounds double, double* %89, i64 %216
%219 = load double, double* %218
%220 = getelementptr inbounds double, double* %100, i64 %216
store double %219, double* %220
%221 = add nuw nsw i64 %216, 1
%222 = add i64 %217, 1
%223 = icmp eq i64 %222, %213
br i1 %223, label %224, label %215
224: ; preds = %215, %209
%225 = phi i64 [ %210, %209 ], [ %221, %215 ]
%226 = icmp ult i64 %212, 3
br i1 %226, label %246, label %227
227: ; preds = %224, %227
%228 = phi i64 [ %244, %227 ], [ %225, %224 ]
%229 = getelementptr inbounds double, double* %89, i64 %228
%230 = load double, double* %229
%231 = getelementptr inbounds double, double* %100, i64 %228
store double %230, double* %231
%232 = add nuw nsw i64 %228, 1
%233 = getelementptr inbounds double, double* %89, i64 %232
%234 = load double, double* %233
%235 = getelementptr inbounds double, double* %100, i64 %232
store double %234, double* %235
%236 = add nuw nsw i64 %228, 2
%237 = getelementptr inbounds double, double* %89, i64 %236
%238 = load double, double* %237
%239 = getelementptr inbounds double, double* %100, i64 %236
store double %238, double* %239
%240 = add nuw nsw i64 %228, 3
%241 = getelementptr inbounds double, double* %89, i64 %240
%242 = load double, double* %241
%243 = getelementptr inbounds double, double* %100, i64 %240
store double %242, double* %243
%244 = add nuw nsw i64 %228, 4
%245 = icmp eq i64 %244, %92
br i1 %245, label %246, label %227
246: ; preds = %224, %227, %207, %118
%247 = call i32 @sort(i64 %92, double* %100)
%248 = icmp sgt i64 %14, 0
br i1 %248, label %249, label %359
249: ; preds = %246
%250 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 %60
%251 = sitofp i64 %92 to double
%252 = fdiv double 0.000000e+00, %251
%253 = fdiv double 0.000000e+00, %251
%254 = fneg double %253
%255 = call double @llvm.fmuladd.f64(double %254, double %253, double %252)
%256 = fdiv double 0.000000e+00, %251
%257 = and i64 %92, 1
%258 = icmp eq i64 %92, 1
%259 = and i64 %92, -2
%260 = icmp eq i64 %257, 0
br label %261
261: ; preds = %249, %355
%262 = phi i32* [ %8, %249 ], [ %279, %355 ]
%263 = phi i64 [ 0, %249 ], [ %357, %355 ]
%264 = load i8, i8* %5
%265 = icmp eq i8 %264, 0
br i1 %265, label %278, label %266
266: ; preds = %261
br i1 %40, label %267, label %270
267: ; preds = %266
%268 = add nuw nsw i64 %263, 1
%269 = call i32 @sprintf(i8* %250, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i64 %268)
br label %270
270: ; preds = %267, %266
%271 = load i32*, i32** @stderr
%272 = call i32 (i32*, i8*, ...) @fprintf(i32* %271, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %5)
%273 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%274 = icmp eq i32* %273, null
br i1 %274, label %275, label %278
275: ; preds = %270
%276 = load i32*, i32** @stderr
%277 = call i32 (i32*, i8*, ...) @fprintf(i32* %276, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %5)
br label %362
278: ; preds = %270, %261
%279 = phi i32* [ %273, %270 ], [ %262, %261 ]
%280 = call i64 @pol_surr(i64 %92, double* %89, double* %108, double* %100, double* %106, i64 %15)
br i1 %120, label %281, label %349
281: ; preds = %278
br i1 %258, label %309, label %282
282: ; preds = %281, %282
%283 = phi i64 [ %306, %282 ], [ 0, %281 ]
%284 = phi double [ %299, %282 ], [ 0.000000e+00, %281 ]
%285 = phi <2 x double> [ %305, %282 ], [ zeroinitializer, %281 ]
%286 = phi i64 [ %307, %282 ], [ 0, %281 ]
%287 = getelementptr inbounds double, double* %89, i64 %283
%288 = load double, double* %287
%289 = fadd double %284, %288
%290 = getelementptr inbounds double, double* %108, i64 %283
%291 = load double, double* %290
%292 = fsub double %288, %291
%293 = insertelement <2 x double> poison, double %288, i64 0
%294 = insertelement <2 x double> %293, double %292, i64 1
%295 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %294, <2 x double> %294, <2 x double> %285)
%296 = or i64 %283, 1
%297 = getelementptr inbounds double, double* %89, i64 %296
%298 = load double, double* %297
%299 = fadd double %289, %298
%300 = getelementptr inbounds double, double* %108, i64 %296
%301 = load double, double* %300
%302 = fsub double %298, %301
%303 = insertelement <2 x double> poison, double %298, i64 0
%304 = insertelement <2 x double> %303, double %302, i64 1
%305 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %304, <2 x double> %304, <2 x double> %295)
%306 = add nuw nsw i64 %283, 2
%307 = add i64 %286, 2
%308 = icmp eq i64 %307, %259
br i1 %308, label %309, label %282
309: ; preds = %282, %281
%310 = phi double [ undef, %281 ], [ %299, %282 ]
%311 = phi <2 x double> [ undef, %281 ], [ %305, %282 ]
%312 = phi i64 [ 0, %281 ], [ %306, %282 ]
%313 = phi double [ 0.000000e+00, %281 ], [ %299, %282 ]
%314 = phi <2 x double> [ zeroinitializer, %281 ], [ %305, %282 ]
br i1 %260, label %325, label %315
315: ; preds = %309
%316 = getelementptr inbounds double, double* %89, i64 %312
%317 = load double, double* %316
%318 = fadd double %313, %317
%319 = getelementptr inbounds double, double* %108, i64 %312
%320 = load double, double* %319
%321 = fsub double %317, %320
%322 = insertelement <2 x double> poison, double %317, i64 0
%323 = insertelement <2 x double> %322, double %321, i64 1
%324 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %323, <2 x double> %323, <2 x double> %314)
br label %325
325: ; preds = %309, %315
%326 = phi double [ %310, %309 ], [ %318, %315 ]
%327 = phi <2 x double> [ %311, %309 ], [ %324, %315 ]
%328 = extractelement <2 x double> %327, i64 0
%329 = fdiv double %328, %251
%330 = fdiv double %326, %251
%331 = fneg double %330
%332 = call double @llvm.fmuladd.f64(double %331, double %330, double %329)
%333 = call double @sqrt(double %332)
%334 = extractelement <2 x double> %327, i64 1
%335 = fdiv double %334, %251
%336 = call double @sqrt(double %335)
%337 = load i32*, i32** @stderr
%338 = fdiv double %336, %333
%339 = call i32 (i32*, i8*, ...) @fprintf(i32* %337, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0), i64 %280, double %338)
br i1 %120, label %340, label %355
340: ; preds = %325, %340
%341 = phi i64 [ %347, %340 ], [ 0, %325 ]
%342 = getelementptr inbounds double, double* %89, i64 %341
%343 = load double, double* %342
%344 = getelementptr inbounds double, double* %108, i64 %341
%345 = load double, double* %344
%346 = call i32 (i32*, i8*, ...) @fprintf(i32* %279, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), double %343, double %345)
%347 = add nuw nsw i64 %341, 1
%348 = icmp eq i64 %347, %92
br i1 %348, label %355, label %340
349: ; preds = %278
%350 = call double @sqrt(double %255)
%351 = call double @sqrt(double %256)
%352 = load i32*, i32** @stderr
%353 = fdiv double %351, %350
%354 = call i32 (i32*, i8*, ...) @fprintf(i32* %352, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0), i64 %280, double %353)
br label %355
355: ; preds = %340, %349, %325
%356 = call i32 @fclose(i32* %279)
%357 = add nuw nsw i64 %263, 1
%358 = icmp eq i64 %357, %14
br i1 %358, label %359, label %261
359: ; preds = %355, %246
%360 = call i32 @free(double* %89)
%361 = call i32 @free(double* %100)
br label %362
362: ; preds = %66, %359, %275, %35
%363 = phi i32 [ 5, %275 ], [ 0, %359 ], [ 5, %35 ], [ 4, %66 ]
ret i32 %363
}