#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*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int main() {
  typedef enum { lu = 1, ma, me, gi, ve, sa, dom } giorni;
  giorni oggi;
  do {
    printf("\nInserisci il giorno ");
    scanf("%d", &oggi);
    switch (oggi) {
    case lu:
      printf("Lunedì");
      break;
    case ma:
      printf("Martedì");
      break;
    case me:
      printf("Mercoledì");
      break;
    case gi:
      printf("Giovedì");
      break;
    case ve:
      printf("Venerdì");
      break;
    case sa:
      printf("Sabato");
      break;
    case dom:
      printf("Domenica");
      break;
    }
  } while (1);
  __fpurge(stdin);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6,%eax
ja     1206 <main+0xc6>
mov    -0x10(%rbp),%rax
lea    0xe75(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
jmp    1206 <main+0xc6>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
jmp    1206 <main+0xc6>
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
jmp    1206 <main+0xc6>
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
jmp    1206 <main+0xc6>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
jmp    1206 <main+0xc6>
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
jmp    1206 <main+0xc6>
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
jmp    120b <main+0xcb>
mov    $0x1,%al
test   $0x1,%al
jne    114f <main+0xf>
jmp    121a <main+0xda>
mov    0x2dc7(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%r14
lea    0xee0(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xf16(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     1150 <main+0x30>
cltq
movslq (%rbx,%rax,4),%rdi
add    %rbx,%rdi
call   1030 <printf@plt>
jmp    1150 <main+0x30>

LLVM IR (-O0):
@.str = [22 x i8] c"\0AInserisci il giorno \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"Luned\C3\AC\00"
@.str.3 = [9 x i8] c"Marted\C3\AC\00"
@.str.4 = [11 x i8] c"Mercoled\C3\AC\00"
@.str.5 = [9 x i8] c"Gioved\C3\AC\00"
@.str.6 = [9 x i8] c"Venerd\C3\AC\00"
@.str.7 = [7 x i8] c"Sabato\00"
@.str.8 = [9 x i8] c"Domenica\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %22, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %21 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
i32 6, label %17
i32 7, label %19
]
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %21
9: ; preds = %3
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %21
11: ; preds = %3
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
br label %21
13: ; preds = %3
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %21
15: ; preds = %3
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %21
17: ; preds = %3
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %21
19: ; preds = %3
%20 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %21
21: ; preds = %3, %19, %17, %15, %13, %11, %9, %7
br label %22
22: ; preds = %21
br i1 true, label %3, label %23
23: ; preds = %22
%24 = load i32, i32* @stdin
%25 = call i32 @__fpurge(i32 %24)
%26 = call i32 (...) @getchar()
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0AInserisci il giorno \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"Luned\C3\AC\00"
@.str.3 = [9 x i8] c"Marted\C3\AC\00"
@.str.4 = [11 x i8] c"Mercoled\C3\AC\00"
@.str.5 = [9 x i8] c"Gioved\C3\AC\00"
@.str.6 = [9 x i8] c"Venerd\C3\AC\00"
@.str.7 = [7 x i8] c"Sabato\00"
@.str.8 = [9 x i8] c"Domenica\00"
@stdin = global i32 0
@reltable.main = [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.3 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.4 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.5 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.6 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.7 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.8 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %9, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add i32 %6, -1
%8 = icmp ult i32 %7, 7
br i1 %8, label %10, label %9
9: ; preds = %3, %10
br label %3
10: ; preds = %3
%11 = sext i32 %7 to i64
%12 = shl i64 %11, 2
%13 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.main to i8*), i64 %12)
%14 = call i32 @printf(i8* dereferenceable(1) %13)
br label %9
}