#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 */

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fread(float *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
main(int argc, char *argv[]) {
  if (argc > 1) {
    fprintf(stderr, "< entrada > salida\n");
    return 1;
  }
  fprintf(stderr, "%s: running\n", argv[0]);
  for (;;) {
    float x;
    char y;
    fread(&x, sizeof(float), 1, stdin);
    if (feof(stdin))
      break;
    if (x < -128.0)
      y = -128;
    else if (x > 127.0)
      y = 127;
    else
      y = (char)x;
    fwrite(&y, sizeof(char), 1, stdout);
  }
  fprintf(stderr, "%s: done\n", argv[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1183 <main+0x43>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    126f <main+0x12f>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe8a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%ecx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
call   1050 <feof@plt>
cmp    $0x0,%rax
je     11da <main+0x9a>
jmp    1251 <main+0x111>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe15(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11fe <main+0xbe>
movb   $0x80,-0x15(%rbp)
jmp    1233 <main+0xf3>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdf9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1222 <main+0xe2>
movb   $0x7f,-0x15(%rbp)
jmp    122e <main+0xee>
movss  -0x14(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0x15(%rbp)
jmp    1233 <main+0xf3>
mov    0x2d96(%rip),%rax
mov    (%rax),%ecx
lea    -0x15(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1060 <fwrite@plt>
jmp    11a1 <main+0x61>
mov    0x2d80(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdc9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%eax
mov    0x2e84(%rip),%rcx
mov    (%rcx),%edi
cmp    $0x2,%eax
jl     1171 <main+0x31>
lea    0xea6(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%r14d
jmp    11cd <main+0x8d>
mov    %rsi,%r15
mov    (%rsi),%rdx
lea    0xe9e(%rip),%rsi
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e59(%rip),%rbp
mov    0x0(%rbp),%ecx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x0(%rbp),%edi
call   1050 <feof@plt>
test   %rax,%rax
je     11df <main+0x9f>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xe63(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2dea(%rip),%r12
lea    0x3(%rsp),%r13
lea    0x4(%rsp),%rbx
jmp    1241 <main+0x101>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x80,0x3(%rsp)
mov    (%r12),%ecx
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    0x0(%rbp),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x0(%rbp),%edi
call   1050 <feof@plt>
test   %rax,%rax
jne    11b3 <main+0x73>
movss  0x4(%rsp),%xmm0
movss  0xdb1(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1200 <main+0xc0>
ucomiss 0xda9(%rip),%xmm0
jbe    1270 <main+0x130>
movb   $0x7f,0x3(%rsp)
jmp    1205 <main+0xc5>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cvttss2si %xmm0,%eax
mov    %al,0x3(%rsp)
jmp    1205 <main+0xc5>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"< entrada > salida\0A\00"
@.str.1 = [13 x i8] c"%s: running\0A\00"
@stdin = global i32 0
@stdout = global i32 0
@.str.2 = [10 x i8] c"%s: done\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %49
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %40, %13
%20 = load i32, i32* @stdin
%21 = call i32 @fread(float* %6, i32 4, i32 1, i32 %20)
%22 = load i32, i32* @stdin
%23 = call i64 @feof(i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
br label %43
26: ; preds = %19
%27 = load float, float* %6
%28 = fpext float %27 to double
%29 = fcmp olt double %28, -1.280000e+02
br i1 %29, label %30, label %31
30: ; preds = %26
store i8 -128, i8* %7
br label %40
31: ; preds = %26
%32 = load float, float* %6
%33 = fpext float %32 to double
%34 = fcmp ogt double %33, 1.270000e+02
br i1 %34, label %35, label %36
35: ; preds = %31
store i8 127, i8* %7
br label %39
36: ; preds = %31
%37 = load float, float* %6
%38 = fptosi float %37 to i8
store i8 %38, i8* %7
br label %39
39: ; preds = %36, %35
br label %40
40: ; preds = %39, %30
%41 = load i32, i32* @stdout
%42 = call i32 @fwrite(i8* %7, i32 1, i32 1, i32 %41)
br label %19
43: ; preds = %25
%44 = load i32, i32* @stderr
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 0
%47 = load i8*, i8** %46
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %43, %10
%50 = load i32, i32* %3
ret i32 %50
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"< entrada > salida\0A\00"
@.str.1 = [13 x i8] c"%s: running\0A\00"
@stdin = global i32 0
@stdout = global i32 0
@.str.2 = [10 x i8] c"%s: done\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = alloca i8
%5 = icmp sgt i32 %0, 1
%6 = load i32, i32* @stderr
br i1 %5, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %39
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = bitcast float* %3 to i8*
%13 = load i32, i32* @stdin
%14 = call i32 @fread(float* %3, i32 4, i32 1, i32 %13)
%15 = load i32, i32* @stdin
%16 = call i64 @feof(i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %9, %27
%19 = load float, float* %3
%20 = fcmp olt float %19, -1.280000e+02
br i1 %20, label %21, label %22
21: ; preds = %18
store i8 -128, i8* %4
br label %27
22: ; preds = %18
%23 = fcmp ogt float %19, 1.270000e+02
br i1 %23, label %24, label %25
24: ; preds = %22
store i8 127, i8* %4
br label %27
25: ; preds = %22
%26 = fptosi float %19 to i8
store i8 %26, i8* %4
br label %27
27: ; preds = %21, %25, %24
%28 = load i32, i32* @stdout
%29 = call i32 @fwrite(i8* %4, i32 1, i32 1, i32 %28)
%30 = load i32, i32* @stdin
%31 = call i32 @fread(float* %3, i32 4, i32 1, i32 %30)
%32 = load i32, i32* @stdin
%33 = call i64 @feof(i32 %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %18, label %35
35: ; preds = %27, %9
%36 = load i32, i32* @stderr
%37 = load i8*, i8** %1
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %35, %7
%40 = phi i32 [ 1, %7 ], [ 0, %35 ]
ret i32 %40
}