#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*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *, char *);
char *reader();
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strrev(char *);
int main(int argc, char const *argv[]) {
  char *str_1 = reader();
  char *aux = malloc(sizeof(char) * strlen(str_1));
  strcpy(aux, str_1);
  strrev(aux);
  if (strcmp(str_1, aux) == 0) {
    printf("Yeaahh, you wrote a palindrome word. Good job. Check it: %s are "
           "equals to %s\n",
           str_1, aux);
  } else {
    printf("You do not wrote a palindrome word. Try again. Check it: %s are "
           "not equals to %s\n",
           str_1, aux);
  }
  free(str_1);
  free(aux);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <reader@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <strlen@plt>
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
call   10a0 <strrev@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1201 <main+0x81>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe09(%rip),%rdi
call   1070 <printf@plt>
jmp    1215 <main+0x95>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe3e(%rip),%rdi
call   1070 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <reader@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1060 <strlen@plt>
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   10a0 <strrev@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
lea    0xe38(%rip),%rax
lea    0xe7f(%rip),%rdi
cmove  %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1070 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [78 x i8] c"Yeaahh, you wrote a palindrome word. Good job. Check it: %s are equals to %s\0A\00"
@.str.1 = [82 x i8] c"You do not wrote a palindrome word. Try again. Check it: %s are not equals to %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* (...) @reader()
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = sext i32 %10 to i64
%12 = mul i64 1, %11
%13 = trunc i64 %12 to i32
%14 = call i8* @malloc(i32 %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = load i8*, i8** %6
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %7
%19 = call i32 @strrev(i8* %18)
%20 = load i8*, i8** %6
%21 = load i8*, i8** %7
%22 = call i64 @strcmp(i8* %20, i8* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %2
%25 = load i8*, i8** %6
%26 = load i8*, i8** %7
%27 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* %25, i8* %26)
br label %32
28: ; preds = %2
%29 = load i8*, i8** %6
%30 = load i8*, i8** %7
%31 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0), i8* %29, i8* %30)
br label %32
32: ; preds = %28, %24
%33 = load i8*, i8** %6
%34 = call i32 @free(i8* %33)
%35 = load i8*, i8** %7
%36 = call i32 @free(i8* %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [78 x i8] c"Yeaahh, you wrote a palindrome word. Good job. Check it: %s are equals to %s\0A\00"
@.str.1 = [82 x i8] c"You do not wrote a palindrome word. Try again. Check it: %s are not equals to %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @reader()
%4 = tail call i32 @strlen(i8* %3)
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %3)
%7 = tail call i32 @strrev(i8* %5)
%8 = tail call i64 @strcmp(i8* %3, i8* %5)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0)
%11 = tail call i32 @printf(i8* %10, i8* %3, i8* %5)
%12 = tail call i32 @free(i8* %3)
%13 = tail call i32 @free(i8* %5)
ret i32 0
}