#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*/ inverte(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main() {
  char strOriginal[100] = {}, strInvertida[100] = {};
  while (1) {
    printf("Palavra? ");
    scanf("%s", strOriginal);
    if (strcmp(strOriginal, ".") == 0)
      return 0;
    inverte(strOriginal, strInvertida);
    if (strcmp(strOriginal, strInvertida) == 0) {
      printf("Resultado : %s e capicua\n", strOriginal);
    } else {
      printf("Resultado : %s nao e capicua\n", strOriginal);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe6c(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11c8 <main+0x78>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <inverte@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1209 <main+0xb9>
lea    -0x70(%rbp),%rsi
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    121b <main+0xcb>
lea    -0x70(%rbp),%rsi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1185 <main+0x35>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xd0(%rsp)
lea    0xe48(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe44(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
lea    0xe35(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1266 <main+0x126>
mov    %rsp,%rbx
lea    0x70(%rsp),%r14
lea    0xe31(%rip),%rbp
lea    0xe01(%rip),%r15
lea    0xe04(%rip),%r12
lea    0xe00(%rip),%r13
nopl   (%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <inverte@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
mov    %rbp,%rdi
lea    0xddc(%rip),%rax
cmove  %rax,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1210 <main+0xd0>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Palavra? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [26 x i8] c"Resultado : %s e capicua\0A\00"
@.str.4 = [30 x i8] c"Resultado : %s nao e capicua\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = bitcast [100 x i8]* %2 to i8*
%5 = bitcast [100 x i8]* %3 to i8*
br label %6
6: ; preds = %0, %28
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %6
ret i32 0
14: ; preds = %6
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%17 = call i32 @inverte(i8* %15, i8* %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%20 = call i64 @strcmp(i8* %18, i8* %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %14
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %23)
br label %28
25: ; preds = %14
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %25, %22
br label %6
}

LLVM IR (-O2):
@.str = [10 x i8] c"Palavra? \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [26 x i8] c"Resultado : %s e capicua\0A\00"
@.str.4 = [30 x i8] c"Resultado : %s nao e capicua\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 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %10, %0
ret i32 0
10: ; preds = %0, %10
%11 = call i32 @inverte(i8* %3, i8* %4)
%12 = call i64 @strcmp(i8* %3, i8* %4)
%13 = icmp eq i64 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %14, i8* %3)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%18 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %9, label %10
}