#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
char tolower(char);
int main() {
  char ch[100];
  scanf("%s", ch);
  int len = strlen(ch);
  int i;
  char ch2[100];
  for (i = 0; i < len; i++) {
    ch[i] = tolower(ch[i]);
    ch2[len - i - 1] = ch[i];
  }
  if (strncmp(ch, ch2, len - 1) == 0)
    printf("Its A Palindrome \n");
  else
    printf("Its Not A Palindrome \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    11d1 <main+0x81>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1060 <tolower@plt>
mov    %al,%cl
movslq -0x78(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
movslq -0x78(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
mov    -0x74(%rbp),%eax
sub    -0x78(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %cl,-0xe0(%rbp,%rax,1)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1185 <main+0x35>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
mov    -0x74(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1202 <main+0xb2>
lea    0xe0b(%rip),%rdi
call   1050 <printf@plt>
jmp    120e <main+0xbe>
lea    0xe0d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0xe9b(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%r14d
test   %eax,%eax
jle    11b1 <main+0x61>
mov    %r14d,%r15d
lea    -0x1(%r14),%ebx
xor    %r12d,%r12d
nopl   0x0(%rax)
movsbl (%rsp,%r12,1),%edi
call   1060 <tolower@plt>
mov    %al,(%rsp,%r12,1)
movslq %ebx,%rbx
mov    %al,0x70(%rsp,%rbx,1)
add    $0x1,%r12
add    $0xffffffff,%ebx
cmp    %r12,%r15
jne    1190 <main+0x40>
add    $0xffffffff,%r14d
mov    %rsp,%rdi
lea    0x70(%rsp),%rsi
mov    %r14d,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
lea    0xe4a(%rip),%rax
lea    0xe2d(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [19 x i8] c"Its A Palindrome \0A\00"
@.str.2 = [23 x i8] c"Its Not A Palindrome \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i8]
store i32 0, i32* %1
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %3
store i32 0, i32* %4
br label %10
10: ; preds = %33, %0
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %36
14: ; preds = %10
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = call signext i8 @tolower(i8 signext %18)
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %21
store i8 %19, i8* %22
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = sub nsw i32 %27, %28
%30 = sub nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %31
store i8 %26, i8* %32
br label %33
33: ; preds = %14
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %10
36: ; preds = %10
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%39 = load i32, i32* %3
%40 = sub nsw i32 %39, 1
%41 = call i64 @strncmp(i8* %37, i8* %38, i32 %40)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %36
%44 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %47
45: ; preds = %36
%46 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@str = [22 x i8] c"Its Not A Palindrome \00"
@str.3 = [18 x i8] c"Its A Palindrome \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @strlen(i8* %3)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %22
8: ; preds = %0
%9 = zext i32 %5 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %20, %10 ]
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = call signext i8 @tolower(i8 signext %13)
store i8 %14, i8* %12
%15 = trunc i64 %11 to i32
%16 = xor i32 %15, -1
%17 = add i32 %5, %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %18
store i8 %14, i8* %19
%20 = add nuw nsw i64 %11, 1
%21 = icmp eq i64 %20, %9
br i1 %21, label %22, label %10
22: ; preds = %10, %0
%23 = add nsw i32 %5, -1
%24 = call i64 @strncmp(i8* %3, i8* %6, i32 %23)
%25 = icmp eq i64 %24, 0
%26 = select i1 %25, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0)
%27 = call i32 @puts(i8* dereferenceable(1) %26)
ret i32 0
}