#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 *);
int /*<<< orphan*/ system(char *);
int main() {
  char string[201], inversa[201];
  int i, j;
  printf("\n\tDigite uma string: ");
  gets(string);
  for (i = (strlen(string) - 1), j = 0; i >= 0; i--, j++)
    inversa[j] = string[i];
  inversa[j] = '\0';
  printf("\n\tString inversa: %s\n", inversa);
  if (strcmp(string, inversa) == 0)
    printf("\n\n\tPALÍNDROMO!!!\n\n\n");
  else
    printf("\n\n\tNÃO É UM PALÍNDROMO!!!\n\n\n");
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xd0(%rbp),%rdi
call   1070 <gets@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
movl   $0x0,-0x1a8(%rbp)
cmpl   $0x0,-0x1a4(%rbp)
jl     11e7 <main+0x97>
movslq -0x1a4(%rbp),%rax
mov    -0xd0(%rbp,%rax,1),%cl
movslq -0x1a8(%rbp),%rax
mov    %cl,-0x1a0(%rbp,%rax,1)
mov    -0x1a4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1a4(%rbp)
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    119b <main+0x4b>
movslq -0x1a8(%rbp),%rax
movb   $0x0,-0x1a0(%rbp,%rax,1)
lea    -0x1a0(%rbp),%rsi
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x1a0(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    123b <main+0xeb>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1249 <main+0xf9>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe11(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x1a8,%rsp
lea    0xe8f(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd0(%rsp),%rbx
mov    %rbx,%rdi
call   1080 <gets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    123a <main+0xda>
mov    %eax,%r14d
cmp    $0x8,%eax
jae    1296 <main+0x136>
xor    %ecx,%ecx
mov    %r14,%rdx
mov    %rcx,%rax
not    %rax
add    %r14,%rax
mov    %r14,%rsi
and    $0x3,%rsi
je     11db <main+0x7b>
xchg   %ax,%ax
add    $0xffffffffffffffff,%rdx
mov    %edx,%edi
movzbl 0xd0(%rsp,%rdi,1),%ebx
mov    %bl,(%rsp,%rcx,1)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    11c0 <main+0x60>
cmp    $0x3,%rax
jb     123a <main+0xda>
mov    $0xfffffffe,%eax
cs nopw 0x0(%rax,%rax,1)
lea    (%rdx,%rax,1),%rsi
lea    0x1(%rsi),%edi
movzbl 0xd0(%rsp,%rdi,1),%ebx
mov    %bl,(%rsp,%rcx,1)
mov    %esi,%edi
movzbl 0xd0(%rsp,%rdi,1),%ebx
mov    %bl,0x1(%rsp,%rcx,1)
add    $0xffffffff,%esi
movzbl 0xd0(%rsp,%rsi,1),%ebx
mov    %bl,0x2(%rsp,%rcx,1)
add    $0xfffffffffffffffc,%rdx
mov    %edx,%esi
movzbl 0xd0(%rsp,%rsi,1),%ebx
mov    %bl,0x3(%rsp,%rcx,1)
add    $0x4,%rcx
cmp    %rcx,%r14
jne    11f0 <main+0x90>
movb   $0x0,(%rsp,%r14,1)
lea    0xdd0(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd0(%rsp),%rdi
mov    %rbx,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
lea    0xde4(%rip),%rax
lea    0xdbe(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0xda8(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x1a8,%rsp
pop    %rbx
pop    %r14
ret
lea    -0x1(%r14),%rsi
lea    -0x1(%rax),%edx
xor    %ecx,%ecx
cmp    %esi,%edx
jb     11a9 <main+0x49>
mov    %rsi,%rdx
shr    $0x20,%rdx
mov    %r14,%rdx
jne    11ac <main+0x4c>
cmp    $0x20,%eax
jae    12c3 <main+0x163>
xor    %ecx,%ecx
jmp    136b <main+0x20b>
mov    %r14d,%ecx
and    $0xffffffe0,%ecx
xor    %eax,%eax
pxor   %xmm0,%xmm0
nop
mov    %esi,%edx
movdqu 0xb1(%rsp,%rdx,1),%xmm1
movdqu 0xc1(%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    12d0 <main+0x170>
cmp    %r14,%rcx
je     123a <main+0xda>
test   $0x18,%r14b
je     13d2 <main+0x272>
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
nopw   0x0(%rax,%rax,1)
mov    %esi,%edi
movq   0xc9(%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    1390 <main+0x230>
cmp    %r14,%rcx
jne    11ac <main+0x4c>
jmp    123a <main+0xda>
mov    %r14d,%edx
and    $0x1f,%edx
jmp    11ac <main+0x4c>

LLVM IR (-O0):
@.str = [22 x i8] c"\0A\09Digite uma string: \00"
@.str.1 = [22 x i8] c"\0A\09String inversa: %s\0A\00"
@.str.2 = [21 x i8] c"\0A\0A\09PAL\C3\8DNDROMO!!!\0A\0A\0A\00"
@.str.3 = [32 x i8] c"\0A\0A\09N\C3\83O \C3\89 UM PAL\C3\8DNDROMO!!!\0A\0A\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [201 x i8]
%3 = alloca [201 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [201 x i8], [201 x i8]* %2, i64 0, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [201 x i8], [201 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %4
store i32 0, i32* %5
br label %12
12: ; preds = %23, %0
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %12
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [201 x i8], [201 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [201 x i8], [201 x i8]* %3, i64 0, i64 %21
store i8 %19, i8* %22
br label %23
23: ; preds = %15
%24 = load i32, i32* %4
%25 = add nsw i32 %24, -1
store i32 %25, i32* %4
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %12
28: ; preds = %12
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [201 x i8], [201 x i8]* %3, i64 0, i64 %30
store i8 0, i8* %31
%32 = getelementptr inbounds [201 x i8], [201 x i8]* %3, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %32)
%34 = getelementptr inbounds [201 x i8], [201 x i8]* %2, i64 0, i64 0
%35 = getelementptr inbounds [201 x i8], [201 x i8]* %3, i64 0, i64 0
%36 = call i64 @strcmp(i8* %34, i8* %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %28
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %42
40: ; preds = %28
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %40, %38
%43 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

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