#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 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 *, ...);
int /*<<< orphan*/ sscanf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  FILE *fp;
  char linebuff[128];
  int i, j;
  int nc;
  int nd;
  int sx;
  int nx;
  int ny;
  double *c;
  double *d;
  double *x;
  double *y;
  double s1;
  double s2;
  if (argc < 6) {
    printf("\n rdf stands for 'recursive digital filter'.\n");
    printf(" This program filters data from an input file, by use of\n");
    printf(" ck and dk coeff's read in from another input file.\n");
    printf(" All lines at top of input files starting with # are ignored.\n");
    printf("\n Usage: rdf infile_filter infile_data sx nx outfile\n");
    printf("  infile_filter = input file containing filter coefficients\n");
    printf("  infile_data = input file containing data to filter\n");
    printf("  sx = starting point (zero based) to begin reading data\n");
    printf("  nx = number of data points to filter\n");
    printf("  outfile = output file where filtered data is stored\n");
    return (-1);
  }
  fp = fopen(argv[1], "r");
  if (fp == 0) {
    perror("Unable to open input filter file");
    return (-1);
  }
  printf("Reading input file: %s\n", argv[1]);
  for (i = 0; i < 10000; ++i) {
    fgets(linebuff, 128, fp);
    if (linebuff[0] != '#')
      break;
    printf("%s", linebuff);
  }
  sscanf(linebuff, "%d", &nc);
  c = (double *)calloc(nc, sizeof(double));
  for (i = 0; i < nc; ++i) {
    fscanf(fp, "%lf", &(c[i]));
  }
  fscanf(fp, "%d", &nd);
  d = (double *)calloc(nd, sizeof(double));
  for (i = 0; i < nd; ++i) {
    fscanf(fp, "%lf", &(d[i]));
  }
  fclose(fp);
  fp = fopen(argv[2], "r");
  if (fp == 0) {
    perror("Unable to open input data file");
    return (-1);
  }
  sx = atoi(argv[3]);
  nx = atoi(argv[4]);
  printf("\nReading input file: %s\n", argv[2]);
  for (i = 0; i < 10000; ++i) {
    fgets(linebuff, 128, fp);
    if (linebuff[0] != '#')
      break;
    printf("%s", linebuff);
  }
  printf("\n");
  x = (double *)calloc(nx, sizeof(double));
  for (i = 0; i < sx; ++i) {
    fgets(linebuff, 128, fp);
  }
  sscanf(linebuff, "%lf", &(x[0]));
  for (i = 1; i < nx; ++i) {
    fscanf(fp, "%lf", &(x[i]));
  }
  fclose(fp);
  printf("Output file = %s\n", argv[5]);
  fp = fopen(argv[5], "w");
  if (fp == 0) {
    perror("Unable to open output file");
    return (-1);
  }
  fprintf(fp, "# %s  :program that created this file\n", argv[0]);
  fprintf(fp, "# %s  :input file 1, contains filter coeff's\n", argv[1]);
  fprintf(fp, "# %s  :input file 2, contains data that is being filtered\n",
          argv[2]);
  fprintf(fp, "# %d  :nx, number of points used in input data file\n", nx);
  ny = nx + nc;
  y = (double *)calloc(ny, sizeof(double));
  for (i = 0; i < ny; ++i) {
    s2 = 0.0;
    const char *sep = "";
    fprintf(stderr, "(");
    for (j = (i < nc ? 0 : i - nc + 1); j <= (i < nx ? i : nx - 1); ++j) {
      s2 += c[i - j] * x[j];
      fprintf(stderr, "%s%lf * %lf", sep, c[i - j], x[j]);
      sep = " + ";
    }
    s1 = 0.0;
    sep = "";
    fprintf(stderr, ") - (");
    for (j = (i < nd ? 0 : i - nd + 1); j < i; ++j) {
      s1 += d[i - j] * y[j];
      fprintf(stderr, "%s%lf * %lf", sep, d[i - j], y[j]);
      sep = " + ";
    }
    fprintf(stderr, ")\n");
    y[i] = s2 - s1;
    fprintf(fp, "%lf\n", y[i]);
  }
  fclose(fp);
  free(c);
  free(d);
  free(x);
  free(y);
  return (1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    126b <main+0xbb>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf21(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1a6c <main+0x8bc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xfa4(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12a6 <main+0xf6>
lea    0xf8b(%rip),%rdi
call   10c0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1a6c <main+0x8bc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xfb2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x2710,-0xa4(%rbp)
jge    1329 <main+0x179>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1070 <fgets@plt>
movsbl -0xa0(%rbp),%eax
cmp    $0x23,%eax
je     1300 <main+0x150>
jmp    1329 <main+0x179>
lea    -0xa0(%rbp),%rsi
lea    0xf33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    12c6 <main+0x116>
lea    -0xa0(%rbp),%rdi
lea    0xf0d(%rip),%rsi
lea    -0xac(%rbp),%rdx
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    -0xac(%rbp),%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,-0xc8(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xac(%rbp),%eax
jge    13b3 <main+0x203>
mov    -0x18(%rbp),%rdi
mov    -0xc8(%rbp),%rdx
movslq -0xa4(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xfe3(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1366 <main+0x1b6>
mov    -0x18(%rbp),%rdi
lea    0xe86(%rip),%rsi
lea    -0xb0(%rbp),%rdx
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0xb0(%rbp),%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,-0xd0(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xb0(%rbp),%eax
jge    143a <main+0x28a>
mov    -0x18(%rbp),%rdi
mov    -0xd0(%rbp),%rdx
movslq -0xa4(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xf5c(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    13ed <main+0x23d>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdcc(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    147e <main+0x2ce>
lea    0xdda(%rip),%rdi
call   10c0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1a6c <main+0x8bc>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0xb4(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0xb8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x2710,-0xa4(%rbp)
jge    1527 <main+0x377>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1070 <fgets@plt>
movsbl -0xa0(%rbp),%eax
cmp    $0x23,%eax
je     14fe <main+0x34e>
jmp    1527 <main+0x377>
lea    -0xa0(%rbp),%rsi
lea    0xd35(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    14c4 <main+0x314>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xb8(%rbp),%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,-0xd8(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xb4(%rbp),%eax
jge    1591 <main+0x3e1>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   1070 <fgets@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1556 <main+0x3a6>
lea    -0xa0(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
lea    0xdd5(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
movl   $0x1,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xb8(%rbp),%eax
jge    1604 <main+0x454>
mov    -0x18(%rbp),%rdi
mov    -0xd8(%rbp),%rdx
movslq -0xa4(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
lea    0xd92(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    15b7 <main+0x407>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rsi
lea    0xc63(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
lea    0xc5f(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    165e <main+0x4ae>
lea    0xc46(%rip),%rdi
call   10c0 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1a6c <main+0x8bc>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xc3e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xc4b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xc5f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xb8(%rbp),%edx
lea    0xc82(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xb8(%rbp),%eax
add    -0xac(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0xbc(%rbp),%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,-0xe0(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xbc(%rbp),%eax
jge    1a2c <main+0x87c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
lea    0xc71(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    0x28b8(%rip),%rax
movslq (%rax),%rdi
lea    0xc55(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xa4(%rbp),%eax
cmp    -0xac(%rbp),%eax
jge    1758 <main+0x5a8>
xor    %eax,%eax
mov    %eax,-0xfc(%rbp)
jmp    176d <main+0x5bd>
mov    -0xa4(%rbp),%eax
sub    -0xac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfc(%rbp)
mov    -0xfc(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
mov    %eax,-0x100(%rbp)
mov    -0xa4(%rbp),%eax
cmp    -0xb8(%rbp),%eax
jge    17a8 <main+0x5f8>
mov    -0xa4(%rbp),%eax
mov    %eax,-0x104(%rbp)
jmp    17b7 <main+0x607>
mov    -0xb8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x104(%rbp)
mov    -0x100(%rbp),%eax
mov    -0x104(%rbp),%ecx
cmp    %ecx,%eax
jg     1880 <main+0x6d0>
mov    -0xc8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
sub    -0xa8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xd8(%rbp),%rax
movslq -0xa8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xf0(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
mov    0x27c8(%rip),%rax
movslq (%rax),%rdi
mov    -0xf8(%rbp),%rdx
mov    -0xc8(%rbp),%rax
mov    -0xa4(%rbp),%ecx
sub    -0xa8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xd8(%rbp),%rax
movslq -0xa8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0xb1c(%rip),%rsi
mov    $0x2,%al
call   1090 <fprintf@plt>
lea    0xb1a(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    1779 <main+0x5c9>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
lea    0xaf9(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    0x2740(%rip),%rax
movslq (%rax),%rdi
lea    0xad9(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xa4(%rbp),%eax
cmp    -0xb0(%rbp),%eax
jge    18d0 <main+0x720>
xor    %eax,%eax
mov    %eax,-0x108(%rbp)
jmp    18e5 <main+0x735>
mov    -0xa4(%rbp),%eax
sub    -0xb0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x108(%rbp)
mov    -0x108(%rbp),%eax
mov    %eax,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jge    19b8 <main+0x808>
mov    -0xd0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
sub    -0xa8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xe0(%rbp),%rax
movslq -0xa8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0xe8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
mov    0x2690(%rip),%rax
movslq (%rax),%rdi
mov    -0xf8(%rbp),%rdx
mov    -0xd0(%rbp),%rax
mov    -0xa4(%rbp),%ecx
sub    -0xa8(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0xe0(%rbp),%rax
movslq -0xa8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
lea    0x9e4(%rip),%rsi
mov    $0x2,%al
call   1090 <fprintf@plt>
lea    0x9e2(%rip),%rax
mov    %rax,-0xf8(%rbp)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    18f1 <main+0x741>
mov    0x2621(%rip),%rax
movslq (%rax),%rdi
lea    0x9c0(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movsd  -0xf0(%rbp),%xmm0
ff
subsd  -0xe8(%rbp),%xmm0
ff
mov    -0xe0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdi
mov    -0xe0(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0x97b(%rip),%rsi
mov    $0x1,%al
call   1090 <fprintf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    16f6 <main+0x546>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xd0(%rbp),%rdi
call   1030 <free@plt>
mov    -0xd8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xe0(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
cmp    $0x5,%edi
jg     128c <main+0x9c>
lea    0xf68(%rip),%rdi
call   1050 <puts@plt>
lea    0xf89(%rip),%rdi
call   1050 <puts@plt>
lea    0xfb6(%rip),%rdi
call   1050 <puts@plt>
lea    0xfde(%rip),%rdi
call   1050 <puts@plt>
lea    0x1010(%rip),%rdi
call   1050 <puts@plt>
lea    0x1039(%rip),%rdi
call   1050 <puts@plt>
lea    0x1069(%rip),%rdi
call   1050 <puts@plt>
lea    0x1092(%rip),%rdi
call   1050 <puts@plt>
lea    0x10bf(%rip),%rdi
call   1050 <puts@plt>
lea    0x10da(%rip),%rdi
call   1050 <puts@plt>
mov    $0xffffffff,%eax
jmp    191e <main+0x72e>
mov    %rsi,%r13
mov    0x8(%rsi),%rdi
lea    0x105b(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1930 <main+0x740>
mov    %rax,%r12
mov    0x8(%r13),%rsi
lea    0xd99(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x2710,%ebp
lea    0x80(%rsp),%r15
lea    0xd58(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x80,%esi
mov    %r12,%rdx
call   10a0 <fgets@plt>
cmpb   $0x23,0x80(%rsp)
23
jne    130c <main+0x11c>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0xffffffff,%ebp
jne    12e0 <main+0xf0>
lea    0xd19(%rip),%rsi
lea    0x80(%rsp),%rdi
mov    %rsp,%rdx
xor    %eax,%eax
call   10d0 <sscanf@plt>
mov    (%rsp),%edi
mov    $0x8,%esi
call   10b0 <calloc@plt>
mov    %rax,0x28(%rsp)
cmpl   $0x0,(%rsp)
jle    1371 <main+0x181>
lea    0xe1f(%rip),%r14
mov    0x28(%rsp),%rbp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
add    $0x1,%rbx
movslq (%rsp),%rax
add    $0x8,%rbp
cmp    %rax,%rbx
jl     1350 <main+0x160>
lea    0xcb4(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %r12,%rdi
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x4(%rsp),%edi
mov    $0x8,%esi
call   10b0 <calloc@plt>
mov    %rax,0x20(%rsp)
cmpl   $0x0,0x4(%rsp)
jle    13d2 <main+0x1e2>
lea    0xdbb(%rip),%r14
mov    0x20(%rsp),%rbp
xor    %ebx,%ebx
nop
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
add    $0x1,%rbx
movslq 0x4(%rsp),%rax
add    $0x8,%rbp
cmp    %rax,%rbx
jl     13b0 <main+0x1c0>
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    0x10(%r13),%rdi
lea    0xf10(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1939 <main+0x749>
mov    %rax,%r14
mov    0x18(%r13),%rdi
call   1100 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%r13),%rdi
call   1100 <atoi@plt>
mov    %rax,0x10(%rsp)
mov    0x10(%r13),%rsi
lea    0xc34(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x2710,%ebx
lea    0x80(%rsp),%r15
lea    0xbf4(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
call   10a0 <fgets@plt>
cmpb   $0x23,0x80(%rsp)
23
jne    146c <main+0x27c>
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
add    $0xffffffff,%ebx
jne    1440 <main+0x250>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x10(%rsp),%rdi
mov    $0x8,%esi
call   10b0 <calloc@plt>
mov    %rax,0x18(%rsp)
test   %ebp,%ebp
jle    14b5 <main+0x2c5>
lea    0x80(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
call   10a0 <fgets@plt>
add    $0xffffffff,%ebp
jne    14a0 <main+0x2b0>
lea    0xca7(%rip),%rsi
lea    0x80(%rsp),%rdi
mov    0x18(%rsp),%rdx
xor    %eax,%eax
call   10d0 <sscanf@plt>
cmpl   $0x2,0x10(%rsp)
jl     150a <main+0x31a>
mov    0x10(%rsp),%ebx
mov    0x18(%rsp),%rax
lea    0x8(%rax),%rbp
add    $0xffffffffffffffff,%rbx
lea    0xc74(%rip),%r15
nop
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
add    $0x8,%rbp
add    $0xffffffffffffffff,%rbx
jne    14f0 <main+0x300>
mov    %r14,%rdi
call   1060 <fclose@plt>
mov    0x28(%r13),%rsi
lea    0xb4a(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x28(%r13),%rdi
lea    0xb4a(%rip),%rsi
call   10e0 <fopen@plt>
test   %rax,%rax
je     1942 <main+0x752>
mov    %rax,%rbp
mov    0x0(%r13),%rdx
lea    0xb4b(%rip),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    0x8(%r13),%rdx
lea    0xb5d(%rip),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    0x10(%r13),%rdx
lea    0xb76(%rip),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   10c0 <fprintf@plt>
lea    0xba0(%rip),%rsi
mov    %rbp,%rdi
mov    0x10(%rsp),%r14
mov    %r14d,%edx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    (%rsp),%r15d
lea    (%r14,%r15,1),%edi
mov    $0x8,%esi
call   10b0 <calloc@plt>
mov    %rax,%r13
add    %r14d,%r15d
jle    18eb <main+0x6fb>
mov    0x10(%rsp),%rax
movslq %eax,%rcx
mov    %rcx,0x70(%rsp)
add    $0xffffffff,%eax
mov    %rax,0x10(%rsp)
mov    %r15d,%eax
mov    %rax,0x68(%rsp)
mov    0x18(%rsp),%rax
add    $0x8,%rax
mov    %rax,0x60(%rsp)
mov    0x28(%rsp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,0x48(%rsp)
mov    0x20(%rsp),%rcx
add    $0xfffffffffffffff8,%rcx
mov    0x29e1(%rip),%r12
xor    %eax,%eax
mov    %rbp,0x78(%rsp)
mov    %r13,0x40(%rsp)
jmp    1693 <main+0x4a3>
mov    0x29c9(%rip),%r12
mov    0x30(%rsp),%r15
mov    0x40(%rsp),%r13
movsd  0x38(%rsp),%xmm3
movsd  0x8(%rsp),%xmm0
subsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%rsp)
movslq (%r12),%rcx
mov    $0x2,%esi
mov    $0x1,%edx
lea    0xb25(%rip),%rdi
call   1110 <fwrite@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x0(%r13,%r15,8)
mov    0x78(%rsp),%rbp
mov    %rbp,%rdi
lea    0xb07(%rip),%rsi
mov    $0x1,%al
call   10c0 <fprintf@plt>
addq   $0x8,0x48(%rsp)
mov    0x50(%rsp),%rcx
add    $0x8,%rcx
mov    0x58(%rsp),%rax
cmp    0x68(%rsp),%rax
je     18eb <main+0x6fb>
mov    %rcx,0x50(%rsp)
mov    %rax,%rbp
movslq (%r12),%rsi
mov    $0x28,%edi
call   1090 <fputc@plt>
movslq (%rsp),%rax
lea    0x1(%rbp),%rcx
mov    %rcx,0x58(%rsp)
mov    %ecx,%ebx
sub    %eax,%ebx
cmp    %rax,%rbp
mov    $0x0,%eax
cmovl  %eax,%ebx
cmp    0x70(%rsp),%rbp
mov    0x10(%rsp),%rax
mov    %eax,%r13d
mov    %rbp,0x30(%rsp)
cmovl  %ebp,%r13d
mov    %ebx,%r14d
xorpd  %xmm3,%xmm3
sub    %r13d,%r14d
lea    0xa6f(%rip),%rbp
jg     17d6 <main+0x5e6>
movslq %ebx,%r15
mov    0x30(%rsp),%rax
sub    %r15,%rax
mov    0x28(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm0
mov    0x18(%rsp),%rax
movsd  (%rax,%r15,8),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  0x8de(%rip),%xmm2
movsd  %xmm2,0x8(%rsp)
movslq (%r12),%rdi
mov    %rbp,%rsi
lea    0xa3d(%rip),%rdx
mov    $0x2,%al
call   10c0 <fprintf@plt>
cmp    %ebx,%r13d
jne    1760 <main+0x570>
mov    0x2897(%rip),%r12
lea    0xa0b(%rip),%rbp
movsd  0x8(%rsp),%xmm3
jmp    17d6 <main+0x5e6>
nopl   0x0(%rax,%rax,1)
mov    0x60(%rsp),%rax
lea    (%rax,%r15,8),%r13
shl    $0x3,%r15
mov    0x48(%rsp),%rbx
sub    %r15,%rbx
xor    %r15d,%r15d
mov    0x2861(%rip),%r12
lea    0x9d5(%rip),%rbp
movsd  0x8(%rsp),%xmm3
nopl   0x0(%rax)
movsd  (%rbx,%r15,8),%xmm0
movsd  0x0(%r13),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm3
movsd  %xmm3,0x8(%rsp)
movslq (%r12),%rdi
mov    %rbp,%rsi
lea    0x9ab(%rip),%rdx
mov    $0x2,%al
call   10c0 <fprintf@plt>
movsd  0x8(%rsp),%xmm3
add    $0x8,%r13
add    $0xffffffffffffffff,%r15
cmp    %r15d,%r14d
jne    1790 <main+0x5a0>
movsd  %xmm3,0x8(%rsp)
movslq (%r12),%rcx
mov    $0x5,%esi
mov    $0x1,%edx
lea    0x97a(%rip),%rdi
call   1110 <fwrite@plt>
movslq 0x4(%rsp),%rax
mov    0x58(%rsp),%rcx
sub    %eax,%ecx
mov    0x30(%rsp),%r15
cmp    %rax,%r15
movslq %ecx,%rax
mov    $0x0,%r14d
cmovge %rax,%r14
xorpd  %xmm3,%xmm3
mov    %r15,%rax
sub    %r14,%rax
mov    0x40(%rsp),%r13
jle    1627 <main+0x437>
mov    0x20(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  0x0(%r13,%r14,8),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  0x7b3(%rip),%xmm2
movsd  %xmm2,0x38(%rsp)
movslq (%r12),%rdi
mov    %rbp,%rsi
lea    0x912(%rip),%rdx
mov    $0x2,%al
call   10c0 <fprintf@plt>
lea    0x1(%r14),%rbx
cmp    %r15,%rbx
je     1610 <main+0x420>
shl    $0x3,%r14
mov    0x50(%rsp),%rbp
sub    %r14,%rbp
mov    0x2758(%rip),%r12
lea    0x8d8(%rip),%r14
mov    0x30(%rsp),%r15
mov    0x40(%rsp),%r13
movsd  0x38(%rsp),%xmm3
nop
movsd  0x0(%rbp),%xmm0
movsd  0x0(%r13,%rbx,8),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm3
movsd  %xmm3,0x38(%rsp)
movslq (%r12),%rdi
lea    0x892(%rip),%rsi
mov    %r14,%rdx
mov    $0x2,%al
call   10c0 <fprintf@plt>
movsd  0x38(%rsp),%xmm3
add    $0x1,%rbx
add    $0xfffffffffffffff8,%rbp
cmp    %rbx,%r15
jne    18a0 <main+0x6b0>
jmp    1627 <main+0x437>
mov    %rbp,%rdi
call   1060 <fclose@plt>
mov    0x28(%rsp),%rdi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x6d1(%rip),%rdi
jmp    1949 <main+0x759>
lea    0x6ef(%rip),%rdi
jmp    1949 <main+0x759>
lea    0x732(%rip),%rdi
call   10f0 <perror@plt>
mov    $0xffffffff,%eax
jmp    191e <main+0x72e>

LLVM IR (-O0):
@.str = [46 x i8] c"\0A rdf stands for 'recursive digital filter'.\0A\00"
@.str.1 = [58 x i8] c" This program filters data from an input file, by use of\0A\00"
@.str.2 = [53 x i8] c" ck and dk coeff's read in from another input file.\0A\00"
@.str.3 = [63 x i8] c" All lines at top of input files starting with # are ignored.\0A\00"
@.str.4 = [54 x i8] c"\0A Usage: rdf infile_filter infile_data sx nx outfile\0A\00"
@.str.5 = [61 x i8] c" infile_filter = input file containing filter coefficients\0A\00"
@.str.6 = [54 x i8] c" infile_data = input file containing data to filter\0A\00"
@.str.7 = [58 x i8] c" sx = starting point (zero based) to begin reading data\0A\00"
@.str.8 = [40 x i8] c" nx = number of data points to filter\0A\00"
@.str.9 = [55 x i8] c" outfile = output file where filtered data is stored\0A\00"
@.str.10 = [2 x i8] c"r\00"
@.str.11 = [33 x i8] c"Unable to open input filter file\00"
@.str.12 = [24 x i8] c"Reading input file: %s\0A\00"
@.str.13 = [3 x i8] c"%s\00"
@.str.14 = [3 x i8] c"%d\00"
@.str.15 = [4 x i8] c"%lf\00"
@.str.16 = [31 x i8] c"Unable to open input data file\00"
@.str.17 = [25 x i8] c"\0AReading input file: %s\0A\00"
@.str.18 = [2 x i8] c"\0A\00"
@.str.19 = [18 x i8] c"Output file = %s\0A\00"
@.str.20 = [2 x i8] c"w\00"
@.str.21 = [27 x i8] c"Unable to open output file\00"
@.str.22 = [39 x i8] c"# %s :program that created this file\0A\00"
@.str.23 = [46 x i8] c"# %s :input file 1, contains filter coeff's\0A\00"
@.str.24 = [59 x i8] c"# %s :input file 2, contains data that is being filtered\0A\00"
@.str.25 = [53 x i8] c"# %d :nx, number of points used in input data file\0A\00"
@.str.26 = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.27 = [2 x i8] c"(\00"
@.str.28 = [12 x i8] c"%s%lf * %lf\00"
@.str.29 = [4 x i8] c" + \00"
@.str.30 = [6 x i8] c") - (\00"
@.str.31 = [3 x i8] c")\0A\00"
@.str.32 = [5 x i8] c"%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 i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double
%20 = alloca double
%21 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 6
br i1 %23, label %24, label %35
24: ; preds = %2
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.5, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
store i32 -1, i32* %3
br label %380
35: ; preds = %2
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32* @fopen(i8* %38, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %39, i32** %6
%40 = load i32*, i32** %6
%41 = icmp eq i32* %40, null
br i1 %41, label %42, label %44
42: ; preds = %35
%43 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
store i32 -1, i32* %3
br label %380
44: ; preds = %35
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 1
%47 = load i8*, i8** %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* %47)
store i32 0, i32* %8
br label %49
49: ; preds = %64, %44
%50 = load i32, i32* %8
%51 = icmp slt i32 %50, 10000
br i1 %51, label %52, label %67
52: ; preds = %49
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%54 = load i32*, i32** %6
%55 = call i32 @fgets(i8* %53, i32 128, i32* %54)
%56 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = icmp ne i32 %58, 35
br i1 %59, label %60, label %61
60: ; preds = %52
br label %67
61: ; preds = %52
%62 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %62)
br label %64
64: ; preds = %61
%65 = load i32, i32* %8
%66 = add nsw i32 %65, 1
store i32 %66, i32* %8
br label %49
67: ; preds = %60, %49
%68 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%69 = call i32 (i8*, i8*, ...) @sscanf(i8* %68, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %10)
%70 = load i32, i32* %10
%71 = call i64 @calloc(i32 %70, i32 8)
%72 = inttoptr i64 %71 to double*
store double* %72, double** %15
store i32 0, i32* %8
br label %73
73: ; preds = %84, %67
%74 = load i32, i32* %8
%75 = load i32, i32* %10
%76 = icmp slt i32 %74, %75
br i1 %76, label %77, label %87
77: ; preds = %73
%78 = load i32*, i32** %6
%79 = load double*, double** %15
%80 = load i32, i32* %8
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double, double* %79, i64 %81
%83 = call i32 (i32*, i8*, ...) @fscanf(i32* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double* %82)
br label %84
84: ; preds = %77
%85 = load i32, i32* %8
%86 = add nsw i32 %85, 1
store i32 %86, i32* %8
br label %73
87: ; preds = %73
%88 = load i32*, i32** %6
%89 = call i32 (i32*, i8*, ...) @fscanf(i32* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %11)
%90 = load i32, i32* %11
%91 = call i64 @calloc(i32 %90, i32 8)
%92 = inttoptr i64 %91 to double*
store double* %92, double** %16
store i32 0, i32* %8
br label %93
93: ; preds = %104, %87
%94 = load i32, i32* %8
%95 = load i32, i32* %11
%96 = icmp slt i32 %94, %95
br i1 %96, label %97, label %107
97: ; preds = %93
%98 = load i32*, i32** %6
%99 = load double*, double** %16
%100 = load i32, i32* %8
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %99, i64 %101
%103 = call i32 (i32*, i8*, ...) @fscanf(i32* %98, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double* %102)
br label %104
104: ; preds = %97
%105 = load i32, i32* %8
%106 = add nsw i32 %105, 1
store i32 %106, i32* %8
br label %93
107: ; preds = %93
%108 = load i32*, i32** %6
%109 = call i32 @fclose(i32* %108)
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 2
%112 = load i8*, i8** %111
%113 = call i32* @fopen(i8* %112, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %113, i32** %6
%114 = load i32*, i32** %6
%115 = icmp eq i32* %114, null
br i1 %115, label %116, label %118
116: ; preds = %107
%117 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0))
store i32 -1, i32* %3
br label %380
118: ; preds = %107
%119 = load i8**, i8*** %5
%120 = getelementptr inbounds i8*, i8** %119, i64 3
%121 = load i8*, i8** %120
%122 = call i32 @atoi(i8* %121)
store i32 %122, i32* %12
%123 = load i8**, i8*** %5
%124 = getelementptr inbounds i8*, i8** %123, i64 4
%125 = load i8*, i8** %124
%126 = call i32 @atoi(i8* %125)
store i32 %126, i32* %13
%127 = load i8**, i8*** %5
%128 = getelementptr inbounds i8*, i8** %127, i64 2
%129 = load i8*, i8** %128
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i8* %129)
store i32 0, i32* %8
br label %131
131: ; preds = %146, %118
%132 = load i32, i32* %8
%133 = icmp slt i32 %132, 10000
br i1 %133, label %134, label %149
134: ; preds = %131
%135 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%136 = load i32*, i32** %6
%137 = call i32 @fgets(i8* %135, i32 128, i32* %136)
%138 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%139 = load i8, i8* %138
%140 = sext i8 %139 to i32
%141 = icmp ne i32 %140, 35
br i1 %141, label %142, label %143
142: ; preds = %134
br label %149
143: ; preds = %134
%144 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %144)
br label %146
146: ; preds = %143
%147 = load i32, i32* %8
%148 = add nsw i32 %147, 1
store i32 %148, i32* %8
br label %131
149: ; preds = %142, %131
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%151 = load i32, i32* %13
%152 = call i64 @calloc(i32 %151, i32 8)
%153 = inttoptr i64 %152 to double*
store double* %153, double** %17
store i32 0, i32* %8
br label %154
154: ; preds = %162, %149
%155 = load i32, i32* %8
%156 = load i32, i32* %12
%157 = icmp slt i32 %155, %156
br i1 %157, label %158, label %165
158: ; preds = %154
%159 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%160 = load i32*, i32** %6
%161 = call i32 @fgets(i8* %159, i32 128, i32* %160)
br label %162
162: ; preds = %158
%163 = load i32, i32* %8
%164 = add nsw i32 %163, 1
store i32 %164, i32* %8
br label %154
165: ; preds = %154
%166 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%167 = load double*, double** %17
%168 = getelementptr inbounds double, double* %167, i64 0
%169 = call i32 (i8*, i8*, ...) @sscanf(i8* %166, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double* %168)
store i32 1, i32* %8
br label %170
170: ; preds = %181, %165
%171 = load i32, i32* %8
%172 = load i32, i32* %13
%173 = icmp slt i32 %171, %172
br i1 %173, label %174, label %184
174: ; preds = %170
%175 = load i32*, i32** %6
%176 = load double*, double** %17
%177 = load i32, i32* %8
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds double, double* %176, i64 %178
%180 = call i32 (i32*, i8*, ...) @fscanf(i32* %175, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double* %179)
br label %181
181: ; preds = %174
%182 = load i32, i32* %8
%183 = add nsw i32 %182, 1
store i32 %183, i32* %8
br label %170
184: ; preds = %170
%185 = load i32*, i32** %6
%186 = call i32 @fclose(i32* %185)
%187 = load i8**, i8*** %5
%188 = getelementptr inbounds i8*, i8** %187, i64 5
%189 = load i8*, i8** %188
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), i8* %189)
%191 = load i8**, i8*** %5
%192 = getelementptr inbounds i8*, i8** %191, i64 5
%193 = load i8*, i8** %192
%194 = call i32* @fopen(i8* %193, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
store i32* %194, i32** %6
%195 = load i32*, i32** %6
%196 = icmp eq i32* %195, null
br i1 %196, label %197, label %199
197: ; preds = %184
%198 = 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 %380
199: ; preds = %184
%200 = load i32*, i32** %6
%201 = load i8**, i8*** %5
%202 = getelementptr inbounds i8*, i8** %201, i64 0
%203 = load i8*, i8** %202
%204 = call i32 (i32*, i8*, ...) @fprintf(i32* %200, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.22, i64 0, i64 0), i8* %203)
%205 = load i32*, i32** %6
%206 = load i8**, i8*** %5
%207 = getelementptr inbounds i8*, i8** %206, i64 1
%208 = load i8*, i8** %207
%209 = call i32 (i32*, i8*, ...) @fprintf(i32* %205, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.23, i64 0, i64 0), i8* %208)
%210 = load i32*, i32** %6
%211 = load i8**, i8*** %5
%212 = getelementptr inbounds i8*, i8** %211, i64 2
%213 = load i8*, i8** %212
%214 = call i32 (i32*, i8*, ...) @fprintf(i32* %210, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.24, i64 0, i64 0), i8* %213)
%215 = load i32*, i32** %6
%216 = load i32, i32* %13
%217 = call i32 (i32*, i8*, ...) @fprintf(i32* %215, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.25, i64 0, i64 0), i32 %216)
%218 = load i32, i32* %13
%219 = load i32, i32* %10
%220 = add nsw i32 %218, %219
store i32 %220, i32* %14
%221 = load i32, i32* %14
%222 = call i64 @calloc(i32 %221, i32 8)
%223 = inttoptr i64 %222 to double*
store double* %223, double** %18
store i32 0, i32* %8
br label %224
224: ; preds = %366, %199
%225 = load i32, i32* %8
%226 = load i32, i32* %14
%227 = icmp slt i32 %225, %226
br i1 %227, label %228, label %369
228: ; preds = %224
store double 0.000000e+00, double* %20
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.26, i64 0, i64 0), i8** %21
%229 = load i32, i32* @stderr
%230 = sext i32 %229 to i64
%231 = inttoptr i64 %230 to i32*
%232 = call i32 (i32*, i8*, ...) @fprintf(i32* %231, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.27, i64 0, i64 0))
%233 = load i32, i32* %8
%234 = load i32, i32* %10
%235 = icmp slt i32 %233, %234
br i1 %235, label %236, label %237
236: ; preds = %228
br label %242
237: ; preds = %228
%238 = load i32, i32* %8
%239 = load i32, i32* %10
%240 = sub nsw i32 %238, %239
%241 = add nsw i32 %240, 1
br label %242
242: ; preds = %237, %236
%243 = phi i32 [ 0, %236 ], [ %241, %237 ]
store i32 %243, i32* %9
br label %244
244: ; preds = %289, %242
%245 = load i32, i32* %9
%246 = load i32, i32* %8
%247 = load i32, i32* %13
%248 = icmp slt i32 %246, %247
br i1 %248, label %249, label %251
249: ; preds = %244
%250 = load i32, i32* %8
br label %254
251: ; preds = %244
%252 = load i32, i32* %13
%253 = sub nsw i32 %252, 1
br label %254
254: ; preds = %251, %249
%255 = phi i32 [ %250, %249 ], [ %253, %251 ]
%256 = icmp sle i32 %245, %255
br i1 %256, label %257, label %292
257: ; preds = %254
%258 = load double*, double** %15
%259 = load i32, i32* %8
%260 = load i32, i32* %9
%261 = sub nsw i32 %259, %260
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds double, double* %258, i64 %262
%264 = load double, double* %263
%265 = load double*, double** %17
%266 = load i32, i32* %9
%267 = sext i32 %266 to i64
%268 = getelementptr inbounds double, double* %265, i64 %267
%269 = load double, double* %268
%270 = load double, double* %20
%271 = call double @llvm.fmuladd.f64(double %264, double %269, double %270)
store double %271, double* %20
%272 = load i32, i32* @stderr
%273 = sext i32 %272 to i64
%274 = inttoptr i64 %273 to i32*
%275 = load i8*, i8** %21
%276 = load double*, double** %15
%277 = load i32, i32* %8
%278 = load i32, i32* %9
%279 = sub nsw i32 %277, %278
%280 = sext i32 %279 to i64
%281 = getelementptr inbounds double, double* %276, i64 %280
%282 = load double, double* %281
%283 = load double*, double** %17
%284 = load i32, i32* %9
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds double, double* %283, i64 %285
%287 = load double, double* %286
%288 = call i32 (i32*, i8*, ...) @fprintf(i32* %274, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0), i8* %275, double %282, double %287)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i8** %21
br label %289
289: ; preds = %257
%290 = load i32, i32* %9
%291 = add nsw i32 %290, 1
store i32 %291, i32* %9
br label %244
292: ; preds = %254
store double 0.000000e+00, double* %19
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.26, i64 0, i64 0), i8** %21
%293 = load i32, i32* @stderr
%294 = sext i32 %293 to i64
%295 = inttoptr i64 %294 to i32*
%296 = call i32 (i32*, i8*, ...) @fprintf(i32* %295, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i64 0, i64 0))
%297 = load i32, i32* %8
%298 = load i32, i32* %11
%299 = icmp slt i32 %297, %298
br i1 %299, label %300, label %301
300: ; preds = %292
br label %306
301: ; preds = %292
%302 = load i32, i32* %8
%303 = load i32, i32* %11
%304 = sub nsw i32 %302, %303
%305 = add nsw i32 %304, 1
br label %306
306: ; preds = %301, %300
%307 = phi i32 [ 0, %300 ], [ %305, %301 ]
store i32 %307, i32* %9
br label %308
308: ; preds = %344, %306
%309 = load i32, i32* %9
%310 = load i32, i32* %8
%311 = icmp slt i32 %309, %310
br i1 %311, label %312, label %347
312: ; preds = %308
%313 = load double*, double** %16
%314 = load i32, i32* %8
%315 = load i32, i32* %9
%316 = sub nsw i32 %314, %315
%317 = sext i32 %316 to i64
%318 = getelementptr inbounds double, double* %313, i64 %317
%319 = load double, double* %318
%320 = load double*, double** %18
%321 = load i32, i32* %9
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds double, double* %320, i64 %322
%324 = load double, double* %323
%325 = load double, double* %19
%326 = call double @llvm.fmuladd.f64(double %319, double %324, double %325)
store double %326, double* %19
%327 = load i32, i32* @stderr
%328 = sext i32 %327 to i64
%329 = inttoptr i64 %328 to i32*
%330 = load i8*, i8** %21
%331 = load double*, double** %16
%332 = load i32, i32* %8
%333 = load i32, i32* %9
%334 = sub nsw i32 %332, %333
%335 = sext i32 %334 to i64
%336 = getelementptr inbounds double, double* %331, i64 %335
%337 = load double, double* %336
%338 = load double*, double** %18
%339 = load i32, i32* %9
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds double, double* %338, i64 %340
%342 = load double, double* %341
%343 = call i32 (i32*, i8*, ...) @fprintf(i32* %329, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0), i8* %330, double %337, double %342)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i8** %21
br label %344
344: ; preds = %312
%345 = load i32, i32* %9
%346 = add nsw i32 %345, 1
store i32 %346, i32* %9
br label %308
347: ; preds = %308
%348 = load i32, i32* @stderr
%349 = sext i32 %348 to i64
%350 = inttoptr i64 %349 to i32*
%351 = call i32 (i32*, i8*, ...) @fprintf(i32* %350, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.31, i64 0, i64 0))
%352 = load double, double* %20
%353 = load double, double* %19
%354 = fsub double %352, %353
%355 = load double*, double** %18
%356 = load i32, i32* %8
%357 = sext i32 %356 to i64
%358 = getelementptr inbounds double, double* %355, i64 %357
store double %354, double* %358
%359 = load i32*, i32** %6
%360 = load double*, double** %18
%361 = load i32, i32* %8
%362 = sext i32 %361 to i64
%363 = getelementptr inbounds double, double* %360, i64 %362
%364 = load double, double* %363
%365 = call i32 (i32*, i8*, ...) @fprintf(i32* %359, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.32, i64 0, i64 0), double %364)
br label %366
366: ; preds = %347
%367 = load i32, i32* %8
%368 = add nsw i32 %367, 1
store i32 %368, i32* %8
br label %224
369: ; preds = %224
%370 = load i32*, i32** %6
%371 = call i32 @fclose(i32* %370)
%372 = load double*, double** %15
%373 = call i32 @free(double* %372)
%374 = load double*, double** %16
%375 = call i32 @free(double* %374)
%376 = load double*, double** %17
%377 = call i32 @free(double* %376)
%378 = load double*, double** %18
%379 = call i32 @free(double* %378)
store i32 1, i32* %3
br label %380
380: ; preds = %369, %197, %116, %42, %24
%381 = load i32, i32* %3
ret i32 %381
}

LLVM IR (-O2):
@.str.10 = [2 x i8] c"r\00"
@.str.11 = [33 x i8] c"Unable to open input filter file\00"
@.str.12 = [24 x i8] c"Reading input file: %s\0A\00"
@.str.13 = [3 x i8] c"%s\00"
@.str.14 = [3 x i8] c"%d\00"
@.str.15 = [4 x i8] c"%lf\00"
@.str.16 = [31 x i8] c"Unable to open input data file\00"
@.str.17 = [25 x i8] c"\0AReading input file: %s\0A\00"
@.str.19 = [18 x i8] c"Output file = %s\0A\00"
@.str.20 = [2 x i8] c"w\00"
@.str.21 = [27 x i8] c"Unable to open output file\00"
@.str.22 = [39 x i8] c"# %s :program that created this file\0A\00"
@.str.23 = [46 x i8] c"# %s :input file 1, contains filter coeff's\0A\00"
@.str.24 = [59 x i8] c"# %s :input file 2, contains data that is being filtered\0A\00"
@.str.25 = [53 x i8] c"# %d :nx, number of points used in input data file\0A\00"
@.str.26 = [1 x i8] zeroinitializer
@stderr = global i32 0
@.str.28 = [12 x i8] c"%s%lf * %lf\00"
@.str.29 = [4 x i8] c" + \00"
@.str.30 = [6 x i8] c") - (\00"
@.str.31 = [3 x i8] c")\0A\00"
@.str.32 = [5 x i8] c"%lf\0A\00"
@str = [45 x i8] c"\0A rdf stands for 'recursive digital filter'.\00"
@str.33 = [57 x i8] c" This program filters data from an input file, by use of\00"
@str.34 = [52 x i8] c" ck and dk coeff's read in from another input file.\00"
@str.35 = [62 x i8] c" All lines at top of input files starting with # are ignored.\00"
@str.36 = [53 x i8] c"\0A Usage: rdf infile_filter infile_data sx nx outfile\00"
@str.37 = [60 x i8] c" infile_filter = input file containing filter coefficients\00"
@str.38 = [53 x i8] c" infile_data = input file containing data to filter\00"
@str.39 = [57 x i8] c" sx = starting point (zero based) to begin reading data\00"
@str.40 = [39 x i8] c" nx = number of data points to filter\00"
@str.41 = [54 x i8] c" outfile = output file where filtered data is stored\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, 6
br i1 %9, label %10, label %21
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.33, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.34, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.35, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.36, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.37, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.38, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.39, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.40, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.41, i64 0, i64 0))
br label %250
21: ; preds = %2
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = tail call i32* @fopen(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
br label %250
28: ; preds = %21
%29 = load i8*, i8** %22
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %28, %36
%32 = phi i32 [ 0, %28 ], [ %38, %36 ]
%33 = call i32 @fgets(i8* %6, i32 128, i32* %24)
%34 = load i8, i8* %6
%35 = icmp eq i8 %34, 35
br i1 %35, label %36, label %40
36: ; preds = %31
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %6)
%38 = add nuw nsw i32 %32, 1
%39 = icmp eq i32 %38, 10000
br i1 %39, label %40, label %31
40: ; preds = %31, %36
%41 = call i32 (i8*, i8*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %4)
%42 = load i32, i32* %4
%43 = call i64 @calloc(i32 %42, i32 8)
%44 = inttoptr i64 %43 to double*
%45 = load i32, i32* %4
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %55
47: ; preds = %40, %47
%48 = phi i64 [ %51, %47 ], [ 0, %40 ]
%49 = getelementptr inbounds double, double* %44, i64 %48
%50 = call i32 (i32*, i8*, ...) @fscanf(i32* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double* %49)
%51 = add nuw nsw i64 %48, 1
%52 = load i32, i32* %4
%53 = sext i32 %52 to i64
%54 = icmp slt i64 %51, %53
br i1 %54, label %47, label %55
55: ; preds = %47, %40
%56 = call i32 (i32*, i8*, ...) @fscanf(i32* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i32* %5)
%57 = load i32, i32* %5
%58 = call i64 @calloc(i32 %57, i32 8)
%59 = inttoptr i64 %58 to double*
%60 = load i32, i32* %5
%61 = icmp sgt i32 %60, 0
br i1 %61, label %62, label %70
62: ; preds = %55, %62
%63 = phi i64 [ %66, %62 ], [ 0, %55 ]
%64 = getelementptr inbounds double, double* %59, i64 %63
%65 = call i32 (i32*, i8*, ...) @fscanf(i32* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double* %64)
%66 = add nuw nsw i64 %63, 1
%67 = load i32, i32* %5
%68 = sext i32 %67 to i64
%69 = icmp slt i64 %66, %68
br i1 %69, label %62, label %70
70: ; preds = %62, %55
%71 = call i32 @fclose(i32* %24)
%72 = getelementptr inbounds i8*, i8** %1, i64 2
%73 = load i8*, i8** %72
%74 = call i32* @fopen(i8* %73, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %78
76: ; preds = %70
%77 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0))
br label %250
78: ; preds = %70
%79 = getelementptr inbounds i8*, i8** %1, i64 3
%80 = load i8*, i8** %79
%81 = call i32 @atoi(i8* %80)
%82 = getelementptr inbounds i8*, i8** %1, i64 4
%83 = load i8*, i8** %82
%84 = call i32 @atoi(i8* %83)
%85 = load i8*, i8** %72
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i64 0, i64 0), i8* %85)
br label %87
87: ; preds = %78, %92
%88 = phi i32 [ 0, %78 ], [ %94, %92 ]
%89 = call i32 @fgets(i8* %6, i32 128, i32* %74)
%90 = load i8, i8* %6
%91 = icmp eq i8 %90, 35
br i1 %91, label %92, label %96
92: ; preds = %87
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %6)
%94 = add nuw nsw i32 %88, 1
%95 = icmp eq i32 %94, 10000
br i1 %95, label %96, label %87
96: ; preds = %87, %92
%97 = call i32 @putchar(i32 10)
%98 = call i64 @calloc(i32 %84, i32 8)
%99 = inttoptr i64 %98 to double*
%100 = icmp sgt i32 %81, 0
br i1 %100, label %101, label %106
101: ; preds = %96, %101
%102 = phi i32 [ %104, %101 ], [ 0, %96 ]
%103 = call i32 @fgets(i8* %6, i32 128, i32* %74)
%104 = add nuw nsw i32 %102, 1
%105 = icmp eq i32 %104, %81
br i1 %105, label %106, label %101
106: ; preds = %101, %96
%107 = call i32 (i8*, i8*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double* %99)
%108 = icmp sgt i32 %84, 1
br i1 %108, label %109, label %117
109: ; preds = %106
%110 = zext i32 %84 to i64
br label %111
111: ; preds = %109, %111
%112 = phi i64 [ 1, %109 ], [ %115, %111 ]
%113 = getelementptr inbounds double, double* %99, i64 %112
%114 = call i32 (i32*, i8*, ...) @fscanf(i32* %74, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), double* %113)
%115 = add nuw nsw i64 %112, 1
%116 = icmp eq i64 %115, %110
br i1 %116, label %117, label %111
117: ; preds = %111, %106
%118 = call i32 @fclose(i32* %74)
%119 = getelementptr inbounds i8*, i8** %1, i64 5
%120 = load i8*, i8** %119
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.19, i64 0, i64 0), i8* %120)
%122 = load i8*, i8** %119
%123 = call i32* @fopen(i8* %122, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%124 = icmp eq i32* %123, null
br i1 %124, label %125, label %127
125: ; preds = %117
%126 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0))
br label %250
127: ; preds = %117
%128 = load i8*, i8** %1
%129 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.22, i64 0, i64 0), i8* %128)
%130 = load i8*, i8** %22
%131 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.23, i64 0, i64 0), i8* %130)
%132 = load i8*, i8** %72
%133 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.24, i64 0, i64 0), i8* %132)
%134 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.25, i64 0, i64 0), i32 %84)
%135 = load i32, i32* %4
%136 = add nsw i32 %135, %84
%137 = call i64 @calloc(i32 %136, i32 8)
%138 = inttoptr i64 %137 to double*
%139 = icmp sgt i32 %136, 0
br i1 %139, label %140, label %244
140: ; preds = %127
%141 = add nsw i32 %84, -1
%142 = sext i32 %84 to i64
%143 = zext i32 %136 to i64
br label %144
144: ; preds = %140, %234
%145 = phi i64 [ 0, %140 ], [ %153, %234 ]
%146 = load i32, i32* @stderr
%147 = sext i32 %146 to i64
%148 = inttoptr i64 %147 to i32*
%149 = call i32 @fputc(i32 40, i32* %148)
%150 = load i32, i32* %4
%151 = sext i32 %150 to i64
%152 = icmp slt i64 %145, %151
%153 = add nuw nsw i64 %145, 1
%154 = trunc i64 %153 to i32
%155 = sub i32 %154, %150
%156 = select i1 %152, i32 0, i32 %155
%157 = icmp slt i64 %145, %142
%158 = trunc i64 %145 to i32
%159 = select i1 %157, i32 %158, i32 %141
%160 = icmp sgt i32 %156, %159
br i1 %160, label %193, label %161
161: ; preds = %144
%162 = sext i32 %156 to i64
%163 = add i32 %159, 1
%164 = sub nsw i64 %145, %162
%165 = getelementptr inbounds double, double* %44, i64 %164
%166 = load double, double* %165
%167 = getelementptr inbounds double, double* %99, i64 %162
%168 = load double, double* %167
%169 = call double @llvm.fmuladd.f64(double %166, double %168, double 0.000000e+00)
%170 = load i32, i32* @stderr
%171 = sext i32 %170 to i64
%172 = inttoptr i64 %171 to i32*
%173 = call i32 (i32*, i8*, ...) @fprintf(i32* %172, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.26, i64 0, i64 0), double %166, double %168)
%174 = add nsw i64 %162, 1
%175 = trunc i64 %174 to i32
%176 = icmp eq i32 %163, %175
br i1 %176, label %193, label %177
177: ; preds = %161, %177
%178 = phi i64 [ %190, %177 ], [ %174, %161 ]
%179 = phi double [ %185, %177 ], [ %169, %161 ]
%180 = sub nsw i64 %145, %178
%181 = getelementptr inbounds double, double* %44, i64 %180
%182 = load double, double* %181
%183 = getelementptr inbounds double, double* %99, i64 %178
%184 = load double, double* %183
%185 = call double @llvm.fmuladd.f64(double %182, double %184, double %179)
%186 = load i32, i32* @stderr
%187 = sext i32 %186 to i64
%188 = inttoptr i64 %187 to i32*
%189 = call i32 (i32*, i8*, ...) @fprintf(i32* %188, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), double %182, double %184)
%190 = add nsw i64 %178, 1
%191 = trunc i64 %190 to i32
%192 = icmp eq i32 %163, %191
br i1 %192, label %193, label %177
193: ; preds = %177, %161, %144
%194 = phi double [ 0.000000e+00, %144 ], [ %169, %161 ], [ %185, %177 ]
%195 = load i32, i32* @stderr
%196 = sext i32 %195 to i64
%197 = inttoptr i64 %196 to i32*
%198 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i64 0, i64 0), i64 5, i64 1, i32* %197)
%199 = load i32, i32* %5
%200 = sext i32 %199 to i64
%201 = icmp slt i64 %145, %200
%202 = sub i32 %154, %199
%203 = sext i32 %202 to i64
%204 = select i1 %201, i64 0, i64 %203
%205 = icmp sgt i64 %145, %204
br i1 %205, label %206, label %234
206: ; preds = %193
%207 = sub nsw i64 %145, %204
%208 = getelementptr inbounds double, double* %59, i64 %207
%209 = load double, double* %208
%210 = getelementptr inbounds double, double* %138, i64 %204
%211 = load double, double* %210
%212 = call double @llvm.fmuladd.f64(double %209, double %211, double 0.000000e+00)
%213 = load i32, i32* @stderr
%214 = sext i32 %213 to i64
%215 = inttoptr i64 %214 to i32*
%216 = call i32 (i32*, i8*, ...) @fprintf(i32* %215, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.26, i64 0, i64 0), double %209, double %211)
%217 = add nsw i64 %204, 1
%218 = icmp eq i64 %217, %145
br i1 %218, label %234, label %219
219: ; preds = %206, %219
%220 = phi i64 [ %232, %219 ], [ %217, %206 ]
%221 = phi double [ %227, %219 ], [ %212, %206 ]
%222 = sub nsw i64 %145, %220
%223 = getelementptr inbounds double, double* %59, i64 %222
%224 = load double, double* %223
%225 = getelementptr inbounds double, double* %138, i64 %220
%226 = load double, double* %225
%227 = call double @llvm.fmuladd.f64(double %224, double %226, double %221)
%228 = load i32, i32* @stderr
%229 = sext i32 %228 to i64
%230 = inttoptr i64 %229 to i32*
%231 = call i32 (i32*, i8*, ...) @fprintf(i32* %230, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.28, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), double %224, double %226)
%232 = add nsw i64 %220, 1
%233 = icmp eq i64 %232, %145
br i1 %233, label %234, label %219
234: ; preds = %219, %206, %193
%235 = phi double [ 0.000000e+00, %193 ], [ %212, %206 ], [ %227, %219 ]
%236 = load i32, i32* @stderr
%237 = sext i32 %236 to i64
%238 = inttoptr i64 %237 to i32*
%239 = call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.31, i64 0, i64 0), i64 2, i64 1, i32* %238)
%240 = fsub double %194, %235
%241 = getelementptr inbounds double, double* %138, i64 %145
store double %240, double* %241
%242 = call i32 (i32*, i8*, ...) @fprintf(i32* %123, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.32, i64 0, i64 0), double %240)
%243 = icmp eq i64 %153, %143
br i1 %243, label %244, label %144
244: ; preds = %234, %127
%245 = call i32 @fclose(i32* %123)
%246 = call i32 @free(double* %44)
%247 = call i32 @free(double* %59)
%248 = call i32 @free(double* %99)
%249 = call i32 @free(double* %138)
br label %250
250: ; preds = %244, %125, %76, %26, %10
%251 = phi i32 [ -1, %10 ], [ -1, %26 ], [ -1, %76 ], [ -1, %125 ], [ 1, %244 ]
ret i32 %251
}