#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int mes;
  printf("Introduce el numero del mes (1-12): ");
  scanf("%d", &mes);
  while (mes < 1 && mes > 12) {
    printf("Mes equivocat, ha de ser un numero (1-12)");
    scanf("%d", &mes);
  }
  switch (mes) {
  case 4:
  case 6:
  case 9:
  case 11:
    printf("\nEl mes %d tiene 30 dias", mes);
    break;
  case 2:
    printf("\nEl mes %d tiene 28 dias", mes);
    break;
  default:
    printf("\nEl mes %d tiene 31 dias", mes);
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x1,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jge    116d <main+0x4d>
cmpl   $0xc,-0x14(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    117d <main+0x5d>
jmp    11a0 <main+0x80>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
jmp    1154 <main+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x2,%eax
je     120e <main+0xee>
jmp    11b4 <main+0x94>
mov    -0x1c(%rbp),%eax
sub    $0x4,%eax
je     11f8 <main+0xd8>
jmp    11c5 <main+0xa5>
mov    -0x1c(%rbp),%eax
sub    $0x6,%eax
je     11f8 <main+0xd8>
jmp    11d6 <main+0xb6>
mov    -0x1c(%rbp),%eax
sub    $0x9,%eax
je     11f8 <main+0xd8>
jmp    11e7 <main+0xc7>
mov    -0x1c(%rbp),%eax
sub    $0xb,%eax
jne    1224 <main+0x104>
jmp    11f8 <main+0xd8>
mov    -0x14(%rbp),%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1235 <main+0x115>
mov    -0x14(%rbp),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1235 <main+0x115>
mov    -0x14(%rbp),%esi
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2da4(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0xb,%esi
ja     116f <main+0x4f>
mov    $0xa50,%eax
bt     %esi,%eax
jae    115c <main+0x3c>
lea    0xece(%rip),%rdi
jmp    1176 <main+0x56>
cmp    $0x2,%esi
jne    116f <main+0x4f>
lea    0xed9(%rip),%rdi
mov    $0x2,%esi
jmp    1176 <main+0x56>
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Introduce el numero del mes (1-12): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [42 x i8] c"Mes equivocat, ha de ser un numero (1-12)\00"
@.str.3 = [25 x i8] c"\0AEl mes %d tiene 30 dias\00"
@.str.4 = [25 x i8] c"\0AEl mes %d tiene 28 dias\00"
@.str.5 = [25 x i8] c"\0AEl mes %d tiene 31 dias\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %6
%14 = icmp sgt i32 %13, 12
br label %15
15: ; preds = %12, %9
%16 = phi i1 [ false, %9 ], [ %14, %12 ]
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
br label %9
20: ; preds = %15
%21 = load i32, i32* %6
switch i32 %21, label %28 [
i32 4, label %22
i32 6, label %22
i32 9, label %22
i32 11, label %22
i32 2, label %25
]
22: ; preds = %20, %20, %20, %20
%23 = load i32, i32* %6
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %23)
br label %31
25: ; preds = %20
%26 = load i32, i32* %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %26)
br label %31
28: ; preds = %20
%29 = load i32, i32* %6
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %25, %22
%32 = load i32, i32* @EXIT_SUCCESS
ret i32 %32
}

LLVM IR (-O2):
@.str = [37 x i8] c"Introduce el numero del mes (1-12): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [25 x i8] c"\0AEl mes %d tiene 30 dias\00"
@.str.4 = [25 x i8] c"\0AEl mes %d tiene 28 dias\00"
@.str.5 = [25 x i8] c"\0AEl mes %d tiene 31 dias\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
switch i32 %7, label %12 [
i32 4, label %8
i32 6, label %8
i32 9, label %8
i32 11, label %8
i32 2, label %10
]
8: ; preds = %2, %2, %2, %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %7)
br label %14
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 2)
br label %14
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %7)
br label %14
14: ; preds = %12, %10, %8
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}