#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 */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int fread(float *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(unsigned 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[4096];
    unsigned char y[4096];
    int r = fread(x, sizeof(float), 4096, stdin);
    if (r == 0)
      break;
    {
      int i;
      for (i = 0; i < r; i++) {
        if (x[i] < 0)
          y[i] = 0;
        else if (x[i] > 255)
          y[i] = 255;
        else
          y[i] = (unsigned char)x[i];
      }
    }
    fwrite(y, sizeof(unsigned char), r, stdout);
  }
  fprintf(stderr, "%s: done\n", argv[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5020,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1176 <main+0x46>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12c9 <main+0x199>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe8b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
lea    -0x4010(%rbp),%rdi
mov    0x2e46(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%esi
mov    $0x1000,%edx
call   1030 <fread@plt>
mov    %eax,-0x5014(%rbp)
cmpl   $0x0,-0x5014(%rbp)
jne    11cb <main+0x9b>
jmp    12ab <main+0x17b>
movl   $0x0,-0x5018(%rbp)
mov    -0x5018(%rbp),%eax
cmp    -0x5014(%rbp),%eax
jge    1286 <main+0x156>
movslq -0x5018(%rbp),%rax
xorps  %xmm0,%xmm0
ucomiss -0x4010(%rbp,%rax,4),%xmm0
ff
jbe    1213 <main+0xe3>
movslq -0x5018(%rbp),%rax
movb   $0x0,-0x5010(%rbp,%rax,1)
jmp    126d <main+0x13d>
movslq -0x5018(%rbp),%rax
movss  -0x4010(%rbp,%rax,4),%xmm0
ff ff
movss  0xdd5(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1248 <main+0x118>
movslq -0x5018(%rbp),%rax
movb   $0xff,-0x5010(%rbp,%rax,1)
ff
jmp    1268 <main+0x138>
movslq -0x5018(%rbp),%rax
cvttss2si -0x4010(%rbp,%rax,4),%eax
ff ff
mov    %al,%cl
movslq -0x5018(%rbp),%rax
mov    %cl,-0x5010(%rbp,%rax,1)
jmp    126d <main+0x13d>
jmp    1272 <main+0x142>
mov    -0x5018(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5018(%rbp)
jmp    11d5 <main+0xa5>
lea    -0x5010(%rbp),%rdi
mov    -0x5014(%rbp),%edx
mov    0x2d36(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1050 <fwrite@plt>
jmp    1194 <main+0x64>
mov    0x2d26(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd63(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x5020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5008,%rsp
mov    %edi,%eax
mov    0x2e8e(%rip),%rcx
mov    (%rcx),%edi
cmp    $0x2,%eax
jl     1169 <main+0x39>
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%eax
jmp    13da <main+0x2aa>
mov    %rsi,%r15
mov    (%rsi),%rdx
lea    0xec2(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e64(%rip),%r13
mov    0x0(%r13),%ecx
lea    0x1000(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1000,%edx
call   1030 <fread@plt>
test   %eax,%eax
je     13be <main+0x28e>
xorps  %xmm5,%xmm5
movss  0xe6d(%rip),%xmm8
xorps  %xmm6,%xmm6
movaps 0xe43(%rip),%xmm7
pcmpeqd %xmm4,%xmm4
movaps 0xe47(%rip),%xmm9
mov    0x2e00(%rip),%r12
mov    %rsp,%r14
lea    0x1000(%rsp),%rbx
jmp    1233 <main+0x103>
nopl   (%rax)
mov    (%r12),%ecx
mov    %r14,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1050 <fwrite@plt>
mov    0x0(%r13),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1000,%edx
call   1030 <fread@plt>
movaps 0xdff(%rip),%xmm9
pcmpeqd %xmm4,%xmm4
movaps 0xde4(%rip),%xmm7
xorps  %xmm6,%xmm6
movss  0xdf8(%rip),%xmm8
xorps  %xmm5,%xmm5
test   %eax,%eax
je     13be <main+0x28e>
test   %eax,%eax
jle    11e0 <main+0xb0>
mov    %eax,%ecx
cmp    $0x4,%eax
jae    1250 <main+0x120>
xor    %edx,%edx
jmp    1393 <main+0x263>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%edx
and    $0xfffffffc,%edx
lea    -0x4(%rdx),%rsi
mov    %rsi,%rbp
shr    $0x2,%rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     13b0 <main+0x280>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
movaps 0x1000(%rsp,%rsi,4),%xmm1
movdqa 0x1010(%rsp,%rsi,4),%xmm0
movaps %xmm7,%xmm2
cmpnltps %xmm1,%xmm2
movaps %xmm1,%xmm3
cmpnleps %xmm6,%xmm3
andps  %xmm1,%xmm3
cmpltps %xmm6,%xmm1
orps   %xmm1,%xmm2
movaps %xmm2,%xmm1
packssdw %xmm1,%xmm1
packsswb %xmm1,%xmm1
cvttps2dq %xmm3,%xmm3
pxor   %xmm4,%xmm1
andps  %xmm9,%xmm2
andps  %xmm3,%xmm2
packuswb %xmm2,%xmm2
packuswb %xmm2,%xmm2
por    %xmm1,%xmm2
movd   %xmm2,(%rsp,%rsi,1)
movaps %xmm7,%xmm1
cmpnltps %xmm0,%xmm1
movaps %xmm0,%xmm2
cmpnleps %xmm6,%xmm2
andps  %xmm0,%xmm2
cmpltps %xmm6,%xmm0
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
packssdw %xmm0,%xmm0
packsswb %xmm0,%xmm0
cvttps2dq %xmm2,%xmm2
pxor   %xmm4,%xmm0
andps  %xmm9,%xmm1
andps  %xmm2,%xmm1
packuswb %xmm1,%xmm1
packuswb %xmm1,%xmm1
por    %xmm0,%xmm1
movd   %xmm1,0x4(%rsp,%rsi,1)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1280 <main+0x150>
test   $0x1,%bpl
je     1374 <main+0x244>
movaps 0x1000(%rsp,%rsi,4),%xmm0
movaps %xmm7,%xmm1
cmpnltps %xmm0,%xmm1
movaps %xmm0,%xmm2
cmpnleps %xmm6,%xmm2
andps  %xmm0,%xmm2
cmpltps %xmm6,%xmm0
orps   %xmm0,%xmm1
cvttps2dq %xmm2,%xmm0
andps  %xmm1,%xmm0
packssdw %xmm1,%xmm1
packsswb %xmm1,%xmm1
pxor   %xmm4,%xmm1
andps  %xmm9,%xmm0
packuswb %xmm0,%xmm0
packuswb %xmm0,%xmm0
por    %xmm1,%xmm0
movd   %xmm0,(%rsp,%rsi,1)
cmp    %rcx,%rdx
jne    1393 <main+0x263>
jmp    11e0 <main+0xb0>
xchg   %ax,%ax
xor    %esi,%esi
mov    %sil,(%rsp,%rdx,1)
add    $0x1,%rdx
cmp    %rdx,%rcx
je     11e0 <main+0xb0>
movss  0x1000(%rsp,%rdx,4),%xmm0
ucomiss %xmm0,%xmm5
ja     1380 <main+0x250>
mov    $0xff,%sil
ucomiss %xmm8,%xmm0
ja     1382 <main+0x252>
cvttss2si %xmm0,%esi
jmp    1382 <main+0x252>
xor    %esi,%esi
test   $0x1,%bpl
jne    132c <main+0x1fc>
jmp    1374 <main+0x244>
mov    0x2c13(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xc74(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x5008,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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 [4096 x float]
%7 = alloca [4096 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %78
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %67, %15
%22 = getelementptr inbounds [4096 x float], [4096 x float]* %6, i64 0, i64 0
%23 = load i32, i32* @stdin
%24 = call i32 @fread(float* %22, i32 4, i32 4096, i32 %23)
store i32 %24, i32* %8
%25 = load i32, i32* %8
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %21
br label %72
28: ; preds = %21
store i32 0, i32* %9
br label %29
29: ; preds = %64, %28
%30 = load i32, i32* %9
%31 = load i32, i32* %8
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %67
33: ; preds = %29
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [4096 x float], [4096 x float]* %6, i64 0, i64 %35
%37 = load float, float* %36
%38 = fcmp olt float %37, 0.000000e+00
br i1 %38, label %39, label %43
39: ; preds = %33
%40 = load i32, i32* %9
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 %41
store i8 0, i8* %42
br label %63
43: ; preds = %33
%44 = load i32, i32* %9
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [4096 x float], [4096 x float]* %6, i64 0, i64 %45
%47 = load float, float* %46
%48 = fcmp ogt float %47, 2.550000e+02
br i1 %48, label %49, label %53
49: ; preds = %43
%50 = load i32, i32* %9
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 %51
store i8 -1, i8* %52
br label %62
53: ; preds = %43
%54 = load i32, i32* %9
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [4096 x float], [4096 x float]* %6, i64 0, i64 %55
%57 = load float, float* %56
%58 = fptoui float %57 to i8
%59 = load i32, i32* %9
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 %60
store i8 %58, i8* %61
br label %62
62: ; preds = %53, %49
br label %63
63: ; preds = %62, %39
br label %64
64: ; preds = %63
%65 = load i32, i32* %9
%66 = add nsw i32 %65, 1
store i32 %66, i32* %9
br label %29
67: ; preds = %29
%68 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%69 = load i32, i32* %8
%70 = load i32, i32* @stdout
%71 = call i32 @fwrite(i8* %68, i32 1, i32 %69, i32 %70)
br label %21
72: ; preds = %27
%73 = load i32, i32* @stderr
%74 = load i8**, i8*** %5
%75 = getelementptr inbounds i8*, i8** %74, i64 0
%76 = load i8*, i8** %75
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %76)
br label %78
78: ; preds = %72, %12
%79 = load i32, i32* %3
ret i32 %79
}

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 [4096 x float]
%4 = alloca [4096 x 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 %108
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 [4096 x float]* %3 to i8*
%13 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%14 = getelementptr inbounds [4096 x float], [4096 x float]* %3, i64 0, i64 0
%15 = load i32, i32* @stdin
%16 = call i32 @fread(float* %14, i32 4, i32 4096, i32 %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %104, label %18
18: ; preds = %9, %98
%19 = phi i32 [ %102, %98 ], [ %16, %9 ]
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %98
21: ; preds = %18
%22 = zext i32 %19 to i64
%23 = icmp ult i32 %19, 4
br i1 %23, label %82, label %24
24: ; preds = %21
%25 = and i64 %22, 4294967292
%26 = add nsw i64 %25, -4
%27 = lshr exact i64 %26, 2
%28 = add nuw nsw i64 %27, 1
%29 = and i64 %28, 1
%30 = icmp eq i64 %26, 0
br i1 %30, label %64, label %31
31: ; preds = %24
%32 = and i64 %28, 9223372036854775806
br label %33
33: ; preds = %33, %31
%34 = phi i64 [ 0, %31 ], [ %61, %33 ]
%35 = phi i64 [ 0, %31 ], [ %62, %33 ]
%36 = getelementptr inbounds [4096 x float], [4096 x float]* %3, i64 0, i64 %34
%37 = bitcast float* %36 to <4 x float>*
%38 = load <4 x float>, <4 x float>* %37
%39 = fcmp olt <4 x float> %38, zeroinitializer
%40 = fcmp ule <4 x float> %38, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
%41 = or <4 x i1> %39, %40
%42 = fcmp ole <4 x float> %38, zeroinitializer
%43 = select <4 x i1> %42, <4 x float> zeroinitializer, <4 x float> %38
%44 = fptoui <4 x float> %43 to <4 x i8>
%45 = select <4 x i1> %41, <4 x i8> %44, <4 x i8> <i8 -1, i8 -1, i8 -1, i8 -1>
%46 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %34
%47 = bitcast i8* %46 to <4 x i8>*
store <4 x i8> %45, <4 x i8>* %47
%48 = or i64 %34, 4
%49 = getelementptr inbounds [4096 x float], [4096 x float]* %3, i64 0, i64 %48
%50 = bitcast float* %49 to <4 x float>*
%51 = load <4 x float>, <4 x float>* %50
%52 = fcmp olt <4 x float> %51, zeroinitializer
%53 = fcmp ule <4 x float> %51, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
%54 = or <4 x i1> %52, %53
%55 = fcmp ole <4 x float> %51, zeroinitializer
%56 = select <4 x i1> %55, <4 x float> zeroinitializer, <4 x float> %51
%57 = fptoui <4 x float> %56 to <4 x i8>
%58 = select <4 x i1> %54, <4 x i8> %57, <4 x i8> <i8 -1, i8 -1, i8 -1, i8 -1>
%59 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %48
%60 = bitcast i8* %59 to <4 x i8>*
store <4 x i8> %58, <4 x i8>* %60
%61 = add nuw i64 %34, 8
%62 = add i64 %35, 2
%63 = icmp eq i64 %62, %32
br i1 %63, label %64, label %33
64: ; preds = %33, %24
%65 = phi i64 [ 0, %24 ], [ %61, %33 ]
%66 = icmp eq i64 %29, 0
br i1 %66, label %80, label %67
67: ; preds = %64
%68 = getelementptr inbounds [4096 x float], [4096 x float]* %3, i64 0, i64 %65
%69 = bitcast float* %68 to <4 x float>*
%70 = load <4 x float>, <4 x float>* %69
%71 = fcmp olt <4 x float> %70, zeroinitializer
%72 = fcmp ule <4 x float> %70, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
%73 = or <4 x i1> %71, %72
%74 = fcmp ole <4 x float> %70, zeroinitializer
%75 = select <4 x i1> %74, <4 x float> zeroinitializer, <4 x float> %70
%76 = fptoui <4 x float> %75 to <4 x i8>
%77 = select <4 x i1> %73, <4 x i8> %76, <4 x i8> <i8 -1, i8 -1, i8 -1, i8 -1>
%78 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %65
%79 = bitcast i8* %78 to <4 x i8>*
store <4 x i8> %77, <4 x i8>* %79
br label %80
80: ; preds = %64, %67
%81 = icmp eq i64 %25, %22
br i1 %81, label %98, label %82
82: ; preds = %21, %80
%83 = phi i64 [ 0, %21 ], [ %25, %80 ]
br label %84
84: ; preds = %82, %93
%85 = phi i64 [ %96, %93 ], [ %83, %82 ]
%86 = getelementptr inbounds [4096 x float], [4096 x float]* %3, i64 0, i64 %85
%87 = load float, float* %86
%88 = fcmp olt float %87, 0.000000e+00
br i1 %88, label %93, label %89
89: ; preds = %84
%90 = fcmp ogt float %87, 2.550000e+02
br i1 %90, label %93, label %91
91: ; preds = %89
%92 = fptoui float %87 to i8
br label %93
93: ; preds = %89, %84, %91
%94 = phi i8 [ %92, %91 ], [ 0, %84 ], [ -1, %89 ]
%95 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %85
store i8 %94, i8* %95
%96 = add nuw nsw i64 %85, 1
%97 = icmp eq i64 %96, %22
br i1 %97, label %98, label %84
98: ; preds = %93, %80, %18
%99 = load i32, i32* @stdout
%100 = call i32 @fwrite(i8* %13, i32 1, i32 %19, i32 %99)
%101 = load i32, i32* @stdin
%102 = call i32 @fread(float* %14, i32 4, i32 4096, i32 %101)
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %18
104: ; preds = %98, %9
%105 = load i32, i32* @stderr
%106 = load i8*, i8** %1
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %106)
br label %108
108: ; preds = %104, %7
%109 = phi i32 [ 1, %7 ], [ 0, %104 ]
ret i32 %109
}