#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 */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
scalar_t__ palindrome(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int scanf(char *, char *);
int strlen(char *);
int main() {
  char s[1024 + 1];
  int len;
  memset(s, 0, sizeof(s));
  if (scanf("%"
            "1024"
            "s",
            s) == 1) {
    len = strlen(s);
    printf("%s!\n", palindrome(s, 0, len) ? "Y" : "N");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1050 <memset@plt>
lea    -0x410(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    11dc <main+0x8c>
lea    -0x410(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x414(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x414(%rbp),%edx
xor    %esi,%esi
call   1060 <palindrome@plt>
mov    %rax,%rcx
lea    0xe4d(%rip),%rsi
lea    0xe44(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xe30(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x401,%edx
call   1050 <memset@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    11b6 <main+0x66>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1060 <palindrome@plt>
test   %rax,%rax
lea    0xe6f(%rip),%rax
lea    0xe66(%rip),%rsi
cmove  %rax,%rsi
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%1024s\00"
@.str.1 = [5 x i8] c"%s!\0A\00"
@.str.2 = [2 x i8] c"Y\00"
@.str.3 = [2 x i8] c"N\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1025 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [1025 x i8], [1025 x i8]* %2, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 1025)
%6 = getelementptr inbounds [1025 x i8], [1025 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %19
9: ; preds = %0
%10 = getelementptr inbounds [1025 x i8], [1025 x i8]* %2, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %3
%12 = getelementptr inbounds [1025 x i8], [1025 x i8]* %2, i64 0, i64 0
%13 = load i32, i32* %3
%14 = call i64 @palindrome(i8* %12, i32 0, i32 %13)
%15 = icmp ne i64 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0)
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%1024s\00"
@.str.1 = [5 x i8] c"%s!\0A\00"
@.str.2 = [2 x i8] c"Y\00"
@.str.3 = [2 x i8] c"N\00"
define i32 @main() {
%1 = alloca [1025 x i8]
%2 = getelementptr inbounds [1025 x i8], [1025 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 1025)
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i32 @strlen(i8* %2)
%8 = call i64 @palindrome(i8* %2, i32 0, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %6, %0
ret i32 0
}