#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 */
scalar_t__ e_palindroma(int, char *);
int /*<<< orphan*/ printf(char *);
int strlen(char *);
int main(int argc, char **argv) {
  char *frase;
  int n;
  if (argc >= 2) {
    frase = argv[1];
    n = strlen(frase);
    if (e_palindroma(n, frase)) {
      printf("É palindroma\n");
    } else {
      printf("Não é palindroma\n");
    }
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jl     11a0 <main+0x70>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1050 <e_palindroma@plt>
cmp    $0x0,%rax
je     118f <main+0x5f>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
jmp    119b <main+0x6b>
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     1167 <main+0x37>
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <e_palindroma@plt>
test   %rax,%rax
lea    0xeaa(%rip),%rax
lea    0xeb6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
pop    %rbx
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\C3\89 palindroma\0A\00"
@.str.1 = [20 x i8] c"N\C3\A3o \C3\A9 palindroma\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 2
br i1 %9, label %10, label %25
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = load i8*, i8** %6
%18 = call i64 @e_palindroma(i32 %16, i8* %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %10
%21 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %24
22: ; preds = %10
%23 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
br label %25
25: ; preds = %24, %2
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"N\C3\A3o \C3\A9 palindroma\00"
@str.2 = [14 x i8] c"\C3\89 palindroma\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = tail call i64 @e_palindroma(i32 %7, i8* %6)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0)
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
br label %12
12: ; preds = %4, %2
ret i32 0
}