#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() {
  char palindrom[800];
  scanf("%s", palindrom);
  int b = strlen(palindrom);
  int z = 0;
  int c = b - 1;
  while (z < c) {
    if (palindrom[z] != palindrom[c]) {
      z = 1;
      break;
    }
    c--;
    z++;
  }
  if (z == 1)
    printf("\n0");
  else
    printf("\n1");
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x330(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x330(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x334(%rbp)
movl   $0x0,-0x338(%rbp)
mov    -0x334(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x33c(%rbp)
mov    -0x338(%rbp),%eax
cmp    -0x33c(%rbp),%eax
jge    11ea <main+0xba>
movslq -0x338(%rbp),%rax
movsbl -0x330(%rbp,%rax,1),%eax
ff
movslq -0x33c(%rbp),%rcx
movsbl -0x330(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     11c7 <main+0x97>
movl   $0x1,-0x338(%rbp)
jmp    11ea <main+0xba>
mov    -0x33c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x33c(%rbp)
mov    -0x338(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x338(%rbp)
jmp    1180 <main+0x50>
cmpl   $0x1,-0x338(%rbp)
jne    1208 <main+0xd8>
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
jmp    1214 <main+0xe4>
lea    0xdf7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x320,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     118f <main+0x5f>
mov    %eax,%eax
add    $0xfffffffffffffffe,%rax
xor    %ecx,%ecx
lea    0xe9d(%rip),%rdi
cs nopw 0x0(%rax,%rax,1)
movzbl (%rsp,%rcx,1),%edx
cmp    0x1(%rsp,%rax,1),%dl
jne    1196 <main+0x66>
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1170 <main+0x40>
cmp    $0x1,%ecx
je     1196 <main+0x66>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x320,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"\0A0\00"
@.str.2 = [3 x i8] c"\0A1\00"
define i32 @main() {
%1 = alloca [800 x i8]
%2 = getelementptr inbounds [800 x i8], [800 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, 1
br i1 %5, label %6, label %24
6: ; preds = %0
%7 = zext i32 %4 to i64
%8 = add nsw i64 %7, -1
br label %9
9: ; preds = %6, %17
%10 = phi i64 [ 0, %6 ], [ %18, %17 ]
%11 = phi i64 [ %8, %6 ], [ %19, %17 ]
%12 = getelementptr inbounds [800 x i8], [800 x i8]* %1, i64 0, i64 %10
%13 = load i8, i8* %12
%14 = getelementptr inbounds [800 x i8], [800 x i8]* %1, i64 0, i64 %11
%15 = load i8, i8* %14
%16 = icmp eq i8 %13, %15
br i1 %16, label %17, label %25
17: ; preds = %9
%18 = add nuw nsw i64 %10, 1
%19 = add nsw i64 %11, -1
%20 = icmp slt i64 %18, %19
br i1 %20, label %9, label %21
21: ; preds = %17
%22 = trunc i64 %18 to i32
%23 = icmp eq i32 %22, 1
br i1 %23, label %25, label %24
24: ; preds = %0, %21
br label %25
25: ; preds = %9, %21, %24
%26 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %24 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %21 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %9 ]
%27 = call i32 @printf(i8* dereferenceable(1) %26)
ret i32 0
}