#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__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ putchar(int);
main() {
  int c;
  for (;;) {
    if (getchar() == EOF)
      break;
    if (getchar() == EOF)
      break;
    if (getchar() == EOF)
      break;
    if ((c = getchar()) == EOF)
      break;
    putchar(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
jne    114b <main+0x2b>
jmp    11b1 <main+0x91>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <main+0x47>
jmp    11b1 <main+0x91>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2e73(%rip),%rcx
cmp    (%rcx),%rax
jne    1183 <main+0x63>
jmp    11b1 <main+0x91>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cltq
mov    0x2e52(%rip),%rcx
cmp    (%rcx),%rax
jne    11a4 <main+0x84>
jmp    11b1 <main+0x91>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%rax
je     117a <main+0x5a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%rax
je     117a <main+0x5a>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%rax
je     117a <main+0x5a>
xor    %eax,%eax
call   1040 <getchar@plt>
movslq %eax,%rcx
cmp    (%rbx),%rcx
je     117a <main+0x5a>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%rax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %25, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %3
br label %28
8: ; preds = %3
%9 = call i64 (...) @getchar()
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %28
13: ; preds = %8
%14 = call i64 (...) @getchar()
%15 = load i64, i64* @EOF
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
br label %28
18: ; preds = %13
%19 = call i64 (...) @getchar()
%20 = trunc i64 %19 to i32
store i32 %20, i32* %2
%21 = sext i32 %20 to i64
%22 = load i64, i64* @EOF
%23 = icmp eq i64 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %18
br label %28
25: ; preds = %18
%26 = load i32, i32* %2
%27 = call i32 @putchar(i32 %26)
br label %3
28: ; preds = %24, %17, %12, %7
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %24, label %4
4: ; preds = %0, %18
%5 = tail call i64 (...) @getchar()
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %24, label %8
8: ; preds = %4
%9 = tail call i64 (...) @getchar()
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %24, label %12
12: ; preds = %8
%13 = tail call i64 (...) @getchar()
%14 = shl i64 %13, 32
%15 = ashr exact i64 %14, 32
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %24, label %18
18: ; preds = %12
%19 = trunc i64 %13 to i32
%20 = tail call i32 @putchar(i32 %19)
%21 = tail call i64 (...) @getchar()
%22 = load i64, i64* @EOF
%23 = icmp eq i64 %21, %22
br i1 %23, label %24, label %4
24: ; preds = %18, %4, %8, %12, %0
ret i32 0
}