#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 /*<<< orphan*/ *gets(char *);
scalar_t__ isTautogram(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char poem[2000 + 1];
  while (1) {
    if (gets(poem) == NULL)
      break;
    if (poem[0] == '*')
      break;
    if (isTautogram(poem))
      printf("Y\n");
    else
      printf("N\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x7e0(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
jne    115d <main+0x2d>
jmp    11aa <main+0x7a>
movsbl -0x7e0(%rbp),%eax
cmp    $0x2a,%eax
jne    1172 <main+0x42>
jmp    11aa <main+0x7a>
lea    -0x7e0(%rbp),%rdi
call   1030 <isTautogram@plt>
cmp    $0x0,%rax
je     1199 <main+0x69>
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
jmp    11a5 <main+0x75>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
mov    %rsp,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     118a <main+0x5a>
cmpb   $0x2a,(%rsp)
je     118a <main+0x5a>
mov    %rsp,%rbx
lea    0xea7(%rip),%r14
lea    0xea2(%rip),%r15
mov    %rbx,%rdi
call   1040 <isTautogram@plt>
test   %rax,%rax
mov    %r15,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     118a <main+0x5a>
cmpb   $0x2a,(%rsp)
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"Y\0A\00"
@.str.1 = [3 x i8] c"N\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2001 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %22
%4 = getelementptr inbounds [2001 x i8], [2001 x i8]* %2, i64 0, i64 0
%5 = call i32* @gets(i8* %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %3
br label %23
8: ; preds = %3
%9 = getelementptr inbounds [2001 x i8], [2001 x i8]* %2, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 42
br i1 %12, label %13, label %14
13: ; preds = %8
br label %23
14: ; preds = %8
%15 = getelementptr inbounds [2001 x i8], [2001 x i8]* %2, i64 0, i64 0
%16 = call i64 @isTautogram(i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %22
20: ; preds = %14
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %18
br label %3
23: ; preds = %13, %7
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"N\00"
@str.2 = [2 x i8] c"Y\00"
define i32 @main() {
%1 = alloca [2001 x i8]
%2 = getelementptr inbounds [2001 x i8], [2001 x i8]* %1, i64 0, i64 0
%3 = call i32* @gets(i8* %2)
%4 = icmp eq i32* %3, null
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 42
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %18, label %8
8: ; preds = %0, %8
%9 = call i64 @isTautogram(i8* %2)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
%13 = call i32* @gets(i8* %2)
%14 = icmp eq i32* %13, null
%15 = load i8, i8* %2
%16 = icmp eq i8 %15, 42
%17 = select i1 %14, i1 true, i1 %16
br i1 %17, label %18, label %8
18: ; preds = %8, %0
ret i32 0
}