#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 main() {
  char word[50];
  scanf("%[^\n]s", word);
  int l = 0, i, j;
  while (word[l] != '\0')
    l++;
  for (i = 0, j = l - 1; i < l / 2; i++, j--) {
    if (word[i] != word[j]) {
      printf("0");
      break;
    }
  }
  if (i == l / 2)
    printf("1");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x44(%rbp)
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1166 <main+0x46>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1146 <main+0x26>
movl   $0x0,-0x48(%rbp)
mov    -0x44(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
cmp    %ecx,%eax
jge    11db <main+0xbb>
movslq -0x48(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
movslq -0x4c(%rbp),%rcx
movsbl -0x40(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     11bf <main+0x9f>
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <main+0xbb>
jmp    11c4 <main+0xa4>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x4c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4c(%rbp)
jmp    1176 <main+0x56>
mov    -0x48(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
cmp    %ecx,%eax
jne    1205 <main+0xe5>
lea    0xe09(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
lea    0xed3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    $0xffffffff,%ecx
nopl   (%rax)
add    $0x1,%ecx
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1140 <main+0x20>
mov    %ecx,%ebp
shr    %ebp
xor    %edi,%edi
cmp    $0x2,%ecx
jb     1195 <main+0x75>
cmp    $0x2,%ebp
mov    $0x1,%edi
cmovae %ebp,%edi
mov    $0x1,%edx
cmovae %ebp,%edx
neg    %rdx
movslq %ecx,%rcx
add    %rsp,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rsp,%rsi
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%rsi),%eax
cmp    (%rcx,%rbx,1),%al
jne    11ac <main+0x8c>
add    $0xffffffffffffffff,%rbx
add    $0x1,%rsi
cmp    %rbx,%rdx
jne    1180 <main+0x60>
cmp    %ebp,%edi
jne    11a3 <main+0x83>
mov    $0x31,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret
neg    %ebx
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
cmp    %ebp,%edi
je     1199 <main+0x79>
jmp    11a3 <main+0x83>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %4
4: ; preds = %4, %0
%5 = phi i64 [ %9, %4 ], [ 0, %0 ]
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = add nuw i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
%12 = lshr i32 %11, 1
%13 = icmp ult i32 %11, 2
br i1 %13, label %34, label %14
14: ; preds = %10
%15 = shl i64 %5, 32
%16 = ashr exact i64 %15, 32
%17 = call i32 @llvm.umax.i32(i32 %12, i32 1)
%18 = zext i32 %17 to i64
br label %19
19: ; preds = %14, %31
%20 = phi i64 [ 0, %14 ], [ %32, %31 ]
%21 = phi i64 [ %16, %14 ], [ %22, %31 ]
%22 = add nsw i64 %21, -1
%23 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %20
%24 = load i8, i8* %23
%25 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %22
%26 = load i8, i8* %25
%27 = icmp eq i8 %24, %26
br i1 %27, label %31, label %28
28: ; preds = %19
%29 = trunc i64 %20 to i32
%30 = call i32 @putchar(i32 48)
br label %34
31: ; preds = %19
%32 = add nuw nsw i64 %20, 1
%33 = icmp eq i64 %32, %18
br i1 %33, label %34, label %19
34: ; preds = %31, %10, %28
%35 = phi i32 [ %29, %28 ], [ 0, %10 ], [ %17, %31 ]
%36 = icmp eq i32 %35, %12
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @putchar(i32 49)
br label %39
39: ; preds = %37, %34
ret i32 0
}