#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 uint8_t;
typedef int /*<<< orphan*/ fl;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
float atof(int /*<<< orphan*/);
int creat(char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int getopt(int, char **, char *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ optarg;
int optind;
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, float, ...);
int process_sym_fl(float);
int read(int, float *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ sym_int2bits(int, int *);
int write(int, int *, int);
int main(int argc, char **argv) {
  int fd, fd_out, opt;
  int opt_verbose = 0;
  int do_afc = 0;
  float filter = 0;
  float filter_val = 0.0001;
  int ccounter = 0;
  while ((opt = getopt(argc, argv, "vaf:F:")) != -1) {
    switch (opt) {
    case 'v':
      opt_verbose++;
      break;
    case 'a':
      do_afc = 1;
      break;
    case 'f':
      filter_val = atof(optarg);
      break;
    default:
      exit(2);
    }
  }
  if (argc <= optind + 1) {
    fprintf(stderr,
            "Usage: %s [-v] [-a] [-f filter_averaging_coefficient] <infile> "
            "<outfile>\n",
            argv[0]);
    exit(2);
  }
  fd = open(argv[optind], O_RDONLY);
  if (fd < 0) {
    perror("open infile");
    exit(1);
  }
  fd_out = creat(argv[optind + 1], 0660);
  if (fd_out < 0) {
    perror("open outfile");
    exit(1);
  }
  while (1) {
    int rc;
    float fl;
    uint8_t bits[2];
    rc = read(fd, &fl, sizeof(fl));
    if (rc < 0) {
      perror("read");
      exit(1);
    } else if (rc == 0)
      break;
    if ((fl > -5.0) && (fl < 5.0))
      filter = filter * (1.0 - filter_val) + fl * filter_val;
    if (do_afc)
      fl = fl - filter;
    rc = process_sym_fl(fl);
    sym_int2bits(rc, bits);
    if (opt_verbose)
      printf("%1u%1u", bits[0], bits[1]);
    if ((do_afc) && (opt_verbose > 1)) {
      ccounter++;
      if (ccounter > 50) {
        printf(" AFC: %f\n", filter);
        ccounter = 0;
      }
    }
    rc = write(fd_out, bits, 2);
    if (rc < 0) {
      perror("write");
      exit(1);
    } else if (rc == 0)
      break;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xe0c(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe12(%rip),%rdx
call   10b0 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     1296 <main+0xd6>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
sub    $0x61,%eax
je     1263 <main+0xa3>
jmp    1233 <main+0x73>
mov    -0x44(%rbp),%eax
sub    $0x66,%eax
je     126f <main+0xaf>
jmp    1244 <main+0x84>
mov    -0x44(%rbp),%eax
sub    $0x76,%eax
jne    1287 <main+0xc7>
jmp    1255 <main+0x95>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1291 <main+0xd1>
movl   $0x1,-0x24(%rbp)
jmp    1291 <main+0xd1>
mov    0x2d82(%rip),%rax
mov    (%rax),%edi
call   1040 <atof@plt>
movss  %xmm0,-0x2c(%rbp)
jmp    1291 <main+0xd1>
mov    $0x2,%edi
call   10d0 <exit@plt>
jmp    1200 <main+0x40>
mov    -0x8(%rbp),%eax
mov    0x2d38(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     12d3 <main+0x113>
mov    0x2d14(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd63(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x2cfa(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2cf4(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1316 <main+0x156>
lea    0xd6a(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x2cb7(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x1b0,%esi
call   10c0 <creat@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    135a <main+0x19a>
lea    0xd32(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
jmp    135f <main+0x19f>
mov    -0x14(%rbp),%edi
lea    -0x38(%rbp),%rsi
mov    $0x4,%edx
call   1070 <read@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    1393 <main+0x1d3>
lea    0xd06(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
cmpl   $0x0,-0x34(%rbp)
jne    13a2 <main+0x1e2>
jmp    14ff <main+0x33f>
jmp    13a7 <main+0x1e7>
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xc50(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    141a <main+0x25a>
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc3d(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    141a <main+0x25a>
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xc21(%rip),%xmm2
subsd  %xmm1,%xmm2
movss  -0x38(%rbp),%xmm1
mulss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1433 <main+0x273>
movss  -0x38(%rbp),%xmm0
subss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
call   1030 <process_sym_fl@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x40(%rbp),%rsi
call   10e0 <sym_int2bits@plt>
cmpl   $0x0,-0x20(%rbp)
je     146c <main+0x2ac>
cvtsi2ssl -0x40(%rbp),%xmm0
mov    -0x3c(%rbp),%esi
lea    0xc2a(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmpl   $0x0,-0x24(%rbp)
je     14b2 <main+0x2f2>
cmpl   $0x1,-0x20(%rbp)
jle    14b2 <main+0x2f2>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x32,-0x30(%rbp)
jle    14ad <main+0x2ed>
movss  -0x28(%rbp),%xmm0
lea    0xbf7(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
movl   $0x0,-0x30(%rbp)
jmp    14b2 <main+0x2f2>
mov    -0x18(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x2,%edx
call   1050 <write@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    14e6 <main+0x326>
lea    0xbc9(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
cmpl   $0x0,-0x34(%rbp)
jne    14f5 <main+0x335>
jmp    14ff <main+0x33f>
jmp    14fa <main+0x33a>
jmp    135f <main+0x19f>
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movss  0xe25(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
xor    %r13d,%r13d
lea    0xe2d(%rip),%r14
mov    0x2e06(%rip),%r15
xor    %r12d,%r12d
jmp    120e <main+0x4e>
nopw   0x0(%rax,%rax,1)
mov    (%r15),%edi
call   1040 <atof@plt>
movss  %xmm0,0xc(%rsp)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   10b0 <getopt@plt>
cmp    $0x66,%eax
je     1200 <main+0x40>
cmp    $0x61,%eax
je     1230 <main+0x70>
cmp    $0x76,%eax
jne    1238 <main+0x78>
add    $0x1,%r13d
jmp    120e <main+0x4e>
mov    $0x1,%r12d
jmp    120e <main+0x4e>
cmp    $0xffffffff,%eax
jne    126d <main+0xad>
mov    0x2d94(%rip),%r15
movslq (%r15),%rax
lea    0x1(%rax),%ecx
cmp    %ebp,%ecx
jge    1277 <main+0xb7>
mov    (%rbx,%rax,8),%rdi
mov    0x2d87(%rip),%rax
mov    (%rax),%esi
call   1090 <open@plt>
test   %eax,%eax
jns    1299 <main+0xd9>
lea    0xdfe(%rip),%rdi
jmp    12da <main+0x11a>
mov    $0x2,%edi
call   10d0 <exit@plt>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xd95(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x2,%edi
call   10d0 <exit@plt>
mov    %eax,%r14d
movslq (%r15),%rax
mov    0x8(%rbx,%rax,8),%rdi
mov    $0x1b0,%esi
call   10c0 <creat@plt>
test   %eax,%eax
jns    12bb <main+0xfb>
lea    0xdbc(%rip),%rdi
jmp    12da <main+0x11a>
mov    %eax,%ebp
lea    0x14(%rsp),%rsi
mov    %r14d,%edi
mov    $0x4,%edx
call   1070 <read@plt>
test   %eax,%eax
jns    12e9 <main+0x129>
lea    0xda8(%rip),%rdi
call   10a0 <perror@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd15(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
test   %r12d,%r12d
setne  %cl
cmp    $0x2,%r13d
setae  %dl
and    %cl,%dl
mov    %dl,0xb(%rsp)
xorps  %xmm2,%xmm2
xor    %r15d,%r15d
lea    0x18(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %eax,%eax
je     142a <main+0x26a>
movss  0x14(%rsp),%xmm0
ucomiss 0xcbf(%rip),%xmm0
jbe    1377 <main+0x1b7>
movss  0xcb9(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1377 <main+0x1b7>
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
mulsd  0x20(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
mulss  %xmm0,%xmm2
cvtss2sd %xmm2,%xmm2
addsd  %xmm1,%xmm2
cvtsd2ss %xmm2,%xmm2
movss  %xmm2,0x10(%rsp)
movaps %xmm2,%xmm1
test   %r12d,%r12d
jne    1388 <main+0x1c8>
xorps  %xmm1,%xmm1
subss  %xmm1,%xmm0
call   1030 <process_sym_fl@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   10e0 <sym_int2bits@plt>
test   %r13d,%r13d
je     13f0 <main+0x230>
xorps  %xmm0,%xmm0
cvtsi2ssl 0x18(%rsp),%xmm0
mov    0x1c(%rsp),%esi
lea    0xcd3(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmpb   $0x0,0xb(%rsp)
je     13f0 <main+0x230>
cmp    $0x32,%r15d
jge    13ce <main+0x20e>
add    $0x1,%r15d
jmp    13f0 <main+0x230>
lea    0xcb9(%rip),%rdi
movss  0x10(%rsp),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1050 <write@plt>
test   %eax,%eax
js     1431 <main+0x271>
je     142a <main+0x26a>
mov    %r14d,%edi
lea    0x14(%rsp),%rsi
mov    $0x4,%edx
call   1070 <read@plt>
movss  0x10(%rsp),%xmm2
test   %eax,%eax
jns    1330 <main+0x170>
jmp    12d3 <main+0x113>
xor    %edi,%edi
call   10d0 <exit@plt>
lea    0xc60(%rip),%rdi
jmp    12da <main+0x11a>

LLVM IR (-O0):
@.str = [7 x i8] c"vaf:F:\00"
@optarg = global i32 0
@optind = global i32 0
@stderr = global i32 0
@.str.1 = [74 x i8] c"Usage: %s [-v] [-a] [-f filter_averaging_coefficient] <infile> <outfile>\0A\00"
@O_RDONLY = global i32 0
@.str.2 = [12 x i8] c"open infile\00"
@.str.3 = [13 x i8] c"open outfile\00"
@.str.4 = [5 x i8] c"read\00"
@.str.5 = [7 x i8] c"%1u%1u\00"
@.str.6 = [10 x i8] c" AFC: %f\0A\00"
@.str.7 = [6 x i8] c"write\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca i32
%14 = alloca i32
%15 = alloca float
%16 = alloca [2 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
store i32 0, i32* %10
store float 0.000000e+00, float* %11
store float 0x3F1A36E2E0000000, float* %12
store i32 0, i32* %13
br label %17
17: ; preds = %33, %2
%18 = load i32, i32* %4
%19 = load i8**, i8*** %5
%20 = call i32 @getopt(i32 %18, i8** %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %20, i32* %8
%21 = icmp ne i32 %20, -1
br i1 %21, label %22, label %34
22: ; preds = %17
%23 = load i32, i32* %8
switch i32 %23, label %31 [
i32 118, label %24
i32 97, label %27
i32 102, label %28
]
24: ; preds = %22
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
store i32 %26, i32* %9
br label %33
27: ; preds = %22
store i32 1, i32* %10
br label %33
28: ; preds = %22
%29 = load i32, i32* @optarg
%30 = call float @atof(i32 %29)
store float %30, float* %12
br label %33
31: ; preds = %22
%32 = call i32 @exit(i32 2)
unreachable
33: ; preds = %28, %27, %24
br label %17
34: ; preds = %17
%35 = load i32, i32* %4
%36 = load i32, i32* @optind
%37 = add nsw i32 %36, 1
%38 = icmp sle i32 %35, %37
br i1 %38, label %39, label %46
39: ; preds = %34
%40 = load i32, i32* @stderr
%41 = load i8**, i8*** %5
%42 = getelementptr inbounds i8*, i8** %41, i64 0
%43 = load i8*, i8** %42
%44 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0), i8* %43)
%45 = call i32 @exit(i32 2)
unreachable
46: ; preds = %34
%47 = load i8**, i8*** %5
%48 = load i32, i32* @optind
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = load i32, i32* @O_RDONLY
%53 = call i32 @open(i8* %51, i32 %52)
store i32 %53, i32* %6
%54 = load i32, i32* %6
%55 = icmp slt i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %46
%57 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%58 = call i32 @exit(i32 1)
unreachable
59: ; preds = %46
%60 = load i8**, i8*** %5
%61 = load i32, i32* @optind
%62 = add nsw i32 %61, 1
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %60, i64 %63
%65 = load i8*, i8** %64
%66 = call i32 @creat(i8* %65, i32 432)
store i32 %66, i32* %7
%67 = load i32, i32* %7
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %72
69: ; preds = %59
%70 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%71 = call i32 @exit(i32 1)
unreachable
72: ; preds = %59
br label %73
73: ; preds = %72, %157
%74 = load i32, i32* %6
%75 = call i32 @read(i32 %74, float* %15, i32 4)
store i32 %75, i32* %14
%76 = load i32, i32* %14
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %81
78: ; preds = %73
%79 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%80 = call i32 @exit(i32 1)
unreachable
81: ; preds = %73
%82 = load i32, i32* %14
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %81
br label %158
85: ; preds = %81
br label %86
86: ; preds = %85
%87 = load float, float* %15
%88 = fpext float %87 to double
%89 = fcmp ogt double %88, -5.000000e+00
br i1 %89, label %90, label %106
90: ; preds = %86
%91 = load float, float* %15
%92 = fpext float %91 to double
%93 = fcmp olt double %92, 5.000000e+00
br i1 %93, label %94, label %106
94: ; preds = %90
%95 = load float, float* %11
%96 = fpext float %95 to double
%97 = load float, float* %12
%98 = fpext float %97 to double
%99 = fsub double 1.000000e+00, %98
%100 = load float, float* %15
%101 = load float, float* %12
%102 = fmul float %100, %101
%103 = fpext float %102 to double
%104 = call double @llvm.fmuladd.f64(double %96, double %99, double %103)
%105 = fptrunc double %104 to float
store float %105, float* %11
br label %106
106: ; preds = %94, %90, %86
%107 = load i32, i32* %10
%108 = icmp ne i32 %107, 0
br i1 %108, label %109, label %113
109: ; preds = %106
%110 = load float, float* %15
%111 = load float, float* %11
%112 = fsub float %110, %111
store float %112, float* %15
br label %113
113: ; preds = %109, %106
%114 = load float, float* %15
%115 = call i32 @process_sym_fl(float %114)
store i32 %115, i32* %14
%116 = load i32, i32* %14
%117 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 0
%118 = call i32 @sym_int2bits(i32 %116, i32* %117)
%119 = load i32, i32* %9
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %128
121: ; preds = %113
%122 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 0
%123 = load i32, i32* %122
%124 = sitofp i32 %123 to float
%125 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 1
%126 = load i32, i32* %125
%127 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), float %124, i32 %126)
br label %128
128: ; preds = %121, %113
%129 = load i32, i32* %10
%130 = icmp ne i32 %129, 0
br i1 %130, label %131, label %143
131: ; preds = %128
%132 = load i32, i32* %9
%133 = icmp sgt i32 %132, 1
br i1 %133, label %134, label %143
134: ; preds = %131
%135 = load i32, i32* %13
%136 = add nsw i32 %135, 1
store i32 %136, i32* %13
%137 = load i32, i32* %13
%138 = icmp sgt i32 %137, 50
br i1 %138, label %139, label %142
139: ; preds = %134
%140 = load float, float* %11
%141 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), float %140)
store i32 0, i32* %13
br label %142
142: ; preds = %139, %134
br label %143
143: ; preds = %142, %131, %128
%144 = load i32, i32* %7
%145 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 0
%146 = call i32 @write(i32 %144, i32* %145, i32 2)
store i32 %146, i32* %14
%147 = load i32, i32* %14
%148 = icmp slt i32 %147, 0
br i1 %148, label %149, label %152
149: ; preds = %143
%150 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%151 = call i32 @exit(i32 1)
unreachable
152: ; preds = %143
%153 = load i32, i32* %14
%154 = icmp eq i32 %153, 0
br i1 %154, label %155, label %156
155: ; preds = %152
br label %158
156: ; preds = %152
br label %157
157: ; preds = %156
br label %73
158: ; preds = %155, %84
%159 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"vaf:F:\00"
@optarg = global i32 0
@optind = global i32 0
@stderr = global i32 0
@.str.1 = [74 x i8] c"Usage: %s [-v] [-a] [-f filter_averaging_coefficient] <infile> <outfile>\0A\00"
@O_RDONLY = global i32 0
@.str.2 = [12 x i8] c"open infile\00"
@.str.3 = [13 x i8] c"open outfile\00"
@.str.4 = [5 x i8] c"read\00"
@.str.5 = [7 x i8] c"%1u%1u\00"
@.str.6 = [10 x i8] c" AFC: %f\0A\00"
@.str.7 = [6 x i8] c"write\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca float
%4 = alloca [2 x i32]
br label %5
5: ; preds = %15, %2
%6 = phi i32 [ %16, %15 ], [ 0, %2 ]
%7 = phi i32 [ %10, %15 ], [ 0, %2 ]
%8 = phi float [ %13, %15 ], [ 0x3F1A36E2E0000000, %2 ]
br label %9
9: ; preds = %12, %5
%10 = phi i32 [ %7, %5 ], [ 1, %12 ]
%11 = phi float [ %8, %5 ], [ %13, %12 ]
br label %12
12: ; preds = %9, %17
%13 = phi float [ %19, %17 ], [ %11, %9 ]
%14 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %14, label %20 [
i32 -1, label %22
i32 118, label %15
i32 97, label %9
i32 102, label %17
]
15: ; preds = %12
%16 = add nuw nsw i32 %6, 1
br label %5
17: ; preds = %12
%18 = load i32, i32* @optarg
%19 = tail call float @atof(i32 %18)
br label %12
20: ; preds = %12
%21 = tail call i32 @exit(i32 2)
unreachable
22: ; preds = %12
%23 = load i32, i32* @optind
%24 = add nsw i32 %23, 1
%25 = icmp slt i32 %24, %0
br i1 %25, label %31, label %26
26: ; preds = %22
%27 = load i32, i32* @stderr
%28 = load i8*, i8** %1
%29 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0), i8* %28)
%30 = tail call i32 @exit(i32 2)
unreachable
31: ; preds = %22
%32 = sext i32 %23 to i64
%33 = getelementptr inbounds i8*, i8** %1, i64 %32
%34 = load i8*, i8** %33
%35 = load i32, i32* @O_RDONLY
%36 = tail call i32 @open(i8* %34, i32 %35)
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %31
%39 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%40 = tail call i32 @exit(i32 1)
unreachable
41: ; preds = %31
%42 = load i32, i32* @optind
%43 = add nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8*, i8** %1, i64 %44
%46 = load i8*, i8** %45
%47 = tail call i32 @creat(i8* %46, i32 432)
%48 = icmp slt i32 %47, 0
br i1 %48, label %63, label %49
49: ; preds = %41
%50 = bitcast float* %3 to i8*
%51 = bitcast [2 x i32]* %4 to i8*
%52 = call i32 @read(i32 %36, float* %3, i32 4)
%53 = icmp slt i32 %52, 0
br i1 %53, label %66, label %54
54: ; preds = %49
%55 = fpext float %13 to double
%56 = fsub double 1.000000e+00, %55
%57 = icmp ne i32 %10, 0
%58 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%59 = icmp eq i32 %6, 0
%60 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%61 = icmp ugt i32 %6, 1
%62 = select i1 %57, i1 %61, i1 false
br label %69
63: ; preds = %41
%64 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%65 = tail call i32 @exit(i32 1)
unreachable
66: ; preds = %110, %49
%67 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%68 = call i32 @exit(i32 1)
unreachable
69: ; preds = %54, %110
%70 = phi i32 [ %52, %54 ], [ %111, %110 ]
%71 = phi i32 [ 0, %54 ], [ %102, %110 ]
%72 = phi float [ 0.000000e+00, %54 ], [ %86, %110 ]
%73 = icmp eq i32 %70, 0
br i1 %73, label %113, label %74
74: ; preds = %69
%75 = load float, float* %3
%76 = fcmp ogt float %75, -5.000000e+00
%77 = fcmp olt float %75, 5.000000e+00
%78 = and i1 %76, %77
br i1 %78, label %79, label %85
79: ; preds = %74
%80 = fpext float %72 to double
%81 = fmul float %13, %75
%82 = fpext float %81 to double
%83 = call double @llvm.fmuladd.f64(double %80, double %56, double %82)
%84 = fptrunc double %83 to float
br label %85
85: ; preds = %79, %74
%86 = phi float [ %84, %79 ], [ %72, %74 ]
%87 = select i1 %57, float %86, float 0.000000e+00
%88 = fsub float %75, %87
%89 = call i32 @process_sym_fl(float %88)
%90 = call i32 @sym_int2bits(i32 %89, i32* %58)
br i1 %59, label %101, label %91
91: ; preds = %85
%92 = load i32, i32* %58
%93 = sitofp i32 %92 to float
%94 = load i32, i32* %60
%95 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), float %93, i32 %94)
br i1 %62, label %96, label %101
96: ; preds = %91
%97 = add nsw i32 %71, 1
%98 = icmp sgt i32 %71, 49
br i1 %98, label %99, label %101
99: ; preds = %96
%100 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), float %86)
br label %101
101: ; preds = %85, %96, %99, %91
%102 = phi i32 [ 0, %99 ], [ %97, %96 ], [ %71, %91 ], [ %71, %85 ]
%103 = call i32 @write(i32 %47, i32* %58, i32 2)
%104 = icmp slt i32 %103, 0
br i1 %104, label %105, label %108
105: ; preds = %101
%106 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%107 = call i32 @exit(i32 1)
unreachable
108: ; preds = %101
%109 = icmp eq i32 %103, 0
br i1 %109, label %113, label %110
110: ; preds = %108
%111 = call i32 @read(i32 %36, float* %3, i32 4)
%112 = icmp slt i32 %111, 0
br i1 %112, label %66, label %69
113: ; preds = %108, %69
%114 = call i32 @exit(i32 0)
unreachable
}