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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%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    0xe9d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1292 <main+0x162>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
lea    -0x1010(%rbp),%rdi
mov    0x2e46(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    $0x1000,%edx
call   1030 <fread@plt>
mov    %eax,-0x2014(%rbp)
cmpl   $0x0,-0x2014(%rbp)
jne    11cb <main+0x9b>
jmp    126d <main+0x13d>
movl   $0x0,-0x2018(%rbp)
mov    -0x2018(%rbp),%eax
cmp    -0x2014(%rbp),%eax
jge    1248 <main+0x118>
movslq -0x2018(%rbp),%rax
movsbl -0x1010(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
jge    1213 <main+0xe3>
movslq -0x2018(%rbp),%rax
movb   $0x0,-0x2010(%rbp,%rax,1)
jmp    122f <main+0xff>
movslq -0x2018(%rbp),%rax
mov    -0x1010(%rbp,%rax,1),%cl
movslq -0x2018(%rbp),%rax
mov    %cl,-0x2010(%rbp,%rax,1)
jmp    1234 <main+0x104>
mov    -0x2018(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2018(%rbp)
jmp    11d5 <main+0xa5>
lea    -0x2010(%rbp),%rdi
mov    -0x2014(%rbp),%edx
mov    0x2d74(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1050 <fwrite@plt>
jmp    1194 <main+0x64>
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xd9f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2018,%rsp
mov    %edi,%eax
mov    0x2e8e(%rip),%rcx
mov    (%rcx),%edi
cmp    $0x2,%eax
jl     1169 <main+0x39>
lea    0xea8(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%ebx
jmp    13ae <main+0x27e>
mov    %rsi,0x8(%rsp)
mov    (%rsi),%rdx
lea    0xe9a(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%r14
mov    (%r14),%ecx
lea    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1000,%edx
call   1030 <fread@plt>
test   %eax,%eax
je     138f <main+0x25f>
pxor   %xmm5,%xmm5
mov    0x2e1e(%rip),%r13
lea    0x1010(%rsp),%r15
lea    0x10(%rsp),%r12
jmp    1204 <main+0xd4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13),%ecx
mov    %r15,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1050 <fwrite@plt>
mov    (%r14),%ecx
mov    %r12,%rdi
mov    $0x1,%esi
mov    $0x1000,%edx
call   1030 <fread@plt>
pxor   %xmm5,%xmm5
test   %eax,%eax
je     138f <main+0x25f>
test   %eax,%eax
jle    11d0 <main+0xa0>
mov    %eax,%ecx
cmp    $0x8,%eax
jae    1220 <main+0xf0>
xor    %edx,%edx
jmp    1360 <main+0x230>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x20,%eax
jae    122c <main+0xfc>
xor    %edx,%edx
jmp    1320 <main+0x1f0>
mov    %ecx,%edx
and    $0xffffffe0,%edx
lea    -0x20(%rdx),%rsi
mov    %rsi,%rbp
shr    $0x5,%rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     1381 <main+0x251>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqa 0x10(%rsp,%rsi,1),%xmm0
movdqa 0x20(%rsp,%rsi,1),%xmm1
movdqa 0x30(%rsp,%rsi,1),%xmm2
movdqa 0x40(%rsp,%rsi,1),%xmm3
movdqa %xmm0,%xmm4
pcmpgtb %xmm5,%xmm4
pand   %xmm0,%xmm4
movdqa %xmm1,%xmm0
pcmpgtb %xmm5,%xmm0
pand   %xmm1,%xmm0
movdqa %xmm4,0x1010(%rsp,%rsi,1)
movdqa %xmm0,0x1020(%rsp,%rsi,1)
movdqa %xmm2,%xmm0
pcmpgtb %xmm5,%xmm0
pand   %xmm2,%xmm0
movdqa %xmm3,%xmm1
pcmpgtb %xmm5,%xmm1
pand   %xmm3,%xmm1
movdqa %xmm0,0x1030(%rsp,%rsi,1)
movdqa %xmm1,0x1040(%rsp,%rsi,1)
add    $0x40,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1260 <main+0x130>
test   $0x1,%bpl
je     1312 <main+0x1e2>
movdqa 0x10(%rsp,%rsi,1),%xmm0
movdqa 0x20(%rsp,%rsi,1),%xmm1
movdqa %xmm0,%xmm2
pcmpgtb %xmm5,%xmm2
pand   %xmm0,%xmm2
movdqa %xmm1,%xmm0
pcmpgtb %xmm5,%xmm0
pand   %xmm1,%xmm0
movdqa %xmm2,0x1010(%rsp,%rsi,1)
movdqa %xmm0,0x1020(%rsp,%rsi,1)
cmp    %rcx,%rdx
je     11d0 <main+0xa0>
test   $0x18,%cl
je     1360 <main+0x230>
mov    %rdx,%rsi
mov    %ecx,%edx
and    $0xfffffff8,%edx
nopl   0x0(%rax,%rax,1)
movq   0x10(%rsp,%rsi,1),%xmm0
movdqa %xmm0,%xmm1
pcmpgtb %xmm5,%xmm1
pand   %xmm0,%xmm1
movq   %xmm1,0x1010(%rsp,%rsi,1)
add    $0x8,%rsi
cmp    %rsi,%rdx
jne    1330 <main+0x200>
cmp    %rcx,%rdx
je     11d0 <main+0xa0>
nopl   (%rax)
movzbl 0x10(%rsp,%rdx,1),%esi
test   %sil,%sil
cmovs  %ebx,%esi
mov    %sil,0x1010(%rsp,%rdx,1)
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1360 <main+0x230>
jmp    11d0 <main+0xa0>
xor    %esi,%esi
test   $0x1,%bpl
jne    12dc <main+0x1ac>
jmp    1312 <main+0x1e2>
mov    0x2c42(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsp),%rax
mov    (%rax),%rdx
lea    0xc7c(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %ebx,%eax
add    $0x2018,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"< input > output\0A\00"
@.str.1 = [17 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 i8]
%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 ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %67
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 ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %56, %15
%22 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%23 = load i32, i32* @stdin
%24 = call i32 @fread(i8* %22, i32 1, 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 %61
28: ; preds = %21
store i32 0, i32* %9
br label %29
29: ; preds = %53, %28
%30 = load i32, i32* %9
%31 = load i32, i32* %8
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %56
33: ; preds = %29
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp slt i32 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %33
%41 = load i32, i32* %9
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 %42
store i8 0, i8* %43
br label %52
44: ; preds = %33
%45 = load i32, i32* %9
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = load i32, i32* %9
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 %50
store i8 %48, i8* %51
br label %52
52: ; preds = %44, %40
br label %53
53: ; preds = %52
%54 = load i32, i32* %9
%55 = add nsw i32 %54, 1
store i32 %55, i32* %9
br label %29
56: ; preds = %29
%57 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%58 = load i32, i32* %8
%59 = load i32, i32* @stdout
%60 = call i32 @fwrite(i8* %57, i32 1, i32 %58, i32 %59)
br label %21
61: ; preds = %27
%62 = load i32, i32* @stderr
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 0
%65 = load i8*, i8** %64
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %65)
store i32 0, i32* %3
br label %67
67: ; preds = %61, %12
%68 = load i32, i32* %3
ret i32 %68
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"< input > output\0A\00"
@.str.1 = [17 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 i8]
%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 ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %130
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%14 = load i32, i32* @stdin
%15 = call i32 @fread(i8* %12, i32 1, i32 4096, i32 %14)
%16 = icmp eq i32 %15, 0
br i1 %16, label %126, label %17
17: ; preds = %9, %120
%18 = phi i32 [ %124, %120 ], [ %15, %9 ]
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %120
20: ; preds = %17
%21 = zext i32 %18 to i64
%22 = icmp ult i32 %18, 8
br i1 %22, label %109, label %23
23: ; preds = %20
%24 = icmp ult i32 %18, 32
br i1 %24, label %92, label %25
25: ; preds = %23
%26 = and i64 %21, 4294967264
%27 = add nsw i64 %26, -32
%28 = lshr exact i64 %27, 5
%29 = add nuw nsw i64 %28, 1
%30 = and i64 %29, 1
%31 = icmp eq i64 %27, 0
br i1 %31, label %69, label %32
32: ; preds = %25
%33 = and i64 %29, 1152921504606846974
br label %34
34: ; preds = %34, %32
%35 = phi i64 [ 0, %32 ], [ %66, %34 ]
%36 = phi i64 [ 0, %32 ], [ %67, %34 ]
%37 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %35
%38 = bitcast i8* %37 to <16 x i8>*
%39 = load <16 x i8>, <16 x i8>* %38
%40 = getelementptr inbounds i8, i8* %37, i64 16
%41 = bitcast i8* %40 to <16 x i8>*
%42 = load <16 x i8>, <16 x i8>* %41
%43 = icmp sgt <16 x i8> %39, zeroinitializer
%44 = icmp sgt <16 x i8> %42, zeroinitializer
%45 = select <16 x i1> %43, <16 x i8> %39, <16 x i8> zeroinitializer
%46 = select <16 x i1> %44, <16 x i8> %42, <16 x i8> zeroinitializer
%47 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %35
%48 = bitcast i8* %47 to <16 x i8>*
store <16 x i8> %45, <16 x i8>* %48
%49 = getelementptr inbounds i8, i8* %47, i64 16
%50 = bitcast i8* %49 to <16 x i8>*
store <16 x i8> %46, <16 x i8>* %50
%51 = or i64 %35, 32
%52 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %51
%53 = bitcast i8* %52 to <16 x i8>*
%54 = load <16 x i8>, <16 x i8>* %53
%55 = getelementptr inbounds i8, i8* %52, i64 16
%56 = bitcast i8* %55 to <16 x i8>*
%57 = load <16 x i8>, <16 x i8>* %56
%58 = icmp sgt <16 x i8> %54, zeroinitializer
%59 = icmp sgt <16 x i8> %57, zeroinitializer
%60 = select <16 x i1> %58, <16 x i8> %54, <16 x i8> zeroinitializer
%61 = select <16 x i1> %59, <16 x i8> %57, <16 x i8> zeroinitializer
%62 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %51
%63 = bitcast i8* %62 to <16 x i8>*
store <16 x i8> %60, <16 x i8>* %63
%64 = getelementptr inbounds i8, i8* %62, i64 16
%65 = bitcast i8* %64 to <16 x i8>*
store <16 x i8> %61, <16 x i8>* %65
%66 = add nuw i64 %35, 64
%67 = add i64 %36, 2
%68 = icmp eq i64 %67, %33
br i1 %68, label %69, label %34
69: ; preds = %34, %25
%70 = phi i64 [ 0, %25 ], [ %66, %34 ]
%71 = icmp eq i64 %30, 0
br i1 %71, label %87, label %72
72: ; preds = %69
%73 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %70
%74 = bitcast i8* %73 to <16 x i8>*
%75 = load <16 x i8>, <16 x i8>* %74
%76 = getelementptr inbounds i8, i8* %73, i64 16
%77 = bitcast i8* %76 to <16 x i8>*
%78 = load <16 x i8>, <16 x i8>* %77
%79 = icmp sgt <16 x i8> %75, zeroinitializer
%80 = icmp sgt <16 x i8> %78, zeroinitializer
%81 = select <16 x i1> %79, <16 x i8> %75, <16 x i8> zeroinitializer
%82 = select <16 x i1> %80, <16 x i8> %78, <16 x i8> zeroinitializer
%83 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %70
%84 = bitcast i8* %83 to <16 x i8>*
store <16 x i8> %81, <16 x i8>* %84
%85 = getelementptr inbounds i8, i8* %83, i64 16
%86 = bitcast i8* %85 to <16 x i8>*
store <16 x i8> %82, <16 x i8>* %86
br label %87
87: ; preds = %69, %72
%88 = icmp eq i64 %26, %21
br i1 %88, label %120, label %89
89: ; preds = %87
%90 = and i64 %21, 24
%91 = icmp eq i64 %90, 0
br i1 %91, label %109, label %92
92: ; preds = %23, %89
%93 = phi i64 [ %26, %89 ], [ 0, %23 ]
%94 = zext i32 %18 to i64
%95 = and i64 %94, 4294967288
br label %96
96: ; preds = %96, %92
%97 = phi i64 [ %93, %92 ], [ %105, %96 ]
%98 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %97
%99 = bitcast i8* %98 to <8 x i8>*
%100 = load <8 x i8>, <8 x i8>* %99
%101 = icmp sgt <8 x i8> %100, zeroinitializer
%102 = select <8 x i1> %101, <8 x i8> %100, <8 x i8> zeroinitializer
%103 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %97
%104 = bitcast i8* %103 to <8 x i8>*
store <8 x i8> %102, <8 x i8>* %104
%105 = add nuw i64 %97, 8
%106 = icmp eq i64 %105, %95
br i1 %106, label %107, label %96
107: ; preds = %96
%108 = icmp eq i64 %95, %94
br i1 %108, label %120, label %109
109: ; preds = %20, %89, %107
%110 = phi i64 [ 0, %20 ], [ %26, %89 ], [ %95, %107 ]
br label %111
111: ; preds = %109, %111
%112 = phi i64 [ %118, %111 ], [ %110, %109 ]
%113 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %112
%114 = load i8, i8* %113
%115 = icmp sgt i8 %114, 0
%116 = select i1 %115, i8 %114, i8 0
%117 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 %112
store i8 %116, i8* %117
%118 = add nuw nsw i64 %112, 1
%119 = icmp eq i64 %118, %21
br i1 %119, label %120, label %111
120: ; preds = %111, %87, %107, %17
%121 = load i32, i32* @stdout
%122 = call i32 @fwrite(i8* %13, i32 1, i32 %18, i32 %121)
%123 = load i32, i32* @stdin
%124 = call i32 @fread(i8* %12, i32 1, i32 4096, i32 %123)
%125 = icmp eq i32 %124, 0
br i1 %125, label %126, label %17
126: ; preds = %120, %9
%127 = load i32, i32* @stderr
%128 = load i8*, i8** %1
%129 = call i32 (i32, i8*, ...) @fprintf(i32 %127, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %128)
br label %130
130: ; preds = %126, %7
%131 = phi i32 [ 1, %7 ], [ 0, %126 ]
ret i32 %131
}