#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 EOF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getchar();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int c;
  (void)argv;
  if (argc > 1) {
    fprintf(stderr, "no arguments, please\n");
    return 1;
  }
  while ((c = getchar()) == '\n')
    ;
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
  return 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    1171 <main+0x41>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11c3 <main+0x93>
jmp    1176 <main+0x46>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xa,%eax
jne    118e <main+0x5e>
jmp    1176 <main+0x46>
jmp    1193 <main+0x63>
mov    -0x14(%rbp),%eax
mov    0x2e4b(%rip),%rcx
cmp    (%rcx),%eax
je     11bc <main+0x8c>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
jmp    1193 <main+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jle    1160 <main+0x30>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%ebx
jmp    1193 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     1160 <main+0x30>
mov    0x2e75(%rip),%r14
xor    %ebx,%ebx
cmp    (%r14),%eax
je     1193 <main+0x63>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1180 <main+0x50>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"no arguments, please\0A\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, 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 @fprintf(i32 %11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %28
13: ; preds = %2
br label %14
14: ; preds = %17, %13
%15 = call i32 (...) @getchar()
store i32 %15, i32* %6
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %18
17: ; preds = %14
br label %14
18: ; preds = %14
br label %19
19: ; preds = %23, %18
%20 = load i32, i32* %6
%21 = load i32, i32* @EOF
%22 = icmp ne i32 %20, %21
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i32, i32* %6
%25 = call i32 @putchar(i32 %24)
%26 = call i32 (...) @getchar()
store i32 %26, i32* %6
br label %19
27: ; preds = %19
store i32 0, i32* %3
br label %28
28: ; preds = %27, %10
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"no arguments, please\0A\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %19
7: ; preds = %2, %7
%8 = tail call i32 (...) @getchar()
%9 = icmp eq i32 %8, 10
br i1 %9, label %7, label %10
10: ; preds = %7
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %8, %11
br i1 %12, label %19, label %13
13: ; preds = %10, %13
%14 = phi i32 [ %16, %13 ], [ %8, %10 ]
%15 = tail call i32 @putchar(i32 %14)
%16 = tail call i32 (...) @getchar()
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %13
19: ; preds = %13, %10, %4
%20 = phi i32 [ 1, %4 ], [ 0, %10 ], [ 0, %13 ]
ret i32 %20
}