#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[100] != 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    11ea <main+0xca>
movsbl -0xc(%rbp),%eax
movslq -0xc(%rbp),%rcx
movsbl -0x70(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     11d3 <main+0xb3>
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    1205 <main+0xe5>
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
jmp    1211 <main+0xf1>
lea    0xe24(%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 = %41, %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 %46
30: ; preds = %28
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 100
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %33, %38
br i1 %39, label %40, label %41
40: ; preds = %30
store i32 0, i32* %5
br label %41
41: ; preds = %40, %30
%42 = load i32, i32* %2
%43 = add nsw i32 %42, -1
store i32 %43, i32* %2
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %21
46: ; preds = %28
%47 = load i32, i32* %5
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %53
51: ; preds = %46
%52 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %51, %49
%54 = load i32, i32* %1
ret i32 %54
}

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
}