#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);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char word[50];
  int i = 0;
  int check = 0;
  scanf("%s", word);
  for (i = 0; i < strlen(word) / 2; i++) {
    if (word[i] == word[(strlen(word) - 1) - i]) {
      check = 1;
    } else {
      check = 0;
      break;
    }
  }
  printf("%d", check);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x4c(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
cmp    %ecx,%eax
jge    11e3 <main+0xb3>
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
mov    %eax,-0x50(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
sub    $0x1,%ecx
sub    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsbl -0x40(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11c4 <main+0x94>
movl   $0x1,-0x48(%rbp)
jmp    11d0 <main+0xa0>
movl   $0x0,-0x48(%rbp)
jmp    11e3 <main+0xb3>
jmp    11d5 <main+0xa5>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1164 <main+0x34>
mov    -0x48(%rbp),%esi
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0xebd(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %r14d,%r14d
cmp    $0x2,%eax
jl     11ad <main+0x7d>
mov    $0xffffffff,%ebp
xor    %r14d,%r14d
mov    %rsp,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rbx,1),%r12d
mov    %r15,%rdi
call   1030 <strlen@plt>
add    %ebp,%eax
cltq
cmp    (%rsp,%rax,1),%r12b
jne    11ad <main+0x7d>
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
add    $0xffffffff,%ebp
cmp    %rax,%rbx
jl     1170 <main+0x40>
mov    $0x1,%r14d
lea    0xe4f(%rip),%rdi
mov    %r14d,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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