#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 EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
int main(int argc, char *argv[]) {
  FILE *in = stdin;
  FILE *out = stdout;
  double av = 0.0;
  double ex = 0.33;
  double ex_i = 1.0 - ex;
  double avu = 0.0;
  double exu = 0.50;
  double exu_i = 1.0 - exu;
  int c;
  double v;
  while ((c = getc(in)) != EOF) {
    v = (double)c - 128.0;
    avu = (avu * exu_i) + (v * exu);
    av = (av * ex_i) + (v * ex);
    if (argc < 2) {
      if (avu - av < 0)
        putc(64, out);
      else
        putc(-64, out);
    } else {
      putc((int)((avu - av) * 5.0) + 128, out);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeae(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe91(%rip),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe7f(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe6a(%rip),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x54(%rbp)
mov    0x2e2d(%rip),%rcx
cmp    (%rcx),%eax
je     1288 <main+0x168>
cvtsi2sdl -0x54(%rbp),%xmm0
movsd  0xe50(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x60(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    125a <main+0x13a>
movsd  -0x40(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1247 <main+0x127>
mov    -0x20(%rbp),%rsi
mov    $0x40,%edi
call   1030 <putc@plt>
jmp    1255 <main+0x135>
mov    -0x20(%rbp),%rsi
mov    $0xffffffc0,%edi
call   1030 <putc@plt>
jmp    1283 <main+0x163>
movsd  -0x40(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  0xdb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
add    $0x80,%edi
mov    -0x20(%rbp),%rsi
call   1030 <putc@plt>
jmp    11a0 <main+0x80>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%r14d
mov    0x2eb4(%rip),%rax
mov    (%rax),%rbx
mov    0x2e92(%rip),%rax
mov    (%rax),%rbp
mov    %rbx,%rdi
call   1040 <getc@plt>
mov    0x2e90(%rip),%r15
cmp    (%r15),%eax
jne    1162 <main+0x42>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xorpd  %xmm1,%xmm1
jmp    1199 <main+0x79>
nopl   0x0(%rax,%rax,1)
mulsd  0xe90(%rip),%xmm0
cvttsd2si %xmm0,%edi
sub    $0xffffff80,%edi
mov    %rbp,%rsi
call   1030 <putc@plt>
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    (%r15),%eax
movapd (%rsp),%xmm1
je     1155 <main+0x35>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xe58(%rip),%xmm0
unpcklpd %xmm0,%xmm0
mulpd  0xe6c(%rip),%xmm0
mulpd  0xe74(%rip),%xmm1
addpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
subsd  %xmm1,%xmm0
cmp    $0x1,%r14d
movapd %xmm1,(%rsp)
jg     1170 <main+0x50>
xor    %edi,%edi
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
seta   %dil
shl    $0x7,%edi
add    $0xffffffc0,%edi
jmp    117f <main+0x5f>

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i32*, i32** @stdin
store i32* %16, i32** %6
%17 = load i32*, i32** @stdout
store i32* %17, i32** %7
store double 0.000000e+00, double* %8
store double 3.300000e-01, double* %9
%18 = load double, double* %9
%19 = fsub double 1.000000e+00, %18
store double %19, double* %10
store double 0.000000e+00, double* %11
store double 5.000000e-01, double* %12
%20 = load double, double* %12
%21 = fsub double 1.000000e+00, %20
store double %21, double* %13
br label %22
22: ; preds = %66, %2
%23 = load i32*, i32** %6
%24 = call i32 @getc(i32* %23)
store i32 %24, i32* %14
%25 = load i32, i32* @EOF
%26 = icmp ne i32 %24, %25
br i1 %26, label %27, label %67
27: ; preds = %22
%28 = load i32, i32* %14
%29 = sitofp i32 %28 to double
%30 = fsub double %29, 1.280000e+02
store double %30, double* %15
%31 = load double, double* %11
%32 = load double, double* %13
%33 = load double, double* %15
%34 = load double, double* %12
%35 = fmul double %33, %34
%36 = call double @llvm.fmuladd.f64(double %31, double %32, double %35)
store double %36, double* %11
%37 = load double, double* %8
%38 = load double, double* %10
%39 = load double, double* %15
%40 = load double, double* %9
%41 = fmul double %39, %40
%42 = call double @llvm.fmuladd.f64(double %37, double %38, double %41)
store double %42, double* %8
%43 = load i32, i32* %4
%44 = icmp slt i32 %43, 2
br i1 %44, label %45, label %57
45: ; preds = %27
%46 = load double, double* %11
%47 = load double, double* %8
%48 = fsub double %46, %47
%49 = fcmp olt double %48, 0.000000e+00
br i1 %49, label %50, label %53
50: ; preds = %45
%51 = load i32*, i32** %7
%52 = call i32 @putc(i32 64, i32* %51)
br label %56
53: ; preds = %45
%54 = load i32*, i32** %7
%55 = call i32 @putc(i32 -64, i32* %54)
br label %56
56: ; preds = %53, %50
br label %66
57: ; preds = %27
%58 = load double, double* %11
%59 = load double, double* %8
%60 = fsub double %58, %59
%61 = fmul double %60, 5.000000e+00
%62 = fptosi double %61 to i32
%63 = add nsw i32 %62, 128
%64 = load i32*, i32** %7
%65 = call i32 @putc(i32 %63, i32* %64)
br label %66
66: ; preds = %57, %56
br label %22
67: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32*, i32** @stdin
%4 = load i32*, i32** @stdout
%5 = tail call i32 @getc(i32* %3)
%6 = load i32, i32* @EOF
%7 = icmp eq i32 %5, %6
br i1 %7, label %35, label %8
8: ; preds = %2
%9 = icmp slt i32 %0, 2
br label %10
10: ; preds = %8, %29
%11 = phi i32 [ %5, %8 ], [ %32, %29 ]
%12 = phi <2 x double> [ zeroinitializer, %8 ], [ %18, %29 ]
%13 = sitofp i32 %11 to double
%14 = fadd double %13, -1.280000e+02
%15 = insertelement <2 x double> poison, double %14, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = fmul <2 x double> %16, <double 3.300000e-01, double 5.000000e-01>
%18 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> <double 0x3FE570A3D70A3D70, double 5.000000e-01>, <2 x double> %17)
%19 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%20 = fsub <2 x double> %19, %18
%21 = extractelement <2 x double> %20, i64 0
br i1 %9, label %22, label %25
22: ; preds = %10
%23 = fcmp olt double %21, 0.000000e+00
%24 = select i1 %23, i32 64, i32 -64
br label %29
25: ; preds = %10
%26 = fmul double %21, 5.000000e+00
%27 = fptosi double %26 to i32
%28 = add nsw i32 %27, 128
br label %29
29: ; preds = %22, %25
%30 = phi i32 [ %28, %25 ], [ %24, %22 ]
%31 = tail call i32 @putc(i32 %30, i32* %4)
%32 = tail call i32 @getc(i32* %3)
%33 = load i32, i32* @EOF
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %10
35: ; preds = %29, %2
ret i32 0
}