#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  int Cont;
  int I;
  char parola[100];
  int palindromo;
  int medio;
  printf("\n Inserire un nome ");
  scanf("%s", parola);
  Cont = 0;
  while (parola[100] != '\0') {
    Cont++;
  }
  I = 0;
  palindromo = 1;
  medio = Cont / 2;
  while (I < medio && palindromo == 1) {
    if (parola[Cont - 1] != parola[I]) {
      palindromo = 0;
    }
    Cont--;
    I++;
  }
  if (palindromo == 1) {
    printf("\n Il nome è palindromo ");
  } else {
    printf("\n Il nome non è palindromo ");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
movsbl -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1170 <main+0x50>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <main+0x35>
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x74(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x78(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x78(%rbp),%ecx
mov    %al,-0x79(%rbp)
jge    11a7 <main+0x87>
cmpl   $0x1,-0x74(%rbp)
sete   %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    11b7 <main+0x97>
jmp    11f3 <main+0xd3>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x70(%rbp,%rax,1),%eax
movslq -0xc(%rbp),%rcx
movsbl -0x70(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     11dc <main+0xbc>
movl   $0x0,-0x74(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118c <main+0x6c>
cmpl   $0x1,-0x74(%rbp)
jne    120e <main+0xee>
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
jmp    121a <main+0xfa>
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0A Inserire un nome \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [25 x i8] c"\0A Il nome \C3\A8 palindromo \00"
@.str.3 = [29 x i8] c"\0A Il nome non \C3\A8 palindromo \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i8]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, 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)
store i32 0, i32* %2
br label %10
10: ; preds = %15, %0
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 100
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %10
18: ; preds = %10
store i32 0, i32* %3
store i32 1, i32* %5
%19 = load i32, i32* %2
%20 = sdiv i32 %19, 2
store i32 %20, i32* %6
br label %21
21: ; preds = %44, %18
%22 = load i32, i32* %3
%23 = load i32, i32* %6
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, 1
br label %28
28: ; preds = %25, %21
%29 = phi i1 [ false, %21 ], [ %27, %25 ]
br i1 %29, label %30, label %49
30: ; preds = %28
%31 = load i32, i32* %2
%32 = sub nsw i32 %31, 1
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = load i32, i32* %3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp ne i32 %36, %41
br i1 %42, label %43, label %44
43: ; preds = %30
store i32 0, i32* %5
br label %44
44: ; preds = %43, %30
%45 = load i32, i32* %2
%46 = add nsw i32 %45, -1
store i32 %46, i32* %2
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %21
49: ; preds = %28
%50 = load i32, i32* %5
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %56
54: ; preds = %49
%55 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %56
56: ; preds = %54, %52
%57 = load i32, i32* %1
ret i32 %57
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0A Inserire un nome \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [25 x i8] c"\0A Il nome \C3\A8 palindromo \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}