#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;
  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 i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %27
12: ; preds = %2
br label %13
13: ; preds = %16, %12
%14 = call i32 (...) @getchar()
store i32 %14, i32* %6
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %17
16: ; preds = %13
br label %13
17: ; preds = %13
br label %18
18: ; preds = %22, %17
%19 = load i32, i32* %6
%20 = load i32, i32* @EOF
%21 = icmp ne i32 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i32, i32* %6
%24 = call i32 @putchar(i32 %23)
%25 = call i32 (...) @getchar()
store i32 %25, i32* %6
br label %18
26: ; preds = %18
store i32 0, i32* %3
br label %27
27: ; preds = %26, %9
%28 = load i32, i32* %3
ret i32 %28
}

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
}