#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(unsigned char *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(int *, 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;
  }
  for (;;) {
    unsigned char x[4096];
    int y[4096];
    int r = fread(x, sizeof(unsigned char), 4096, stdin);
    if (r == 0)
      break;
    {
      int i;
      for (i = 0; i < r; i++) {
        y[i] = (int)x[i];
      }
    }
    fwrite(y, sizeof(int), r, stdout);
  }
  return 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    1174 <main+0x44>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1229 <main+0xf9>
jmp    1179 <main+0x49>
lea    -0x1010(%rbp),%rdi
mov    0x2e61(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
mov    $0x1000,%edx
call   1030 <fread@plt>
mov    %eax,-0x5014(%rbp)
cmpl   $0x0,-0x5014(%rbp)
jne    11b0 <main+0x80>
jmp    1222 <main+0xf2>
movl   $0x0,-0x5018(%rbp)
mov    -0x5018(%rbp),%eax
cmp    -0x5014(%rbp),%eax
jge    11fd <main+0xcd>
movslq -0x5018(%rbp),%rax
movzbl -0x1010(%rbp,%rax,1),%ecx
ff
movslq -0x5018(%rbp),%rax
mov    %ecx,-0x5010(%rbp,%rax,4)
mov    -0x5018(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5018(%rbp)
jmp    11ba <main+0x8a>
lea    -0x5010(%rbp),%rdi
mov    -0x5014(%rbp),%edx
mov    0x2dbf(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%esi
call   1050 <fwrite@plt>
jmp    1179 <main+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5000,%rsp
cmp    $0x1,%edi
jle    1164 <main+0x34>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
jmp    12e4 <main+0x1b4>
mov    0x2e7d(%rip),%r15
mov    (%r15),%ecx
mov    %rsp,%rdi
mov    $0x1,%esi
mov    $0x1000,%edx
call   1030 <fread@plt>
test   %eax,%eax
je     12e2 <main+0x1b2>
pxor   %xmm2,%xmm2
mov    0x2e3d(%rip),%r12
lea    0x1000(%rsp),%r14
mov    %rsp,%r13
jmp    11d4 <main+0xa4>
mov    (%r12),%ecx
mov    %r14,%rdi
mov    $0x4,%esi
mov    %eax,%edx
call   1050 <fwrite@plt>
mov    (%r15),%ecx
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x1000,%edx
call   1030 <fread@plt>
pxor   %xmm2,%xmm2
test   %eax,%eax
je     12e2 <main+0x1b2>
test   %eax,%eax
jle    11a0 <main+0x70>
mov    %eax,%ecx
cmp    $0x8,%eax
jae    11f0 <main+0xc0>
xor    %edx,%edx
jmp    12c0 <main+0x190>
cs nopw 0x0(%rax,%rax,1)
mov    %ecx,%edx
and    $0xfffffff8,%edx
lea    -0x8(%rdx),%rsi
mov    %rsi,%rbx
shr    $0x3,%rbx
add    $0x1,%rbx
test   %rsi,%rsi
je     12d9 <main+0x1a9>
mov    %rbx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
movdqa (%rsp,%rsi,1),%xmm0
movd   0x4(%rsp,%rsi,1),%xmm1
punpcklbw %xmm2,%xmm0
punpcklwd %xmm2,%xmm0
punpcklbw %xmm2,%xmm1
punpcklwd %xmm2,%xmm1
movdqa %xmm0,0x1000(%rsp,%rsi,4)
movdqa %xmm1,0x1010(%rsp,%rsi,4)
movq   0x8(%rsp,%rsi,1),%xmm0
movd   0xc(%rsp,%rsi,1),%xmm1
punpcklbw %xmm2,%xmm0
punpcklwd %xmm2,%xmm0
punpcklbw %xmm2,%xmm1
punpcklwd %xmm2,%xmm1
movdqa %xmm0,0x1020(%rsp,%rsi,4)
movdqa %xmm1,0x1030(%rsp,%rsi,4)
add    $0x10,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1220 <main+0xf0>
test   $0x1,%bl
je     12b7 <main+0x187>
movq   (%rsp,%rsi,1),%xmm0
movd   0x4(%rsp,%rsi,1),%xmm1
punpcklbw %xmm2,%xmm0
punpcklwd %xmm2,%xmm0
punpcklbw %xmm2,%xmm1
punpcklwd %xmm2,%xmm1
movdqa %xmm0,0x1000(%rsp,%rsi,4)
movdqa %xmm1,0x1010(%rsp,%rsi,4)
cmp    %rcx,%rdx
je     11a0 <main+0x70>
movzbl (%rsp,%rdx,1),%esi
mov    %esi,0x1000(%rsp,%rdx,4)
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    12c0 <main+0x190>
jmp    11a0 <main+0x70>
xor    %esi,%esi
test   $0x1,%bl
jne    128a <main+0x15a>
jmp    12b7 <main+0x187>
xor    %eax,%eax
add    $0x5000,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"< input > output\0A\00"
@stdin = global i32 0
@stdout = global i32 0
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 i32]
%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 @fprintf(i32 %13, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %46
15: ; preds = %2
br label %16
16: ; preds = %40, %15
%17 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%18 = load i32, i32* @stdin
%19 = call i32 @fread(i8* %17, i32 1, i32 4096, i32 %18)
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %16
br label %45
23: ; preds = %16
store i32 0, i32* %9
br label %24
24: ; preds = %37, %23
%25 = load i32, i32* %9
%26 = load i32, i32* %8
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %40
28: ; preds = %24
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [4096 x i32], [4096 x i32]* %7, i64 0, i64 %35
store i32 %33, i32* %36
br label %37
37: ; preds = %28
%38 = load i32, i32* %9
%39 = add nsw i32 %38, 1
store i32 %39, i32* %9
br label %24
40: ; preds = %24
%41 = getelementptr inbounds [4096 x i32], [4096 x i32]* %7, i64 0, i64 0
%42 = load i32, i32* %8
%43 = load i32, i32* @stdout
%44 = call i32 @fwrite(i32* %41, i32 4, i32 %42, i32 %43)
br label %16
45: ; preds = %22
store i32 0, i32* %3
br label %46
46: ; preds = %45, %12
%47 = load i32, i32* %3
ret i32 %47
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"< input > output\0A\00"
@stdin = global i32 0
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4096 x i8]
%4 = alloca [4096 x i32]
%5 = icmp sgt i32 %0, 1
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%8 = bitcast [4096 x i32]* %4 to i8*
%9 = load i32, i32* @stdin
%10 = call i32 @fread(i8* %7, i32 1, i32 4096, i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %83, label %12
12: ; preds = %6
%13 = getelementptr inbounds [4096 x i32], [4096 x i32]* %4, i64 0, i64 0
br label %17
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %98
17: ; preds = %12, %92
%18 = phi i32 [ %10, %12 ], [ %96, %92 ]
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %92
20: ; preds = %17
%21 = zext i32 %18 to i64
%22 = icmp ult i32 %18, 8
br i1 %22, label %81, label %23
23: ; preds = %20
%24 = and i64 %21, 4294967288
%25 = add nsw i64 %24, -8
%26 = lshr exact i64 %25, 3
%27 = add nuw nsw i64 %26, 1
%28 = and i64 %27, 1
%29 = icmp eq i64 %25, 0
br i1 %29, label %63, label %30
30: ; preds = %23
%31 = and i64 %27, 4611686018427387902
br label %32
32: ; preds = %32, %30
%33 = phi i64 [ 0, %30 ], [ %60, %32 ]
%34 = phi i64 [ 0, %30 ], [ %61, %32 ]
%35 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %33
%36 = bitcast i8* %35 to <4 x i8>*
%37 = load <4 x i8>, <4 x i8>* %36
%38 = getelementptr inbounds i8, i8* %35, i64 4
%39 = bitcast i8* %38 to <4 x i8>*
%40 = load <4 x i8>, <4 x i8>* %39
%41 = zext <4 x i8> %37 to <4 x i32>
%42 = zext <4 x i8> %40 to <4 x i32>
%43 = getelementptr inbounds [4096 x i32], [4096 x i32]* %4, i64 0, i64 %33
%44 = bitcast i32* %43 to <4 x i32>*
store <4 x i32> %41, <4 x i32>* %44
%45 = getelementptr inbounds i32, i32* %43, i64 4
%46 = bitcast i32* %45 to <4 x i32>*
store <4 x i32> %42, <4 x i32>* %46
%47 = or i64 %33, 8
%48 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %47
%49 = bitcast i8* %48 to <4 x i8>*
%50 = load <4 x i8>, <4 x i8>* %49
%51 = getelementptr inbounds i8, i8* %48, i64 4
%52 = bitcast i8* %51 to <4 x i8>*
%53 = load <4 x i8>, <4 x i8>* %52
%54 = zext <4 x i8> %50 to <4 x i32>
%55 = zext <4 x i8> %53 to <4 x i32>
%56 = getelementptr inbounds [4096 x i32], [4096 x i32]* %4, i64 0, i64 %47
%57 = bitcast i32* %56 to <4 x i32>*
store <4 x i32> %54, <4 x i32>* %57
%58 = getelementptr inbounds i32, i32* %56, i64 4
%59 = bitcast i32* %58 to <4 x i32>*
store <4 x i32> %55, <4 x i32>* %59
%60 = add nuw i64 %33, 16
%61 = add i64 %34, 2
%62 = icmp eq i64 %61, %31
br i1 %62, label %63, label %32
63: ; preds = %32, %23
%64 = phi i64 [ 0, %23 ], [ %60, %32 ]
%65 = icmp eq i64 %28, 0
br i1 %65, label %79, label %66
66: ; preds = %63
%67 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %64
%68 = bitcast i8* %67 to <4 x i8>*
%69 = load <4 x i8>, <4 x i8>* %68
%70 = getelementptr inbounds i8, i8* %67, i64 4
%71 = bitcast i8* %70 to <4 x i8>*
%72 = load <4 x i8>, <4 x i8>* %71
%73 = zext <4 x i8> %69 to <4 x i32>
%74 = zext <4 x i8> %72 to <4 x i32>
%75 = getelementptr inbounds [4096 x i32], [4096 x i32]* %4, i64 0, i64 %64
%76 = bitcast i32* %75 to <4 x i32>*
store <4 x i32> %73, <4 x i32>* %76
%77 = getelementptr inbounds i32, i32* %75, i64 4
%78 = bitcast i32* %77 to <4 x i32>*
store <4 x i32> %74, <4 x i32>* %78
br label %79
79: ; preds = %63, %66
%80 = icmp eq i64 %24, %21
br i1 %80, label %92, label %81
81: ; preds = %20, %79
%82 = phi i64 [ 0, %20 ], [ %24, %79 ]
br label %84
83: ; preds = %92, %6
br label %98
84: ; preds = %81, %84
%85 = phi i64 [ %90, %84 ], [ %82, %81 ]
%86 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 %85
%87 = load i8, i8* %86
%88 = zext i8 %87 to i32
%89 = getelementptr inbounds [4096 x i32], [4096 x i32]* %4, i64 0, i64 %85
store i32 %88, i32* %89
%90 = add nuw nsw i64 %85, 1
%91 = icmp eq i64 %90, %21
br i1 %91, label %92, label %84
92: ; preds = %84, %79, %17
%93 = load i32, i32* @stdout
%94 = call i32 @fwrite(i32* %13, i32 4, i32 %18, i32 %93)
%95 = load i32, i32* @stdin
%96 = call i32 @fread(i8* %7, i32 1, i32 4096, i32 %95)
%97 = icmp eq i32 %96, 0
br i1 %97, label %83, label %17
98: ; preds = %83, %14
%99 = phi i32 [ 1, %14 ], [ 0, %83 ]
ret i32 %99
}