#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 dia;
  printf("¿Cuál día de la semana desea saber?: ");
  scanf("%d", &dia);
  if (dia <= 7) {
    switch (dia) {
    case 0:
      printf("\nÉste día no existe.");
      break;
    case 1:
      printf("\nEl primer día de la semana es lunes.");
      break;
    case 2:
      printf("\nEl segundo día de la semana es martes.");
      break;
    case 3:
      printf("\nEl tercer día de la semana es miércoles.");
      break;
    case 4:
      printf("\nEl cuarto día de la semana es jueves.");
      break;
    case 5:
      printf("\nEl quinto día de la semana es viernes.");
      break;
    case 6:
      printf("\nEl sexto día de la semana es sábado.");
      break;
    case 7:
      printf("\nEl septimo día de la semana es domingo.");
      break;
    }
  } else {
    printf("La semana sólo tiene 7 días.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x7,-0x8(%rbp)
jg     1202 <main+0xe2>
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x7,%rax
ja     11fd <main+0xdd>
mov    -0x10(%rbp),%rax
lea    0xe8f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
lea    0xeff(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
lea    0xf1a(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
lea    0xf49(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
lea    0xf60(%rip),%rdi
call   1030 <printf@plt>
jmp    120e <main+0xee>
lea    0xf79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
cmp    $0x7,%rax
jg     115e <main+0x3e>
cmp    $0x7,%eax
ja     116a <main+0x4a>
lea    0x102f(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1165 <main+0x45>
lea    0xffd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\C2\BFCu\C3\A1l d\C3\ADa de la semana desea saber?: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"\0A\C3\89ste d\C3\ADa no existe.\00"
@.str.3 = [39 x i8] c"\0AEl primer d\C3\ADa de la semana es lunes.\00"
@.str.4 = [41 x i8] c"\0AEl segundo d\C3\ADa de la semana es martes.\00"
@.str.5 = [44 x i8] c"\0AEl tercer d\C3\ADa de la semana es mi\C3\A9rcoles.\00"
@.str.6 = [40 x i8] c"\0AEl cuarto d\C3\ADa de la semana es jueves.\00"
@.str.7 = [41 x i8] c"\0AEl quinto d\C3\ADa de la semana es viernes.\00"
@.str.8 = [40 x i8] c"\0AEl sexto d\C3\ADa de la semana es s\C3\A1bado.\00"
@.str.9 = [42 x i8] c"\0AEl septimo d\C3\ADa de la semana es domingo.\00"
@.str.10 = [31 x i8] c"La semana s\C3\B3lo tiene 7 d\C3\ADas.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 7
br i1 %6, label %7, label %26
7: ; preds = %0
%8 = load i32, i32* %2
switch i32 %8, label %25 [
i32 0, label %9
i32 1, label %11
i32 2, label %13
i32 3, label %15
i32 4, label %17
i32 5, label %19
i32 6, label %21
i32 7, label %23
]
9: ; preds = %7
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %25
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
br label %25
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
br label %25
15: ; preds = %7
%16 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
br label %25
17: ; preds = %7
%18 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %25
19: ; preds = %7
%20 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
br label %25
21: ; preds = %7
%22 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
br label %25
23: ; preds = %7
%24 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0))
br label %25
25: ; preds = %7, %23, %21, %19, %17, %15, %13, %11, %9
br label %28
26: ; preds = %0
%27 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0))
br label %28
28: ; preds = %26, %25
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"\C2\BFCu\C3\A1l d\C3\ADa de la semana desea saber?: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"\0A\C3\89ste d\C3\ADa no existe.\00"
@.str.3 = [39 x i8] c"\0AEl primer d\C3\ADa de la semana es lunes.\00"
@.str.4 = [41 x i8] c"\0AEl segundo d\C3\ADa de la semana es martes.\00"
@.str.5 = [44 x i8] c"\0AEl tercer d\C3\ADa de la semana es mi\C3\A9rcoles.\00"
@.str.6 = [40 x i8] c"\0AEl cuarto d\C3\ADa de la semana es jueves.\00"
@.str.7 = [41 x i8] c"\0AEl quinto d\C3\ADa de la semana es viernes.\00"
@.str.8 = [40 x i8] c"\0AEl sexto d\C3\ADa de la semana es s\C3\A1bado.\00"
@.str.9 = [42 x i8] c"\0AEl septimo d\C3\ADa de la semana es domingo.\00"
@.str.10 = [31 x i8] c"La semana s\C3\B3lo tiene 7 d\C3\ADas.\00"
@reltable.main = [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([23 x i8]* @.str.2 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([39 x i8]* @.str.3 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.4 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([44 x i8]* @.str.5 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([40 x i8]* @.str.6 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([41 x i8]* @.str.7 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([40 x i8]* @.str.8 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @.str.9 to i64), i64 ptrtoint ([8 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 8
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = icmp ult i32 %5, 8
br i1 %8, label %9, label %16
9: ; preds = %7
%10 = sext i32 %5 to i64
%11 = shl i64 %10, 2
%12 = call i8* @llvm.load.relative.i64(i8* bitcast ([8 x i32]* @reltable.main to i8*), i64 %11)
br label %13
13: ; preds = %9, %0
%14 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), %0 ], [ %12, %9 ]
%15 = call i32 @printf(i8* dereferenceable(1) %14)
br label %16
16: ; preds = %7, %13
ret i32 0
}