#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 main() {
  char dia;
  int mes;
  int festa = 0;
  printf("\n\t\t--------------		\n\t\tQUAN ES FESTA?		"
         "\n\t\t--------------\n\n");
  printf("Dies de la semana[L:Dilluns, M:Dimarts, X:Dimecres, J:Dijous, "
         "V:Divendres, S:Dissabte, D:Diumenge]\nMesos del any del 1 al "
         "12\n\tDia a comprovar ==>");
  scanf("%c", &dia);
  printf("\tDel mes ==>");
  scanf("%d", &mes);
  if (dia == 'D' || dia == 'S' || mes == 8) {
    festa = 1;
  } else if (dia == 'V' && mes == 7) {
    festa = 1;
  } else {
    if (dia != 'L' && dia != 'M' && dia != 'X' && dia != 'J' && dia != 'D' ||
        mes < 0 && mes > 12) {
      printf("Data invalida.\n");
      return 0;
    }
  }
  if (festa) {
    printf("%sFesta.\n", "El dia introduit es ");
  } else {
    printf("%sno-festiu\n", "El dia introduit es ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf73(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf63(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x44,%eax
je     11a8 <main+0x88>
movsbl -0x5(%rbp),%eax
cmp    $0x53,%eax
je     11a8 <main+0x88>
cmpl   $0x8,-0xc(%rbp)
jne    11b4 <main+0x94>
movl   $0x1,-0x10(%rbp)
jmp    1250 <main+0x130>
movsbl -0x5(%rbp),%eax
cmp    $0x56,%eax
jne    11d7 <main+0xb7>
cmpl   $0x7,-0xc(%rbp)
jne    11d7 <main+0xb7>
movl   $0x1,-0x10(%rbp)
jmp    124b <main+0x12b>
movsbl -0x5(%rbp),%eax
cmp    $0x4c,%eax
je     1218 <main+0xf8>
movsbl -0x5(%rbp),%eax
cmp    $0x4d,%eax
je     1218 <main+0xf8>
movsbl -0x5(%rbp),%eax
cmp    $0x58,%eax
je     1218 <main+0xf8>
movsbl -0x5(%rbp),%eax
cmp    $0x4a,%eax
je     1218 <main+0xf8>
movsbl -0x5(%rbp),%eax
cmp    $0x44,%eax
jne    122c <main+0x10c>
cmpl   $0x0,-0xc(%rbp)
jge    1246 <main+0x126>
cmpl   $0xc,-0xc(%rbp)
jle    1246 <main+0x126>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1290 <main+0x170>
jmp    124b <main+0x12b>
jmp    1250 <main+0x130>
cmpl   $0x0,-0x10(%rbp)
je     1274 <main+0x154>
lea    0xe8e(%rip),%rdi
lea    0xe91(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1289 <main+0x169>
lea    0xe93(%rip),%rdi
lea    0xe77(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf99(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf40(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xf30(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf2f(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x4(%rsp),%ecx
cmp    $0x8,%ecx
je     119d <main+0x6d>
mov    0x3(%rsp),%al
cmp    $0x44,%al
je     119d <main+0x6d>
cmp    $0x53,%al
je     119d <main+0x6d>
cmp    $0x56,%al
jne    11b6 <main+0x86>
cmp    $0x7,%ecx
jne    11b6 <main+0x86>
lea    0xf01(%rip),%rdi
lea    0xf04(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
add    $0xb6,%al
cmp    $0xe,%al
ja     11d3 <main+0xa3>
movzbl %al,%eax
mov    $0x400d,%ecx
bt     %rax,%rcx
jae    11d3 <main+0xa3>
lea    0xef3(%rip),%rdi
jmp    11a4 <main+0x74>
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
jmp    11b2 <main+0x82>

LLVM IR (-O0):
@.str = [58 x i8] c"\0A\09\09--------------\09\09\0A\09\09QUAN ES FESTA?\09\09\0A\09\09--------------\0A\0A\00"
@.str.1 = [146 x i8] c"Dies de la semana[L:Dilluns, M:Dimarts, X:Dimecres, J:Dijous, V:Divendres, S:Dissabte, D:Diumenge]\0AMesos del any del 1 al 12\0A\09Dia a comprovar ==>\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [13 x i8] c"\09Del mes ==>\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [16 x i8] c"Data invalida.\0A\00"
@.str.6 = [10 x i8] c"%sFesta.\0A\00"
@.str.7 = [21 x i8] c"El dia introduit es \00"
@.str.8 = [13 x i8] c"%sno-festiu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 68
br i1 %12, label %20, label %13
13: ; preds = %0
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 83
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 8
br i1 %19, label %20, label %21
20: ; preds = %17, %13, %0
store i32 1, i32* %4
br label %59
21: ; preds = %17
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 86
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 7
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 1, i32* %4
br label %58
29: ; preds = %25, %21
%30 = load i8, i8* %2
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 76
br i1 %32, label %33, label %49
33: ; preds = %29
%34 = load i8, i8* %2
%35 = sext i8 %34 to i32
%36 = icmp ne i32 %35, 77
br i1 %36, label %37, label %49
37: ; preds = %33
%38 = load i8, i8* %2
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 88
br i1 %40, label %41, label %49
41: ; preds = %37
%42 = load i8, i8* %2
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 74
br i1 %44, label %45, label %49
45: ; preds = %41
%46 = load i8, i8* %2
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 68
br i1 %48, label %55, label %49
49: ; preds = %45, %41, %37, %33, %29
%50 = load i32, i32* %3
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %57
52: ; preds = %49
%53 = load i32, i32* %3
%54 = icmp sgt i32 %53, 12
br i1 %54, label %55, label %57
55: ; preds = %52, %45
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %1
br label %67
57: ; preds = %52, %49
br label %58
58: ; preds = %57, %28
br label %59
59: ; preds = %58, %20
%60 = load i32, i32* %4
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %59
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %66
64: ; preds = %59
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %66
66: ; preds = %64, %62
store i32 0, i32* %1
br label %67
67: ; preds = %66, %55
%68 = load i32, i32* %1
ret i32 %68
}

LLVM IR (-O2):
@.str.1 = [146 x i8] c"Dies de la semana[L:Dilluns, M:Dimarts, X:Dimecres, J:Dijous, V:Divendres, S:Dissabte, D:Diumenge]\0AMesos del any del 1 al 12\0A\09Dia a comprovar ==>\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [13 x i8] c"\09Del mes ==>\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.6 = [10 x i8] c"%sFesta.\0A\00"
@.str.7 = [21 x i8] c"El dia introduit es \00"
@.str.8 = [13 x i8] c"%sno-festiu\0A\00"
@str = [57 x i8] c"\0A\09\09--------------\09\09\0A\09\09QUAN ES FESTA?\09\09\0A\09\09--------------\0A\00"
@str.9 = [15 x i8] c"Data invalida.\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%9 = load i8, i8* %1
%10 = load i32, i32* %2
%11 = freeze i32 %10
%12 = icmp eq i32 %11, 8
br i1 %12, label %21, label %13
13: ; preds = %0
switch i8 %9, label %14 [
i8 83, label %21
i8 68, label %21
]
14: ; preds = %13
%15 = icmp eq i8 %9, 86
%16 = icmp eq i32 %11, 7
%17 = and i1 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %14
switch i8 %9, label %19 [
i8 88, label %23
i8 77, label %23
i8 76, label %23
i8 74, label %23
]
19: ; preds = %18
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.9, i64 0, i64 0))
br label %25
21: ; preds = %14, %0, %13, %13
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %25
23: ; preds = %18, %18, %18, %18
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %25
25: ; preds = %21, %23, %19
ret i32 0
}