#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 *, int *);
int main() {
  int x, y;
  printf("Calcolo del numero maggiore fra due numeri\n");
  printf("Inserisci il primo numero: ");
  scanf("%d", &x);
  printf("Inserisci il secondo numero: ");
  scanf("%d", &y);
  if (x > y) {
    printf("%d è più alto di %d", x, y);
  } else if (x == y) {
    printf("%d è uguale a %d", x, y);
  } else {
    printf("%d è più alto di %d", y, x);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf39(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    119e <main+0x7e>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11c3 <main+0xa3>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d7 <main+0xb7>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf26(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf09(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x8(%rsp),%edx
cmp    %edx,%eax
jle    1195 <main+0x65>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
jmp    11ad <main+0x7d>
jne    11a2 <main+0x72>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
jmp    11ab <main+0x7b>
lea    0xe91(%rip),%rdi
mov    %edx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Calcolo del numero maggiore fra due numeri\0A\00"
@.str.1 = [28 x i8] c"Inserisci il primo numero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [30 x i8] c"Inserisci il secondo numero: \00"
@.str.4 = [22 x i8] c"%d \C3\A8 pi\C3\B9 alto di %d\00"
@.str.5 = [18 x i8] c"%d \C3\A8 uguale a %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %0
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %13, i32 %14)
br label %29
16: ; preds = %0
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = icmp eq i32 %17, %18
br i1 %19, label %20, label %24
20: ; preds = %16
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %21, i32 %22)
br label %28
24: ; preds = %16
%25 = load i32, i32* %3
%26 = load i32, i32* %2
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %25, i32 %26)
br label %28
28: ; preds = %24, %20
br label %29
29: ; preds = %28, %12
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Inserisci il primo numero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [30 x i8] c"Inserisci il secondo numero: \00"
@.str.4 = [22 x i8] c"%d \C3\A8 pi\C3\B9 alto di %d\00"
@.str.5 = [18 x i8] c"%d \C3\A8 uguale a %d\00"
@str = [43 x i8] c"Calcolo del numero maggiore fra due numeri\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 %11)
br label %21
15: ; preds = %0
%16 = icmp eq i32 %10, %11
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %10, i32 %10)
br label %21
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %11, i32 %10)
br label %21
21: ; preds = %17, %19, %13
ret i32 0
}