#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 getchar();
int /*<<< orphan*/ printf(char *, char);
int main() {
  int i, c;
  char d, s[80];
  for (i = 0; i < 80 - 1 ? (c = getchar()) != '\n' ? c != EOF : 0 : 0; ++i)
    s[i] = c;
  d = s[0];
  printf("%c\n", d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4f,-0x8(%rbp)
jge    1184 <main+0x64>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     116f <main+0x4f>
mov    -0xc(%rbp),%eax
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x64(%rbp)
jmp    1179 <main+0x59>
xor    %eax,%eax
mov    %eax,-0x64(%rbp)
jmp    1179 <main+0x59>
mov    -0x64(%rbp),%eax
mov    %eax,-0x68(%rbp)
jmp    118e <main+0x6e>
xor    %eax,%eax
mov    %eax,-0x68(%rbp)
jmp    118e <main+0x6e>
mov    -0x68(%rbp),%eax
cmp    $0x0,%eax
je     11b5 <main+0x95>
mov    -0xc(%rbp),%eax
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x60(%rbp),%al
mov    %al,-0xd(%rbp)
lea    0xe3e(%rip),%rdi
movsbl -0xd(%rbp),%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    0x2eba(%rip),%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     114e <main+0x2e>
cmp    (%r14),%eax
je     114e <main+0x2e>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x4f,%rbx
jne    1130 <main+0x10>
movsbl (%rsp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca [80 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %30, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 79
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = call i32 (...) @getchar()
store i32 %10, i32* %3
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* @EOF
%15 = icmp ne i32 %13, %14
%16 = zext i1 %15 to i32
br label %18
17: ; preds = %9
br label %18
18: ; preds = %17, %12
%19 = phi i32 [ %16, %12 ], [ 0, %17 ]
br label %21
20: ; preds = %6
br label %21
21: ; preds = %20, %18
%22 = phi i32 [ %19, %18 ], [ 0, %20 ]
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %33
24: ; preds = %21
%25 = load i32, i32* %3
%26 = trunc i32 %25 to i8
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %28
store i8 %26, i8* %29
br label %30
30: ; preds = %24
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %6
33: ; preds = %21
%34 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%35 = load i8, i8* %34
store i8 %35, i8* %4
%36 = load i8, i8* %4
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %36)
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %10
%4 = phi i64 [ 0, %0 ], [ %13, %10 ]
%5 = tail call i32 (...) @getchar()
%6 = icmp eq i32 %5, 10
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %5, %7
%9 = select i1 %6, i1 true, i1 %8
br i1 %9, label %15, label %10
10: ; preds = %3
%11 = trunc i32 %5 to i8
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %4
store i8 %11, i8* %12
%13 = add nuw nsw i64 %4, 1
%14 = icmp eq i64 %13, 79
br i1 %14, label %15, label %3
15: ; preds = %10, %3
%16 = load i8, i8* %2
%17 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %16)
ret i32 0
}