#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
main() {
  char texto[100], inverso[100];
  int i, j;
  printf("Digite um texto: ");
  gets(texto);
  printf("O tamanho e : %d \n", strlen(texto));
  j = 0;
  for (i = strlen(texto) - 1; i >= 0; i--) {
    inverso[j] = texto[i];
    j++;
  }
  inverso[j] = '\0';
  printf("O inverso e : %s \n", inverso);
  if (strcmp(texto, inverso) == 0) {
    printf("E palindromo");
  } else {
    printf("Nao e palindromo");
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xe8(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xe4(%rbp)
cmpl   $0x0,-0xe4(%rbp)
jl     11e7 <main+0xa7>
movslq -0xe4(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
movslq -0xe8(%rbp),%rax
mov    %cl,-0xe0(%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+0x5e>
movslq -0xe8(%rbp),%rax
movb   $0x0,-0xe0(%rbp,%rax,1)
lea    -0xe0(%rbp),%rsi
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1238 <main+0xf8>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1246 <main+0x106>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xe9f(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <gets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe8b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    123e <main+0xee>
mov    %eax,%r14d
cmp    $0x8,%eax
jae    1299 <main+0x149>
xor    %ecx,%ecx
mov    %r14,%rdx
mov    %rcx,%rax
not    %rax
add    %r14,%rax
mov    %r14,%rsi
and    $0x3,%rsi
je     11e8 <main+0x98>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xffffffffffffffff,%rdx
mov    %edx,%edi
movzbl 0x70(%rsp,%rdi,1),%ebx
mov    %bl,(%rsp,%rcx,1)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    11d0 <main+0x80>
cmp    $0x3,%rax
jb     123e <main+0xee>
mov    $0xfffffffe,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rdx,%rax,1),%rsi
lea    0x1(%rsi),%edi
movzbl 0x70(%rsp,%rdi,1),%ebx
mov    %bl,(%rsp,%rcx,1)
mov    %esi,%edi
movzbl 0x70(%rsp,%rdi,1),%ebx
mov    %bl,0x1(%rsp,%rcx,1)
add    $0xffffffff,%esi
movzbl 0x70(%rsp,%rsi,1),%ebx
mov    %bl,0x2(%rsp,%rcx,1)
add    $0xfffffffffffffffc,%rdx
mov    %edx,%esi
movzbl 0x70(%rsp,%rsi,1),%ebx
mov    %bl,0x3(%rsp,%rcx,1)
add    $0x4,%rcx
cmp    %rcx,%r14
jne    1200 <main+0xb0>
movb   $0x0,(%rsp,%r14,1)
lea    0xddb(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x70(%rsp),%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
lea    0xdca(%rip),%rax
lea    0xdd0(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd9c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret
lea    -0x1(%r14),%rsi
lea    -0x1(%rax),%edx
xor    %ecx,%ecx
cmp    %esi,%edx
jb     11ae <main+0x5e>
mov    %rsi,%rdx
shr    $0x20,%rdx
mov    %r14,%rdx
jne    11b1 <main+0x61>
cmp    $0x20,%eax
jae    12c6 <main+0x176>
xor    %ecx,%ecx
jmp    1375 <main+0x225>
mov    %r14d,%ecx
and    $0xffffffe0,%ecx
xor    %eax,%eax
pxor   %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %esi,%edx
movdqu 0x51(%rsp,%rdx,1),%xmm1
movdqu 0x61(%rsp,%rdx,1),%xmm2
movdqa %xmm2,%xmm3
punpcklbw %xmm0,%xmm3
pshufd $0x4e,%xmm3,%xmm3
pshuflw $0x1b,%xmm3,%xmm3
pshufhw $0x1b,%xmm3,%xmm3
punpckhbw %xmm0,%xmm2
pshufd $0x4e,%xmm2,%xmm2
pshuflw $0x1b,%xmm2,%xmm2
pshufhw $0x1b,%xmm2,%xmm2
packuswb %xmm3,%xmm2
movdqa %xmm1,%xmm3
punpcklbw %xmm0,%xmm3
pshufd $0x4e,%xmm3,%xmm3
pshuflw $0x1b,%xmm3,%xmm3
pshufhw $0x1b,%xmm3,%xmm3
punpckhbw %xmm0,%xmm1
pshufd $0x4e,%xmm1,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
packuswb %xmm3,%xmm1
movdqa %xmm2,(%rsp,%rax,1)
movdqa %xmm1,0x10(%rsp,%rax,1)
add    $0x20,%rax
add    $0xffffffffffffffe0,%rsi
cmp    %rax,%rcx
jne    12e0 <main+0x190>
cmp    %r14,%rcx
je     123e <main+0xee>
test   $0x18,%r14b
je     13df <main+0x28f>
mov    %rcx,%rax
mov    %r14d,%ecx
and    $0xfffffff8,%ecx
mov    %r14d,%edx
and    $0x7,%edx
mov    %rax,%rsi
not    %rsi
add    %r14,%rsi
pxor   %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %esi,%edi
movq   0x69(%rsp,%rdi,1),%xmm1
punpcklbw %xmm0,%xmm1
pshufd $0x4e,%xmm1,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
packuswb %xmm1,%xmm1
movq   %xmm1,(%rsp,%rax,1)
add    $0x8,%rax
add    $0xfffffffffffffff8,%rsi
cmp    %rax,%rcx
jne    13a0 <main+0x250>
cmp    %r14,%rcx
jne    11b1 <main+0x61>
jmp    123e <main+0xee>
mov    %r14d,%edx
and    $0x1f,%edx
jmp    11b1 <main+0x61>

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

LLVM IR (-O2):
@.str = [18 x i8] c"Digite um texto: \00"
@.str.1 = [19 x i8] c"O tamanho e : %d \0A\00"
@.str.2 = [19 x i8] c"O inverso e : %s \0A\00"
@.str.3 = [13 x i8] c"E palindromo\00"
@.str.4 = [17 x i8] c"Nao e palindromo\00"
@str = [2 x i8] c"\0A\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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gets(i8* %3)
%7 = call i32 @strlen(i8* %3)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @strlen(i8* %3)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %124
11: ; preds = %0
%12 = zext i32 %9 to i64
%13 = icmp ult i32 %9, 8
br i1 %13, label %71, label %14
14: ; preds = %11
%15 = add nsw i64 %12, -1
%16 = add i32 %9, -1
%17 = trunc i64 %15 to i32
%18 = icmp ult i32 %16, %17
%19 = icmp ugt i64 %15, 4294967295
%20 = or i1 %18, %19
br i1 %20, label %71, label %21
21: ; preds = %14
%22 = icmp ult i32 %9, 32
br i1 %22, label %51, label %23
23: ; preds = %21
%24 = and i64 %12, 4294967264
br label %25
25: ; preds = %25, %23
%26 = phi i64 [ 0, %23 ], [ %43, %25 ]
%27 = xor i64 %26, -1
%28 = add i64 %27, %12
%29 = and i64 %28, 4294967295
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %29
%31 = getelementptr inbounds i8, i8* %30, i64 -15
%32 = bitcast i8* %31 to <16 x i8>*
%33 = load <16 x i8>, <16 x i8>* %32
%34 = shufflevector <16 x i8> %33, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%35 = getelementptr inbounds i8, i8* %30, i64 -31
%36 = bitcast i8* %35 to <16 x i8>*
%37 = load <16 x i8>, <16 x i8>* %36
%38 = shufflevector <16 x i8> %37, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %26
%40 = bitcast i8* %39 to <16 x i8>*
store <16 x i8> %34, <16 x i8>* %40
%41 = getelementptr inbounds i8, i8* %39, i64 16
%42 = bitcast i8* %41 to <16 x i8>*
store <16 x i8> %38, <16 x i8>* %42
%43 = add nuw i64 %26, 32
%44 = icmp eq i64 %43, %24
br i1 %44, label %45, label %25
45: ; preds = %25
%46 = icmp eq i64 %24, %12
br i1 %46, label %122, label %47
47: ; preds = %45
%48 = and i64 %12, 31
%49 = and i64 %12, 24
%50 = icmp eq i64 %49, 0
br i1 %50, label %71, label %51
51: ; preds = %21, %47
%52 = phi i64 [ %24, %47 ], [ 0, %21 ]
%53 = and i64 %12, 4294967288
%54 = and i64 %12, 7
br label %55
55: ; preds = %55, %51
%56 = phi i64 [ %52, %51 ], [ %67, %55 ]
%57 = xor i64 %56, -1
%58 = add i64 %57, %12
%59 = and i64 %58, 4294967295
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %59
%61 = getelementptr inbounds i8, i8* %60, i64 -7
%62 = bitcast i8* %61 to <8 x i8>*
%63 = load <8 x i8>, <8 x i8>* %62
%64 = shufflevector <8 x i8> %63, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %56
%66 = bitcast i8* %65 to <8 x i8>*
store <8 x i8> %64, <8 x i8>* %66
%67 = add nuw i64 %56, 8
%68 = icmp eq i64 %67, %53
br i1 %68, label %69, label %55
69: ; preds = %55
%70 = icmp eq i64 %53, %12
br i1 %70, label %122, label %71
71: ; preds = %14, %11, %47, %69
%72 = phi i64 [ 0, %11 ], [ 0, %14 ], [ %24, %47 ], [ %53, %69 ]
%73 = phi i64 [ %12, %11 ], [ %12, %14 ], [ %48, %47 ], [ %54, %69 ]
%74 = xor i64 %72, -1
%75 = add nsw i64 %74, %12
%76 = and i64 %12, 3
%77 = icmp eq i64 %76, 0
br i1 %77, label %90, label %78
78: ; preds = %71, %78
%79 = phi i64 [ %87, %78 ], [ %72, %71 ]
%80 = phi i64 [ %82, %78 ], [ %73, %71 ]
%81 = phi i64 [ %88, %78 ], [ 0, %71 ]
%82 = add nsw i64 %80, -1
%83 = and i64 %82, 4294967295
%84 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %83
%85 = load i8, i8* %84
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %79
store i8 %85, i8* %86
%87 = add nuw nsw i64 %79, 1
%88 = add i64 %81, 1
%89 = icmp eq i64 %88, %76
br i1 %89, label %90, label %78
90: ; preds = %78, %71
%91 = phi i64 [ %72, %71 ], [ %87, %78 ]
%92 = phi i64 [ %73, %71 ], [ %82, %78 ]
%93 = icmp ult i64 %75, 3
br i1 %93, label %122, label %94
94: ; preds = %90, %94
%95 = phi i64 [ %120, %94 ], [ %91, %90 ]
%96 = phi i64 [ %115, %94 ], [ %92, %90 ]
%97 = add i64 %96, 4294967295
%98 = and i64 %97, 4294967295
%99 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %98
%100 = load i8, i8* %99
%101 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %95
store i8 %100, i8* %101
%102 = add nuw nsw i64 %95, 1
%103 = add i64 %96, 4294967294
%104 = and i64 %103, 4294967295
%105 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %104
%106 = load i8, i8* %105
%107 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %102
store i8 %106, i8* %107
%108 = add nuw nsw i64 %95, 2
%109 = add i64 %96, 4294967293
%110 = and i64 %109, 4294967295
%111 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %110
%112 = load i8, i8* %111
%113 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %108
store i8 %112, i8* %113
%114 = add nuw nsw i64 %95, 3
%115 = add nsw i64 %96, -4
%116 = and i64 %115, 4294967295
%117 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %116
%118 = load i8, i8* %117
%119 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %114
store i8 %118, i8* %119
%120 = add nuw nsw i64 %95, 4
%121 = icmp eq i64 %120, %12
br i1 %121, label %122, label %94
122: ; preds = %90, %94, %69, %45
%123 = zext i32 %9 to i64
br label %124
124: ; preds = %0, %122
%125 = phi i64 [ %123, %122 ], [ 0, %0 ]
%126 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %125
store i8 0, i8* %126
%127 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%128 = call i64 @strcmp(i8* %3, i8* %4)
%129 = icmp eq i64 %128, 0
%130 = select i1 %129, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0)
%131 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %130)
%132 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}