#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 *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  char letter, word[100], word2[100];
  int l, i = 0;
  scanf("%s", word);
  l = strlen(word) - 1;
  strcpy(word2, word);
  while (l > i) {
    letter = word[l];
    word[l] = word[i];
    word[i] = letter;
    i++;
    l--;
  }
  if (strcmp(word, word2) == 0)
    printf("1");
  else
    printf("0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xe8(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xe4(%rbp)
lea    -0xe0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xe4(%rbp),%eax
cmp    -0xe8(%rbp),%eax
jle    1205 <main+0xb5>
movslq -0xe4(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%al
mov    %al,-0x5(%rbp)
movslq -0xe8(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
movslq -0xe4(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x5(%rbp),%cl
movslq -0xe8(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0xe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe8(%rbp)
mov    -0xe4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xe4(%rbp)
jmp    119e <main+0x4e>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1230 <main+0xe0>
lea    0xddd(%rip),%rdi
call   1050 <printf@plt>
jmp    123c <main+0xec>
lea    0xdce(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xe9f(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1070 <scanf@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
lea    0x70(%rsp),%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
cmp    $0x2,%ebx
jl     11b0 <main+0x60>
mov    %ebx,%eax
add    $0xfffffffffffffffe,%rax
xor    %ecx,%ecx
movzbl 0x1(%rsp,%rax,1),%edx
movzbl (%rsp,%rcx,1),%ebx
mov    %bl,0x1(%rsp,%rax,1)
mov    %dl,(%rsp,%rcx,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jg     1190 <main+0x40>
mov    %rsp,%rdi
lea    0x70(%rsp),%rsi
call   1060 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
or     $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\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 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @strlen(i8* %3)
%7 = call i32 @strcpy(i8* %4, i8* %3)
%8 = icmp sgt i32 %6, 1
br i1 %8, label %9, label %22
9: ; preds = %0
%10 = zext i32 %6 to i64
%11 = add nsw i64 %10, -1
br label %12
12: ; preds = %9, %12
%13 = phi i64 [ 0, %9 ], [ %19, %12 ]
%14 = phi i64 [ %11, %9 ], [ %20, %12 ]
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %13
%18 = load i8, i8* %17
store i8 %18, i8* %15
store i8 %16, i8* %17
%19 = add nuw nsw i64 %13, 1
%20 = add nsw i64 %14, -1
%21 = icmp sgt i64 %20, %19
br i1 %21, label %12, label %22
22: ; preds = %12, %0
%23 = call i64 @strcmp(i8* %3, i8* %4)
%24 = icmp eq i64 %23, 0
%25 = select i1 %24, i32 49, i32 48
%26 = call i32 @putchar(i32 %25)
ret i32 0
}