#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__ isLetter(char);
int /*<<< orphan*/ printf(char *, char);
scalar_t__ scanf(char *, char *);
int main(int argc, char **argv) {
  char c;
  while (scanf("%c", &c) != EOF) {
    if (isLetter(c)) {
      printf("%c", c);
    }
  }
}


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)
lea    0xeb3(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e8b(%rip),%rcx
cmp    (%rcx),%rax
je     118e <main+0x5e>
movsbl -0x11(%rbp),%edi
call   1050 <isLetter@plt>
cmp    $0x0,%rax
je     1189 <main+0x59>
lea    0xe80(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
jmp    1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e97(%rip),%r15
cmp    (%r15),%rax
jne    1162 <main+0x32>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe97(%rip),%rbx
lea    0xf(%rsp),%r14
jmp    1180 <main+0x50>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
cmp    (%r15),%rax
je     1156 <main+0x26>
movsbl 0xf(%rsp),%edi
call   1050 <isLetter@plt>
test   %rax,%rax
je     1170 <main+0x40>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x40>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %18, %2
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i8, i8* %6
%13 = call i64 @isLetter(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i8, i8* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %16)
br label %18
18: ; preds = %15, %11
br label %7
19: ; preds = %7
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %18, label %7
7: ; preds = %2, %14
%8 = load i8, i8* %3
%9 = call i64 @isLetter(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %12)
br label %14
14: ; preds = %11, %7
%15 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %7
18: ; preds = %14, %2
ret i32 0
}