#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 a[256];
  int i, len, palindrome;
  scanf("%s", a);
  palindrome = 1;
  len = strlen(a);
  for (i = 0; i < len; i++) {
    if (a[i] != a[len - i - 1]) {
      palindrome = 0;
      break;
    }
  }
  if (palindrome)
    printf("É palindrome\n");
  else
    printf("Nao é palindrome\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x1,-0x11c(%rbp)
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x118(%rbp)
movl   $0x0,-0x114(%rbp)
mov    -0x114(%rbp),%eax
cmp    -0x118(%rbp),%eax
jge    11e6 <main+0xb6>
movslq -0x114(%rbp),%rax
movsbl -0x110(%rbp,%rax,1),%eax
ff
mov    -0x118(%rbp),%ecx
sub    -0x114(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl -0x110(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     11cd <main+0x9d>
movl   $0x0,-0x11c(%rbp)
jmp    11e6 <main+0xb6>
jmp    11d2 <main+0xa2>
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    117b <main+0x4b>
cmpl   $0x0,-0x11c(%rbp)
je     1204 <main+0xd4>
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
jmp    1210 <main+0xe0>
lea    0xe07(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xebc(%rip),%rdi
test   %eax,%eax
jle    118d <main+0x5d>
mov    %eax,%ecx
add    $0xffffffff,%eax
xor    %edx,%edx
lea    0xe98(%rip),%r8
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rdx,1),%ebx
movslq %eax,%rsi
cmp    (%rsp,%rsi,1),%bl
jne    118a <main+0x5a>
add    $0x1,%rdx
add    $0xffffffff,%eax
cmp    %rdx,%rcx
jne    1170 <main+0x40>
jmp    118d <main+0x5d>
mov    %r8,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

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