#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*/ FFT(double *, int, int);
double atan2(double, double);
int atoi(char *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
double sqrt(double);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int main(int argc, char *argv[]) {
  FILE *fp;
  char linebuff[128];
  int i;
  int np;
  int nc;
  int nd;
  double *c;
  double *d;
  double mc, pc;
  double md, pd;
  if (argc < 4) {
    printf("\n rffr stands for 'recursive filter frequency response'.\n");
    printf(
        " This program will read a file containing the filter coefficients\n");
    printf(" of a recursive filter, putting the ck's in one array,\n");
    printf(" and the dk's in another array, each of size np, that is\n");
    printf(" padded with zeros. The FFT of each array is then taken.\n");
    printf(" The FFT's are divided, ci(omega)/di(omega), then the result\n");
    printf(" is put in an output file in terms of magnitude and phase.\n");
    printf(" The input file has the following structure: # of ck coeff's,\n");
    printf(" the ck coeff's, # of dk coeff's, the dk coeff's.\n");
    printf("\nUsage: rffr infile np outfile\n");
    printf("  infile = input file name\n");
    printf("  np = number of points wanted in FFT result\n");
    printf("  outfile = output file name\n");
    return (-1);
  }
  fp = fopen(argv[1], "r");
  if (fp == 0) {
    perror("Unable to open input file");
    return (-1);
  }
  np = atoi(argv[2]);
  printf("Reading input file: %s\n", argv[1]);
  for (i = 0; i < np; ++i) {
    fgets(linebuff, 128, fp);
    if (linebuff[0] != '#')
      break;
    printf("%s", linebuff);
  }
  c = (double *)calloc(2 * np, sizeof(double));
  d = (double *)calloc(2 * np, sizeof(double));
  sscanf(linebuff, "%d", &nc);
  for (i = 0; i < nc; ++i) {
    fscanf(fp, "%lf", &(c[2 * i]));
  }
  fscanf(fp, "%d", &nd);
  for (i = 0; i < nd; ++i) {
    fscanf(fp, "%lf", &(d[2 * i]));
  }
  fclose(fp);
  printf("Processing...\n");
  FFT(c, np, 1);
  FFT(d, np, 1);
  for (i = 0; i < np; ++i) {
    mc = sqrt(c[2 * i] * c[2 * i] + c[2 * i + 1] * c[2 * i + 1]);
    pc = atan2(c[2 * i + 1], c[2 * i]);
    md = sqrt(d[2 * i] * d[2 * i] + d[2 * i + 1] * d[2 * i + 1]);
    pd = atan2(d[2 * i + 1], d[2 * i]);
    c[2 * i] = mc / md;
    c[2 * i + 1] = pc - pd;
  }
  fp = fopen(argv[3], "w");
  if (fp == 0) {
    perror("Unable to open output file");
    return (-1);
  }
  printf("Writing output file: %s\n\n", argv[3]);
  fprintf(fp, "# This file is the output of the program rffr\n");
  fprintf(fp, "# The input file was: %s\n", argv[1]);
  fprintf(fp, "# Each line below contains first a magnitude, then a phase.\n");
  for (i = 0; i < np; ++i)
    fprintf(fp, "%lf %lf\n", c[2 * i], c[2 * i + 1]);
  fclose(fp);
  free(c);
  free(d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    12c5 <main+0xe5>
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf09(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf68(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf8d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xf9f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xfad(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xfcd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1818 <main+0x638>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xfc9(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1300 <main+0x120>
lea    0xfb0(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1818 <main+0x638>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0xa8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xf97(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xa8(%rbp),%eax
jge    1398 <main+0x1b8>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1080 <fgets@plt>
movsbl -0xa0(%rbp),%eax
cmp    $0x23,%eax
je     136f <main+0x18f>
jmp    1398 <main+0x1b8>
lea    -0xa0(%rbp),%rsi
lea    0xf54(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1333 <main+0x153>
mov    -0xa8(%rbp),%edi
shl    $0x1,%edi
mov    $0x8,%esi
call   1090 <calloc@plt>
mov    %rax,-0xb8(%rbp)
mov    -0xa8(%rbp),%edi
shl    $0x1,%edi
mov    $0x8,%esi
call   1090 <calloc@plt>
mov    %rax,-0xc0(%rbp)
lea    -0xa0(%rbp),%rdi
lea    0xefa(%rip),%rsi
lea    -0xac(%rbp),%rdx
call   10b0 <sscanf@plt>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xac(%rbp),%eax
jge    1441 <main+0x261>
mov    -0x18(%rbp),%rdi
mov    -0xb8(%rbp),%rdx
mov    -0xa4(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
lea    0xeb1(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    13f0 <main+0x210>
mov    -0x18(%rbp),%rdi
lea    0xe88(%rip),%rsi
lea    -0xb0(%rbp),%rdx
mov    $0x0,%al
call   1070 <fscanf@plt>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xb0(%rbp),%eax
jge    14b5 <main+0x2d5>
mov    -0x18(%rbp),%rdi
mov    -0xc0(%rbp),%rdx
mov    -0xa4(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
lea    0xe3d(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1464 <main+0x284>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xb8(%rbp),%rdi
mov    -0xa8(%rbp),%esi
mov    $0x1,%edx
call   10f0 <FFT@plt>
mov    -0xc0(%rbp),%rdi
mov    -0xa8(%rbp),%esi
mov    $0x1,%edx
call   10f0 <FFT@plt>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xa8(%rbp),%eax
jge    16f3 <main+0x513>
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1100 <sqrt@plt>
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,-0xd0(%rbp)
ff
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1100 <sqrt@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xc0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1040 <atan2@plt>
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
divsd  -0xd8(%rbp),%xmm0
ff
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0xd0(%rbp),%xmm0
ff
subsd  -0xe0(%rbp),%xmm0
ff
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1504 <main+0x324>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xbe8(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    172e <main+0x54e>
lea    0xbcf(%rip),%rdi
call   10d0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1818 <main+0x638>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
lea    0xbca(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xbd2(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xbe7(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xbef(%rip),%rsi
mov    $0x0,%al
call   10a0 <fprintf@plt>
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xa8(%rbp),%eax
jge    17f7 <main+0x617>
mov    -0x18(%rbp),%rdi
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xb8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xbcb(%rip),%rsi
mov    $0x2,%al
call   10a0 <fprintf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    178c <main+0x5ac>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc0(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
cmp    $0x3,%edi
jg     12c0 <main+0xc0>
lea    0xef9(%rip),%rdi
call   1040 <puts@plt>
lea    0xf26(%rip),%rdi
call   1040 <puts@plt>
lea    0xf5c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf87(%rip),%rdi
call   1040 <puts@plt>
lea    0xfb4(%rip),%rdi
call   1040 <puts@plt>
lea    0xfe1(%rip),%rdi
call   1040 <puts@plt>
lea    0x1012(%rip),%rdi
call   1040 <puts@plt>
lea    0x1041(%rip),%rdi
call   1040 <puts@plt>
lea    0x1073(%rip),%rdi
call   1040 <puts@plt>
lea    0x1099(%rip),%rdi
call   1040 <puts@plt>
lea    0x10ac(%rip),%rdi
call   1040 <puts@plt>
lea    0x10bb(%rip),%rdi
call   1040 <puts@plt>
lea    0x10dc(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%eax
jmp    160d <main+0x40d>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xd3a(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     161f <main+0x41f>
mov    %rax,%r13
mov    0x10(%rbx),%rdi
call   10f0 <atoi@plt>
mov    %eax,%r15d
mov    %rbx,0x20(%rsp)
mov    0x8(%rbx),%rsi
lea    0xd29(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
test   %r15d,%r15d
jle    1349 <main+0x149>
lea    0x30(%rsp),%rbx
lea    0xd29(%rip),%r14
mov    %r15d,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r13,%rdx
call   1090 <fgets@plt>
cmpb   $0x23,0x30(%rsp)
jne    1349 <main+0x149>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0xffffffff,%ebp
jne    1320 <main+0x120>
mov    %r15,0x18(%rsp)
lea    (%r15,%r15,1),%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   10a0 <calloc@plt>
mov    %rax,%r14
mov    %ebx,%edi
mov    $0x8,%esi
call   10a0 <calloc@plt>
mov    %rax,%r12
lea    0xcc8(%rip),%rsi
lea    0x30(%rsp),%rdi
lea    0xc(%rsp),%rdx
call   10c0 <sscanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    13c2 <main+0x1c2>
lea    0xcae(%rip),%r15
mov    %r14,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
add    $0x1,%rbp
movslq 0xc(%rsp),%rax
add    $0x10,%rbx
cmp    %rax,%rbp
jl     13a0 <main+0x1a0>
lea    0xc76(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %r13,%rdi
xor    %eax,%eax
call   1080 <fscanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1412 <main+0x212>
lea    0xc5c(%rip),%r15
mov    %r12,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
add    $0x1,%rbp
movslq 0x8(%rsp),%rax
add    $0x10,%rbx
cmp    %rax,%rbp
jl     13f0 <main+0x1f0>
mov    %r13,%rdi
call   1060 <fclose@plt>
lea    0xceb(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    0x18(%rsp),%rbx
mov    %ebx,%esi
mov    $0x1,%edx
call   1100 <FFT@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    $0x1,%edx
call   1100 <FFT@plt>
mov    %ebx,%r15d
test   %ebx,%ebx
jle    1533 <main+0x333>
mov    %r15,%rbx
shl    $0x4,%rbx
xor    %ebp,%ebp
jmp    14b1 <main+0x2b1>
nop
call   1110 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  (%r12,%rbp,1),%xmm1
movsd  0x8(%r12,%rbp,1),%xmm0
call   1050 <atan2@plt>
movsd  0x10(%rsp),%xmm1
movsd  %xmm1,(%r14,%rbp,1)
movsd  0x28(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14,%rbp,1)
add    $0x10,%rbp
cmp    %rbp,%rbx
je     1533 <main+0x333>
movsd  (%r14,%rbp,1),%xmm0
movsd  0x8(%r14,%rbp,1),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xb2e(%rip),%xmm0
jb     14e0 <main+0x2e0>
sqrtsd %xmm0,%xmm0
jmp    14e5 <main+0x2e5>
nopw   0x0(%rax,%rax,1)
call   1110 <sqrt@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%r14,%rbp,1),%xmm1
movsd  0x8(%r14,%rbp,1),%xmm0
call   1050 <atan2@plt>
movsd  %xmm0,0x28(%rsp)
movsd  (%r12,%rbp,1),%xmm0
movsd  0x8(%r12,%rbp,1),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xadc(%rip),%xmm0
jb     1460 <main+0x260>
sqrtsd %xmm0,%xmm0
jmp    1465 <main+0x265>
mov    0x20(%rsp),%rbx
mov    0x18(%rbx),%rdi
lea    0xb03(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     1628 <main+0x428>
mov    %rax,%rbp
mov    0x18(%rbx),%rsi
lea    0xb04(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xb10(%rip),%rdi
mov    $0x2e,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1120 <fwrite@plt>
mov    0x8(%rbx),%rdx
lea    0xb22(%rip),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   10b0 <fprintf@plt>
lea    0xb2b(%rip),%rdi
mov    $0x3c,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1120 <fwrite@plt>
cmpl   $0x0,0x18(%rsp)
jle    15f3 <main+0x3f3>
shl    $0x4,%r15
xor    %r13d,%r13d
lea    0xb41(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r14,%r13,1),%xmm0
movsd  0x8(%r14,%r13,1),%xmm1
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x2,%al
call   10b0 <fprintf@plt>
add    $0x10,%r13
cmp    %r13,%r15
jne    15d0 <main+0x3d0>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x9e4(%rip),%rdi
jmp    162f <main+0x42f>
lea    0xa19(%rip),%rdi
call   10e0 <perror@plt>
mov    $0xffffffff,%eax
jmp    160d <main+0x40d>

LLVM IR (-O0):
@.str = [58 x i8] c"\0A rffr stands for 'recursive filter frequency response'.\0A\00"
@.str.1 = [67 x i8] c" This program will read a file containing the filter coefficients\0A\00"
@.str.2 = [56 x i8] c" of a recursive filter, putting the ck's in one array,\0A\00"
@.str.3 = [58 x i8] c" and the dk's in another array, each of size np, that is\0A\00"
@.str.4 = [58 x i8] c" padded with zeros. The FFT of each array is then taken.\0A\00"
@.str.5 = [62 x i8] c" The FFT's are divided, ci(omega)/di(omega), then the result\0A\00"
@.str.6 = [60 x i8] c" is put in an output file in terms of magnitude and phase.\0A\00"
@.str.7 = [63 x i8] c" The input file has the following structure: # of ck coeff's,\0A\00"
@.str.8 = [51 x i8] c" the ck coeff's, # of dk coeff's, the dk coeff's.\0A\00"
@.str.9 = [32 x i8] c"\0AUsage: rffr infile np outfile\0A\00"
@.str.10 = [28 x i8] c" infile = input file name\0A\00"
@.str.11 = [46 x i8] c" np = number of points wanted in FFT result\0A\00"
@.str.12 = [30 x i8] c" outfile = output file name\0A\00"
@.str.13 = [2 x i8] c"r\00"
@.str.14 = [26 x i8] c"Unable to open input file\00"
@.str.15 = [24 x i8] c"Reading input file: %s\0A\00"
@.str.16 = [3 x i8] c"%s\00"
@.str.17 = [3 x i8] c"%d\00"
@.str.18 = [4 x i8] c"%lf\00"
@.str.19 = [15 x i8] c"Processing...\0A\00"
@.str.20 = [2 x i8] c"w\00"
@.str.21 = [27 x i8] c"Unable to open output file\00"
@.str.22 = [26 x i8] c"Writing output file: %s\0A\0A\00"
@.str.23 = [47 x i8] c"# This file is the output of the program rffr\0A\00"
@.str.24 = [26 x i8] c"# The input file was: %s\0A\00"
@.str.25 = [61 x i8] c"# Each line below contains first a magnitude, then a phase.\0A\00"
@.str.26 = [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 i32*
%7 = alloca [128 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 4
br i1 %19, label %20, label %34
20: ; preds = %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.5, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.7, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.8, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.11, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0))
store i32 -1, i32* %3
br label %289
34: ; preds = %2
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
store i32* %38, i32** %6
%39 = load i32*, i32** %6
%40 = icmp eq i32* %39, null
br i1 %40, label %41, label %43
41: ; preds = %34
%42 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0))
store i32 -1, i32* %3
br label %289
43: ; preds = %34
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = call i32 @atoi(i8* %46)
store i32 %47, i32* %9
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %50)
store i32 0, i32* %8
br label %52
52: ; preds = %68, %43
%53 = load i32, i32* %8
%54 = load i32, i32* %9
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %71
56: ; preds = %52
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%58 = load i32*, i32** %6
%59 = call i32 @fgets(i8* %57, i32 128, i32* %58)
%60 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp ne i32 %62, 35
br i1 %63, label %64, label %65
64: ; preds = %56
br label %71
65: ; preds = %56
%66 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i8* %66)
br label %68
68: ; preds = %65
%69 = load i32, i32* %8
%70 = add nsw i32 %69, 1
store i32 %70, i32* %8
br label %52
71: ; preds = %64, %52
%72 = load i32, i32* %9
%73 = mul nsw i32 2, %72
%74 = call i64 @calloc(i32 %73, i32 8)
%75 = inttoptr i64 %74 to double*
store double* %75, double** %12
%76 = load i32, i32* %9
%77 = mul nsw i32 2, %76
%78 = call i64 @calloc(i32 %77, i32 8)
%79 = inttoptr i64 %78 to double*
store double* %79, double** %13
%80 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%81 = call i32 @sscanf(i8* %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32* %10)
store i32 0, i32* %8
br label %82
82: ; preds = %94, %71
%83 = load i32, i32* %8
%84 = load i32, i32* %10
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %97
86: ; preds = %82
%87 = load i32*, i32** %6
%88 = load double*, double** %12
%89 = load i32, i32* %8
%90 = mul nsw i32 2, %89
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds double, double* %88, i64 %91
%93 = call i32 (i32*, i8*, ...) @fscanf(i32* %87, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), double* %92)
br label %94
94: ; preds = %86
%95 = load i32, i32* %8
%96 = add nsw i32 %95, 1
store i32 %96, i32* %8
br label %82
97: ; preds = %82
%98 = load i32*, i32** %6
%99 = call i32 (i32*, i8*, ...) @fscanf(i32* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32* %11)
store i32 0, i32* %8
br label %100
100: ; preds = %112, %97
%101 = load i32, i32* %8
%102 = load i32, i32* %11
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %115
104: ; preds = %100
%105 = load i32*, i32** %6
%106 = load double*, double** %13
%107 = load i32, i32* %8
%108 = mul nsw i32 2, %107
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds double, double* %106, i64 %109
%111 = call i32 (i32*, i8*, ...) @fscanf(i32* %105, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), double* %110)
br label %112
112: ; preds = %104
%113 = load i32, i32* %8
%114 = add nsw i32 %113, 1
store i32 %114, i32* %8
br label %100
115: ; preds = %100
%116 = load i32*, i32** %6
%117 = call i32 @fclose(i32* %116)
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0))
%119 = load double*, double** %12
%120 = load i32, i32* %9
%121 = call i32 @FFT(double* %119, i32 %120, i32 1)
%122 = load double*, double** %13
%123 = load i32, i32* %9
%124 = call i32 @FFT(double* %122, i32 %123, i32 1)
store i32 0, i32* %8
br label %125
125: ; preds = %233, %115
%126 = load i32, i32* %8
%127 = load i32, i32* %9
%128 = icmp slt i32 %126, %127
br i1 %128, label %129, label %236
129: ; preds = %125
%130 = load double*, double** %12
%131 = load i32, i32* %8
%132 = mul nsw i32 2, %131
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %130, i64 %133
%135 = load double, double* %134
%136 = load double*, double** %12
%137 = load i32, i32* %8
%138 = mul nsw i32 2, %137
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %136, i64 %139
%141 = load double, double* %140
%142 = load double*, double** %12
%143 = load i32, i32* %8
%144 = mul nsw i32 2, %143
%145 = add nsw i32 %144, 1
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %142, i64 %146
%148 = load double, double* %147
%149 = load double*, double** %12
%150 = load i32, i32* %8
%151 = mul nsw i32 2, %150
%152 = add nsw i32 %151, 1
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds double, double* %149, i64 %153
%155 = load double, double* %154
%156 = fmul double %148, %155
%157 = call double @llvm.fmuladd.f64(double %135, double %141, double %156)
%158 = call double @sqrt(double %157)
store double %158, double* %14
%159 = load double*, double** %12
%160 = load i32, i32* %8
%161 = mul nsw i32 2, %160
%162 = add nsw i32 %161, 1
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds double, double* %159, i64 %163
%165 = load double, double* %164
%166 = load double*, double** %12
%167 = load i32, i32* %8
%168 = mul nsw i32 2, %167
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %166, i64 %169
%171 = load double, double* %170
%172 = call double @atan2(double %165, double %171)
store double %172, double* %15
%173 = load double*, double** %13
%174 = load i32, i32* %8
%175 = mul nsw i32 2, %174
%176 = sext i32 %175 to i64
%177 = getelementptr inbounds double, double* %173, i64 %176
%178 = load double, double* %177
%179 = load double*, double** %13
%180 = load i32, i32* %8
%181 = mul nsw i32 2, %180
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %179, i64 %182
%184 = load double, double* %183
%185 = load double*, double** %13
%186 = load i32, i32* %8
%187 = mul nsw i32 2, %186
%188 = add nsw i32 %187, 1
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %185, i64 %189
%191 = load double, double* %190
%192 = load double*, double** %13
%193 = load i32, i32* %8
%194 = mul nsw i32 2, %193
%195 = add nsw i32 %194, 1
%196 = sext i32 %195 to i64
%197 = getelementptr inbounds double, double* %192, i64 %196
%198 = load double, double* %197
%199 = fmul double %191, %198
%200 = call double @llvm.fmuladd.f64(double %178, double %184, double %199)
%201 = call double @sqrt(double %200)
store double %201, double* %16
%202 = load double*, double** %13
%203 = load i32, i32* %8
%204 = mul nsw i32 2, %203
%205 = add nsw i32 %204, 1
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds double, double* %202, i64 %206
%208 = load double, double* %207
%209 = load double*, double** %13
%210 = load i32, i32* %8
%211 = mul nsw i32 2, %210
%212 = sext i32 %211 to i64
%213 = getelementptr inbounds double, double* %209, i64 %212
%214 = load double, double* %213
%215 = call double @atan2(double %208, double %214)
store double %215, double* %17
%216 = load double, double* %14
%217 = load double, double* %16
%218 = fdiv double %216, %217
%219 = load double*, double** %12
%220 = load i32, i32* %8
%221 = mul nsw i32 2, %220
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds double, double* %219, i64 %222
store double %218, double* %223
%224 = load double, double* %15
%225 = load double, double* %17
%226 = fsub double %224, %225
%227 = load double*, double** %12
%228 = load i32, i32* %8
%229 = mul nsw i32 2, %228
%230 = add nsw i32 %229, 1
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds double, double* %227, i64 %231
store double %226, double* %232
br label %233
233: ; preds = %129
%234 = load i32, i32* %8
%235 = add nsw i32 %234, 1
store i32 %235, i32* %8
br label %125
236: ; preds = %125
%237 = load i8**, i8*** %5
%238 = getelementptr inbounds i8*, i8** %237, i64 3
%239 = load i8*, i8** %238
%240 = call i32* @fopen(i8* %239, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
store i32* %240, i32** %6
%241 = load i32*, i32** %6
%242 = icmp eq i32* %241, null
br i1 %242, label %243, label %245
243: ; preds = %236
%244 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0))
store i32 -1, i32* %3
br label %289
245: ; preds = %236
%246 = load i8**, i8*** %5
%247 = getelementptr inbounds i8*, i8** %246, i64 3
%248 = load i8*, i8** %247
%249 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0), i8* %248)
%250 = load i32*, i32** %6
%251 = call i32 (i32*, i8*, ...) @fprintf(i32* %250, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.23, i64 0, i64 0))
%252 = load i32*, i32** %6
%253 = load i8**, i8*** %5
%254 = getelementptr inbounds i8*, i8** %253, i64 1
%255 = load i8*, i8** %254
%256 = call i32 (i32*, i8*, ...) @fprintf(i32* %252, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.24, i64 0, i64 0), i8* %255)
%257 = load i32*, i32** %6
%258 = call i32 (i32*, i8*, ...) @fprintf(i32* %257, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.25, i64 0, i64 0))
store i32 0, i32* %8
br label %259
259: ; preds = %279, %245
%260 = load i32, i32* %8
%261 = load i32, i32* %9
%262 = icmp slt i32 %260, %261
br i1 %262, label %263, label %282
263: ; preds = %259
%264 = load i32*, i32** %6
%265 = load double*, double** %12
%266 = load i32, i32* %8
%267 = mul nsw i32 2, %266
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds double, double* %265, i64 %268
%270 = load double, double* %269
%271 = load double*, double** %12
%272 = load i32, i32* %8
%273 = mul nsw i32 2, %272
%274 = add nsw i32 %273, 1
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds double, double* %271, i64 %275
%277 = load double, double* %276
%278 = call i32 (i32*, i8*, ...) @fprintf(i32* %264, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.26, i64 0, i64 0), double %270, double %277)
br label %279
279: ; preds = %263
%280 = load i32, i32* %8
%281 = add nsw i32 %280, 1
store i32 %281, i32* %8
br label %259
282: ; preds = %259
%283 = load i32*, i32** %6
%284 = call i32 @fclose(i32* %283)
%285 = load double*, double** %12
%286 = call i32 @free(double* %285)
%287 = load double*, double** %13
%288 = call i32 @free(double* %287)
br label %289
289: ; preds = %282, %243, %41, %20
%290 = load i32, i32* %3
ret i32 %290
}

LLVM IR (-O2):
@.str.13 = [2 x i8] c"r\00"
@.str.14 = [26 x i8] c"Unable to open input file\00"
@.str.15 = [24 x i8] c"Reading input file: %s\0A\00"
@.str.16 = [3 x i8] c"%s\00"
@.str.17 = [3 x i8] c"%d\00"
@.str.18 = [4 x i8] c"%lf\00"
@.str.20 = [2 x i8] c"w\00"
@.str.21 = [27 x i8] c"Unable to open output file\00"
@.str.22 = [26 x i8] c"Writing output file: %s\0A\0A\00"
@.str.23 = [47 x i8] c"# This file is the output of the program rffr\0A\00"
@.str.24 = [26 x i8] c"# The input file was: %s\0A\00"
@.str.25 = [61 x i8] c"# Each line below contains first a magnitude, then a phase.\0A\00"
@.str.26 = [9 x i8] c"%lf %lf\0A\00"
@str = [14 x i8] c"Processing...\00"
@str.27 = [57 x i8] c"\0A rffr stands for 'recursive filter frequency response'.\00"
@str.28 = [66 x i8] c" This program will read a file containing the filter coefficients\00"
@str.29 = [55 x i8] c" of a recursive filter, putting the ck's in one array,\00"
@str.30 = [57 x i8] c" and the dk's in another array, each of size np, that is\00"
@str.31 = [57 x i8] c" padded with zeros. The FFT of each array is then taken.\00"
@str.32 = [61 x i8] c" The FFT's are divided, ci(omega)/di(omega), then the result\00"
@str.33 = [59 x i8] c" is put in an output file in terms of magnitude and phase.\00"
@str.34 = [62 x i8] c" The input file has the following structure: # of ck coeff's,\00"
@str.35 = [50 x i8] c" the ck coeff's, # of dk coeff's, the dk coeff's.\00"
@str.36 = [31 x i8] c"\0AUsage: rffr infile np outfile\00"
@str.37 = [27 x i8] c" infile = input file name\00"
@str.38 = [45 x i8] c" np = number of points wanted in FFT result\00"
@str.39 = [29 x i8] c" outfile = output file name\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [128 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = icmp slt i32 %0, 4
br i1 %9, label %10, label %24
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.27, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.28, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.29, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.30, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.31, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.32, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.33, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.34, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.35, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.36, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.37, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.38, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.39, i64 0, i64 0))
br label %144
24: ; preds = %2
%25 = getelementptr inbounds i8*, i8** %1, i64 1
%26 = load i8*, i8** %25
%27 = tail call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0))
br label %144
31: ; preds = %24
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = tail call i32 @atoi(i8* %33)
%35 = load i8*, i8** %25
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %35)
%37 = icmp sgt i32 %34, 0
br i1 %37, label %38, label %47
38: ; preds = %31, %43
%39 = phi i32 [ %45, %43 ], [ 0, %31 ]
%40 = call i32 @fgets(i8* %6, i32 128, i32* %27)
%41 = load i8, i8* %6
%42 = icmp eq i8 %41, 35
br i1 %42, label %43, label %47
43: ; preds = %38
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0), i8* %6)
%45 = add nuw nsw i32 %39, 1
%46 = icmp eq i32 %45, %34
br i1 %46, label %47, label %38
47: ; preds = %43, %38, %31
%48 = shl nsw i32 %34, 1
%49 = call i64 @calloc(i32 %48, i32 8)
%50 = inttoptr i64 %49 to double*
%51 = call i64 @calloc(i32 %48, i32 8)
%52 = inttoptr i64 %51 to double*
%53 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32* %4)
%54 = load i32, i32* %4
%55 = icmp sgt i32 %54, 0
br i1 %55, label %56, label %65
56: ; preds = %47, %56
%57 = phi i64 [ %61, %56 ], [ 0, %47 ]
%58 = shl nuw nsw i64 %57, 1
%59 = getelementptr inbounds double, double* %50, i64 %58
%60 = call i32 (i32*, i8*, ...) @fscanf(i32* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), double* %59)
%61 = add nuw nsw i64 %57, 1
%62 = load i32, i32* %4
%63 = sext i32 %62 to i64
%64 = icmp slt i64 %61, %63
br i1 %64, label %56, label %65
65: ; preds = %56, %47
%66 = call i32 (i32*, i8*, ...) @fscanf(i32* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i32* %5)
%67 = load i32, i32* %5
%68 = icmp sgt i32 %67, 0
br i1 %68, label %69, label %78
69: ; preds = %65, %69
%70 = phi i64 [ %74, %69 ], [ 0, %65 ]
%71 = shl nuw nsw i64 %70, 1
%72 = getelementptr inbounds double, double* %52, i64 %71
%73 = call i32 (i32*, i8*, ...) @fscanf(i32* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), double* %72)
%74 = add nuw nsw i64 %70, 1
%75 = load i32, i32* %5
%76 = sext i32 %75 to i64
%77 = icmp slt i64 %74, %76
br i1 %77, label %69, label %78
78: ; preds = %69, %65
%79 = call i32 @fclose(i32* %27)
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%81 = call i32 @FFT(double* %50, i32 %34, i32 1)
%82 = call i32 @FFT(double* %52, i32 %34, i32 1)
br i1 %37, label %83, label %113
83: ; preds = %78
%84 = zext i32 %34 to i64
br label %85
85: ; preds = %83, %85
%86 = phi i64 [ 0, %83 ], [ %111, %85 ]
%87 = shl nuw nsw i64 %86, 1
%88 = getelementptr inbounds double, double* %50, i64 %87
%89 = load double, double* %88
%90 = or i64 %87, 1
%91 = getelementptr inbounds double, double* %50, i64 %90
%92 = load double, double* %91
%93 = fmul double %92, %92
%94 = call double @llvm.fmuladd.f64(double %89, double %89, double %93)
%95 = call double @sqrt(double %94)
%96 = load double, double* %91
%97 = load double, double* %88
%98 = call double @atan2(double %96, double %97)
%99 = getelementptr inbounds double, double* %52, i64 %87
%100 = load double, double* %99
%101 = getelementptr inbounds double, double* %52, i64 %90
%102 = load double, double* %101
%103 = fmul double %102, %102
%104 = call double @llvm.fmuladd.f64(double %100, double %100, double %103)
%105 = call double @sqrt(double %104)
%106 = load double, double* %101
%107 = load double, double* %99
%108 = call double @atan2(double %106, double %107)
%109 = fdiv double %95, %105
store double %109, double* %88
%110 = fsub double %98, %108
store double %110, double* %91
%111 = add nuw nsw i64 %86, 1
%112 = icmp eq i64 %111, %84
br i1 %112, label %113, label %85
113: ; preds = %85, %78
%114 = getelementptr inbounds i8*, i8** %1, i64 3
%115 = load i8*, i8** %114
%116 = call i32* @fopen(i8* %115, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%117 = icmp eq i32* %116, null
br i1 %117, label %118, label %120
118: ; preds = %113
%119 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0))
br label %144
120: ; preds = %113
%121 = load i8*, i8** %114
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.22, i64 0, i64 0), i8* %121)
%123 = call i64 @fwrite(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.23, i64 0, i64 0), i64 46, i64 1, i32* %116)
%124 = load i8*, i8** %25
%125 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.24, i64 0, i64 0), i8* %124)
%126 = call i64 @fwrite(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.25, i64 0, i64 0), i64 60, i64 1, i32* %116)
br i1 %37, label %127, label %140
127: ; preds = %120
%128 = zext i32 %34 to i64
br label %129
129: ; preds = %127, %129
%130 = phi i64 [ 0, %127 ], [ %138, %129 ]
%131 = shl nuw nsw i64 %130, 1
%132 = getelementptr inbounds double, double* %50, i64 %131
%133 = load double, double* %132
%134 = or i64 %131, 1
%135 = getelementptr inbounds double, double* %50, i64 %134
%136 = load double, double* %135
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.26, i64 0, i64 0), double %133, double %136)
%138 = add nuw nsw i64 %130, 1
%139 = icmp eq i64 %138, %128
br i1 %139, label %140, label %129
140: ; preds = %129, %120
%141 = call i32 @fclose(i32* %116)
%142 = call i32 @free(double* %50)
%143 = call i32 @free(double* %52)
br label %144
144: ; preds = %140, %118, %29, %10
%145 = phi i32 [ -1, %10 ], [ -1, %29 ], [ -1, %118 ], [ 0, %140 ]
ret i32 %145
}