#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char **);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strrev(char *);
main() {
  char palavra[10];
  char palavrain[10];
  int i = 0;
  printf("Entre com uma palavra: ");
  scanf("%s", &palavra);
  strcpy(palavrain, palavra);
  strrev(palavrain);
  printf("\n");
  puts(palavra);
  puts(palavrain);
  printf("\n");
  if (strcmp(palavra, palavrain) == 0) {
    printf("Palindrome!!!\n");
  } else {
    printf("Nao eh palilndrome\n`");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x18(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x18(%rbp),%rdi
call   1080 <strrev@plt>
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
lea    -0xe(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x18(%rbp),%rdi
call   1040 <puts@plt>
lea    0xe5b(%rip),%rdi
call   1050 <printf@plt>
lea    -0xe(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11fa <main+0x9a>
lea    0xe2b(%rip),%rdi
call   1050 <printf@plt>
jmp    1206 <main+0xa6>
lea    0xe29(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe82(%rip),%rdi
call   1060 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    0xe(%rsp),%r14
mov    %r14,%rsi
call   1080 <scanf@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1090 <strrev@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     11f1 <main+0x81>
lea    0xe31(%rip),%rdi
call   1060 <printf@plt>
jmp    11fd <main+0x8d>
lea    0xe38(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Entre com uma palavra: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [15 x i8] c"Palindrome!!!\0A\00"
@.str.4 = [21 x i8] c"Nao eh palilndrome\0A`\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = bitcast [10 x i8]* %2 to i8**
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%12 = call i32 @strrev(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%15 = call i32 @puts(i8* %14)
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%17 = call i32 @puts(i8* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%21 = call i64 @strcmp(i8* %19, i8* %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %0
%24 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %27
25: ; preds = %0
%26 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [24 x i8] c"Entre com uma palavra: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.4 = [21 x i8] c"Nao eh palilndrome\0A`\00"
@str = [14 x i8] c"Palindrome!!!\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = bitcast [10 x i8]* %1 to i8**
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %6)
%8 = call i32 @strcpy(i8* %4, i8* %3)
%9 = call i32 @strrev(i8* %4)
%10 = call i32 @putchar(i32 10)
%11 = call i32 @puts(i8* %3)
%12 = call i32 @puts(i8* %4)
%13 = call i32 @putchar(i32 10)
%14 = call i64 @strcmp(i8* %3, i8* %4)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %20
18: ; preds = %0
%19 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
ret i32 0
}