#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 */
char EOF;
int chpos(char);
char getchar();
scalar_t__ isblank(char);
int /*<<< orphan*/ printf(char *, char, ...);
int main(void) {
  char ch;
  while ((ch = getchar()) != EOF) {
    if (isblank(ch) || ch == '\n')
      continue;
    int pos = chpos(ch);
    if (pos == -1)
      printf("%c is not a English letter.\n", ch);
    else
      printf("%c is a English letter whose position is %d\n", ch, pos);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e85(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11dc <main+0x9c>
movsbl -0x5(%rbp),%edi
call   1040 <isblank@plt>
cmp    $0x0,%rax
jne    118e <main+0x4e>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1193 <main+0x53>
jmp    114f <main+0xf>
movsbl -0x5(%rbp),%edi
call   1060 <chpos@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    11c0 <main+0x80>
lea    0xe50(%rip),%rdi
movsbl -0x5(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d7 <main+0x97>
mov    -0x5(%rbp),%al
mov    -0xc(%rbp),%edx
lea    0xe50(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2e93(%rip),%rbx
cmp    (%rbx),%al
jne    1166 <main+0x26>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe93(%rip),%r14
lea    0xea9(%rip),%r15
jmp    1199 <main+0x59>
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%al
je     1159 <main+0x19>
movsbl %al,%ebp
mov    %ebp,%edi
call   1040 <isblank@plt>
cmp    $0xa,%bpl
je     118e <main+0x4e>
test   %rax,%rax
jne    118e <main+0x4e>
mov    %ebp,%edi
call   1060 <chpos@plt>
cmp    $0xffffffff,%eax
jne    1180 <main+0x40>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    118e <main+0x4e>

LLVM IR (-O0):
@EOF = global i8 0
@.str = [29 x i8] c"%c is not a English letter.\0A\00"
@.str.1 = [45 x i8] c"%c is a English letter whose position is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %31, %18, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %32
10: ; preds = %4
%11 = load i8, i8* %2
%12 = call i64 @isblank(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %18, label %19
18: ; preds = %14, %10
br label %4
19: ; preds = %14
%20 = load i8, i8* %2
%21 = call i32 @chpos(i8 signext %20)
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = load i8, i8* %2
%26 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext %25)
br label %31
27: ; preds = %19
%28 = load i8, i8* %2
%29 = load i32, i32* %3
%30 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8 signext %28, i32 %29)
br label %31
31: ; preds = %27, %24
br label %4
32: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [29 x i8] c"%c is not a English letter.\0A\00"
@.str.1 = [45 x i8] c"%c is a English letter whose position is %d\0A\00"
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %21, label %4
4: ; preds = %0, %17
%5 = phi i8 [ %18, %17 ], [ %1, %0 ]
%6 = tail call i64 @isblank(i8 signext %5)
%7 = icmp ne i64 %6, 0
%8 = icmp eq i8 %5, 10
%9 = or i1 %8, %7
br i1 %9, label %17, label %10
10: ; preds = %4
%11 = tail call i32 @chpos(i8 signext %5)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8 signext %5)
br label %17
15: ; preds = %10
%16 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8 signext %5, i32 %11)
br label %17
17: ; preds = %13, %15, %4
%18 = tail call signext i8 (...) @getchar()
%19 = load i8, i8* @EOF
%20 = icmp eq i8 %18, %19
br i1 %20, label %21, label %4
21: ; preds = %17, %0
ret i32 0
}