#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 inputint(char *, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a, b, x, maggiori, minori, uguali;
  a = inputint("quanti numeri vuoi inserire", a);
  x = inputint("il numero da confrontare", x);
  do {
    b = inputint("un numero", b);
    if (b > x) {
      maggiori++;
    } else if (b < x) {
      minori++;
    } else {
      uguali++;
    }
    b--;
  } while (b != 0);
  printf("I maggiori sono %d, i minori sono %d e gli uguali sono %d\n",
         maggiori, minori, uguali);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <inputint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1040 <inputint@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1040 <inputint@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    117f <main+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a7 <main+0x87>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1199 <main+0x79>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a2 <main+0x82>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a7 <main+0x87>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1153 <main+0x33>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <inputint@plt>
lea    0xef8(%rip),%rdi
call   1030 <inputint@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"quanti numeri vuoi inserire\00"
@.str.1 = [25 x i8] c"il numero da confrontare\00"
@.str.2 = [10 x i8] c"un numero\00"
@.str.3 = [59 x i8] c"I maggiori sono %d, i minori sono %d e gli uguali sono %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @inputint(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %2
%10 = load i32, i32* %4
%11 = call i32 @inputint(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %10)
store i32 %11, i32* %4
br label %12
12: ; preds = %35, %0
%13 = load i32, i32* %3
%14 = call i32 @inputint(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %13)
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %32
21: ; preds = %12
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %31
28: ; preds = %21
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %31
31: ; preds = %28, %25
br label %32
32: ; preds = %31, %18
%33 = load i32, i32* %3
%34 = add nsw i32 %33, -1
store i32 %34, i32* %3
br label %35
35: ; preds = %32
%36 = load i32, i32* %3
%37 = icmp ne i32 %36, 0
br i1 %37, label %12, label %38
38: ; preds = %35
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0), i32 %39, i32 %40, i32 %41)
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
@.str = [28 x i8] c"quanti numeri vuoi inserire\00"
@.str.1 = [25 x i8] c"il numero da confrontare\00"
define i32 @main() {
%1 = tail call i32 @inputint(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @inputint(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 undef)
unreachable
}