#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 *, char *);
void stampaErrori(unsigned int numeroErrore) {
  if (numeroErrore == 1) {
    printf("%s", "\fAttenzione, input non valido\n");
  } else if (numeroErrore == 2) {
    printf("%s", "\fDato inserito non supportato\n");
  } else if (numeroErrore == 3) {
    printf("%s", "\fData Errata\n");
  } else {
    printf("%s", "\fNumero errore non valido");
  }
  return;
}


x86 assembly (clang, -O0):
<stampaErrori>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113d <stampaErrori+0x2d>
lea    0xed4(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <printf@plt>
jmp    119e <stampaErrori+0x8e>
cmpl   $0x2,-0x4(%rbp)
jne    115f <stampaErrori+0x4f>
lea    0xeb2(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1030 <printf@plt>
jmp    1199 <stampaErrori+0x89>
cmpl   $0x3,-0x4(%rbp)
jne    1181 <stampaErrori+0x71>
lea    0xe90(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <printf@plt>
jmp    1194 <stampaErrori+0x84>
lea    0xe78(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <printf@plt>
jmp    1199 <stampaErrori+0x89>
jmp    119e <stampaErrori+0x8e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stampaErrori>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     1135 <stampaErrori+0x25>
movslq %edi,%rax
lea    0xf4a(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
lea    0xed0(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xf13(%rip),%rsi
lea    0xebd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"\0CAttenzione, input non valido\0A\00"
@.str.2 = [31 x i8] c"\0CDato inserito non supportato\0A\00"
@.str.3 = [14 x i8] c"\0CData Errata\0A\00"
@.str.4 = [26 x i8] c"\0CNumero errore non valido\00"
define void @stampaErrori(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %21
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %20
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 3
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %19
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
br label %20
20: ; preds = %19, %10
br label %21
21: ; preds = %20, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"\0CAttenzione, input non valido\0A\00"
@.str.2 = [31 x i8] c"\0CDato inserito non supportato\0A\00"
@.str.3 = [14 x i8] c"\0CData Errata\0A\00"
@.str.4 = [26 x i8] c"\0CNumero errore non valido\00"
@reltable.stampaErrori = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.stampaErrori to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([31 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.stampaErrori to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.stampaErrori to i64)) to i32)]
define void @stampaErrori(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.stampaErrori to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), %1 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}