#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 *);
int main() {
  int n, i;
  char s[100];
  scanf("%s", s);
  int l;
  l = strlen(s);
  for (i = 0; i < l; i++, l--) {
    if (s[i] != s[l - 1]) {
      printf("String is not palindrome");
      return 0;
    }
  }
  printf("String is palindrome");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x74(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    11c4 <main+0x94>
movslq -0xc(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
mov    -0x74(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl -0x70(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     11a8 <main+0x78>
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11d7 <main+0xa7>
jmp    11ad <main+0x7d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x74(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x74(%rbp)
jmp    1165 <main+0x35>
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xec6(%rip),%rdi
test   %eax,%eax
jle    118e <main+0x5e>
mov    %eax,%eax
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
lea    0xe9a(%rip),%rdx
nopl   0x0(%rax)
movzbl (%rsp,%rcx,1),%ebx
cmp    (%rsp,%rax,1),%bl
jne    118b <main+0x5b>
add    $0x1,%rcx
lea    -0x1(%rax),%rsi
cmp    %rax,%rcx
mov    %rsi,%rax
jl     1170 <main+0x40>
jmp    118e <main+0x5e>
mov    %rdx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [25 x i8] c"String is not palindrome\00"
@.str.2 = [21 x i8] c"String is palindrome\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i8]
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, 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]* %4, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %5
store i32 0, i32* %3
br label %10
10: ; preds = %30, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %35
14: ; preds = %10
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %19, %25
br i1 %26, label %27, label %29
27: ; preds = %14
%28 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %37
29: ; preds = %14
br label %30
30: ; preds = %29
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
%33 = load i32, i32* %5
%34 = add nsw i32 %33, -1
store i32 %34, i32* %5
br label %10
35: ; preds = %10
%36 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %37
37: ; preds = %35, %27
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [25 x i8] c"String is not palindrome\00"
@.str.2 = [21 x i8] c"String is palindrome\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %0
%7 = zext i32 %4 to i64
br label %10
8: ; preds = %10
%9 = icmp slt i64 %19, %15
br i1 %9, label %10, label %20
10: ; preds = %6, %8
%11 = phi i64 [ 0, %6 ], [ %19, %8 ]
%12 = phi i64 [ %7, %6 ], [ %15, %8 ]
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %11
%14 = load i8, i8* %13
%15 = add nsw i64 %12, -1
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %14, %17
%19 = add nuw nsw i64 %11, 1
br i1 %18, label %8, label %20
20: ; preds = %8, %10, %0
%21 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), %10 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), %8 ]
%22 = call i32 @printf(i8* dereferenceable(1) %21)
ret i32 0
}