#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 t;
  printf("Rilevatore di temperatura\n");
  printf("Inserisci la temperatura: ");
  scanf("%d", &t);
  if (t >= 30) {
    printf("Fa molto caldo");
  } else if (t >= 20 && t < 30) {
    printf("Fa caldo");
  } else if (t >= 10 && t < 20) {
    printf("Temperatura ideale");
  } else if (t < 10) {
    printf("Fa freddo");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1e,-0x8(%rbp)
jl     1172 <main+0x52>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    11e1 <main+0xc1>
cmpl   $0x14,-0x8(%rbp)
jl     1197 <main+0x77>
cmpl   $0x1e,-0x8(%rbp)
jge    1197 <main+0x77>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
cmpl   $0xa,-0x8(%rbp)
jl     11bc <main+0x9c>
cmpl   $0x14,-0x8(%rbp)
jge    11bc <main+0x9c>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    11d7 <main+0xb7>
cmpl   $0xa,-0x8(%rbp)
jge    11d2 <main+0xb2>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    11d7 <main+0xb7>
jmp    11dc <main+0xbc>
jmp    11e1 <main+0xc1>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1d,%eax
jle    116c <main+0x3c>
lea    0xeb4(%rip),%rdi
jmp    118f <main+0x5f>
cmp    $0x13,%eax
jle    117a <main+0x4a>
lea    0xeb5(%rip),%rdi
jmp    118f <main+0x5f>
cmp    $0xa,%eax
lea    0xeb2(%rip),%rax
lea    0xebe(%rip),%rdi
cmovge %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Rilevatore di temperatura\0A\00"
@.str.1 = [27 x i8] c"Inserisci la temperatura: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [15 x i8] c"Fa molto caldo\00"
@.str.4 = [9 x i8] c"Fa caldo\00"
@.str.5 = [19 x i8] c"Temperatura ideale\00"
@.str.6 = [10 x i8] c"Fa freddo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 30
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %34
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 20
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 30
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %33
18: ; preds = %13, %10
%19 = load i32, i32* %2
%20 = icmp sge i32 %19, 10
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 20
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
br label %32
26: ; preds = %21, %18
%27 = load i32, i32* %2
%28 = icmp slt i32 %27, 10
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %31
31: ; preds = %29, %26
br label %32
32: ; preds = %31, %24
br label %33
33: ; preds = %32, %16
br label %34
34: ; preds = %33, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Inserisci la temperatura: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [15 x i8] c"Fa molto caldo\00"
@.str.4 = [9 x i8] c"Fa caldo\00"
@.str.5 = [19 x i8] c"Temperatura ideale\00"
@.str.6 = [10 x i8] c"Fa freddo\00"
@str = [26 x i8] c"Rilevatore di temperatura\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 29
br i1 %7, label %13, label %8
8: ; preds = %0
%9 = icmp sgt i32 %6, 19
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = icmp sgt i32 %6, 9
%12 = select i1 %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0)
br label %13
13: ; preds = %10, %8, %0
%14 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), %0 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), %8 ], [ %12, %10 ]
%15 = call i32 @printf(i8* dereferenceable(1) %14)
ret i32 0
}