#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 /*<<< orphan*/ system(char *);
int main() {
  char Parola1[100];
  char Parola2[100];
  int Flag;
  int I;
  printf("inserisci una parola: ");
  scanf("%s", Parola1);
  printf("\ninserisci una seconda parola per il confronto: ");
  scanf("%s", Parola2);
  I = 0;
  Flag = 0;
  while (Flag == 0 && (Parola1[I] != '\0' || Parola2[I] != '\0')) {
    if (Parola1[I] != Parola2[I]) {
      Flag = 1;
    }
    I++;
  }
  if (Flag == 0) {
    printf("\nle due parole sono uguali\n");
  } else {
    printf("\nle due parole non sono uguali\n");
  }
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1050 <scanf@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0xe8(%rbp)
movl   $0x0,-0xe4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xe4(%rbp)
mov    %al,-0xe9(%rbp)
jne    11ea <main+0xba>
movslq -0xe8(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xea(%rbp)
jne    11de <main+0xae>
movslq -0xe8(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
setne  %al
mov    %al,-0xea(%rbp)
mov    -0xea(%rbp),%al
mov    %al,-0xe9(%rbp)
mov    -0xe9(%rbp),%al
test   $0x1,%al
jne    11fd <main+0xcd>
jmp    123e <main+0x10e>
movslq -0xe8(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
movslq -0xe8(%rbp),%rcx
movsbl -0xe0(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     122a <main+0xfa>
movl   $0x1,-0xe4(%rbp)
mov    -0xe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe8(%rbp)
jmp    1191 <main+0x61>
cmpl   $0x0,-0xe4(%rbp)
jne    125c <main+0x12c>
lea    0xdf9(%rip),%rdi
call   1040 <printf@plt>
jmp    1268 <main+0x138>
lea    0xe04(%rip),%rdi
call   1040 <printf@plt>
lea    0xe18(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
lea    0xebc(%rip),%rbx
lea    0x70(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeab(%rip),%rdi
call   1050 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
xor    %eax,%eax
lea    0xee8(%rip),%rdi
lea    0xec2(%rip),%rsi
nop
movzbl 0x70(%rsp,%rax,1),%ecx
movzbl (%rsp,%rax,1),%ebx
mov    %ecx,%edx
or     %bl,%dl
je     11aa <main+0x6a>
add    $0x1,%rax
cmp    %bl,%cl
je     1190 <main+0x50>
mov    %rsi,%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"inserisci una parola: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [49 x i8] c"\0Ainserisci una seconda parola per il confronto: \00"
@.str.3 = [28 x i8] c"\0Ale due parole sono uguali\0A\00"
@.str.4 = [32 x i8] c"\0Ale due parole non sono uguali\0A\00"
@.str.5 = [6 x i8] c"PAUSE\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 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
store i32 0, i32* %5
store i32 0, i32* %4
br label %12
12: ; preds = %46, %0
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %31
15: ; preds = %12
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %29, label %22
22: ; preds = %15
%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
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 0
br label %29
29: ; preds = %22, %15
%30 = phi i1 [ true, %15 ], [ %28, %22 ]
br label %31
31: ; preds = %29, %12
%32 = phi i1 [ false, %12 ], [ %30, %29 ]
br i1 %32, label %33, label %49
33: ; preds = %31
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = load i32, i32* %5
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %38, %43
br i1 %44, label %45, label %46
45: ; preds = %33
store i32 1, i32* %4
br label %46
46: ; preds = %45, %33
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
store i32 %48, i32* %5
br label %12
49: ; preds = %31
%50 = load i32, i32* %4
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %56
54: ; preds = %49
%55 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %56
56: ; preds = %54, %52
%57 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%58 = load i32, i32* %1
ret i32 %58
}

LLVM IR (-O2):
@.str = [23 x i8] c"inserisci una parola: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [49 x i8] c"\0Ainserisci una seconda parola per il confronto: \00"
@.str.5 = [6 x i8] c"PAUSE\00"
@str = [31 x i8] c"\0Ale due parole non sono uguali\00"
@str.6 = [27 x i8] c"\0Ale due parole sono uguali\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 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 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 i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %9
9: ; preds = %0, %18
%10 = phi i64 [ 0, %0 ], [ %20, %18 ]
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %10
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
%17 = select i1 %13, i1 %16, i1 false
br i1 %17, label %21, label %18
18: ; preds = %9
%19 = icmp eq i8 %12, %15
%20 = add nuw i64 %10, 1
br i1 %19, label %9, label %21
21: ; preds = %18, %9
%22 = phi i8* [ getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0), %9 ], [ getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0), %18 ]
%23 = call i32 @puts(i8* dereferenceable(1) %22)
%24 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}