#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 que quieres visualizar: ");
  scanf("%d", &mes);
  if (mes < 1 || mes > 12) {
    printf("Error el numero del mes introducido no es correcto.");
  } else
    switch (mes) {
      printf("El mes tiene ");
    case 2:
      printf("28");
      break;
    case 4:
    case 6:
    case 9:
    case 11:
      printf("30");
      break;
    default:
      printf("31");
      break;
    }
  printf(" días\n");
  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
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jl     1166 <main+0x46>
cmpl   $0xc,-0x14(%rbp)
jle    1177 <main+0x57>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    1202 <main+0xe2>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x2,%eax
je     11cf <main+0xaf>
jmp    118b <main+0x6b>
mov    -0x18(%rbp),%eax
sub    $0x4,%eax
je     11e0 <main+0xc0>
jmp    119c <main+0x7c>
mov    -0x18(%rbp),%eax
sub    $0x6,%eax
je     11e0 <main+0xc0>
jmp    11ad <main+0x8d>
mov    -0x18(%rbp),%eax
sub    $0x9,%eax
je     11e0 <main+0xc0>
jmp    11be <main+0x9e>
mov    -0x18(%rbp),%eax
sub    $0xb,%eax
je     11e0 <main+0xc0>
jmp    11f1 <main+0xd1>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
jmp    1202 <main+0xe2>
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xef1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0xd(%rax),%ecx
cmp    $0xfffffff4,%ecx
jae    1163 <main+0x33>
lea    0xed7(%rip),%rdi
jmp    1184 <main+0x54>
add    $0xfffffffe,%eax
cmp    $0x9,%eax
ja     117d <main+0x4d>
cltq
lea    0xf08(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1184 <main+0x54>
lea    0xeee(%rip),%rdi
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Introduce el numero del mes que quieres visualizar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [52 x i8] c"Error el numero del mes introducido no es correcto.\00"
@.str.3 = [3 x i8] c"28\00"
@.str.4 = [3 x i8] c"30\00"
@.str.5 = [3 x i8] c"31\00"
@.str.6 = [8 x i8] c" d\C3\ADas\0A\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 @printf(i8* getelementptr inbounds ([53 x i8], [53 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)
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* %6
%13 = icmp sgt i32 %12, 12
br i1 %13, label %14, label %16
14: ; preds = %11, %2
%15 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
br label %25
16: ; preds = %11
%17 = load i32, i32* %6
switch i32 %17, label %22 [
i32 2, label %18
i32 4, label %20
i32 6, label %20
i32 9, label %20
i32 11, label %20
]
18: ; preds = %16
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %24
20: ; preds = %16, %16, %16, %16
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %24
22: ; preds = %16
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %24
24: ; preds = %22, %20, %18
br label %25
25: ; preds = %24, %14
%26 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%27 = load i32, i32* @EXIT_SUCCESS
ret i32 %27
}

LLVM IR (-O2):
@.str = [53 x i8] c"Introduce el numero del mes que quieres visualizar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [52 x i8] c"Error el numero del mes introducido no es correcto.\00"
@.str.3 = [3 x i8] c"28\00"
@.str.4 = [3 x i8] c"30\00"
@.str.5 = [3 x i8] c"31\00"
@EXIT_SUCCESS = global i32 0
@str = [7 x i8] c" d\C3\ADas\00"
@reltable.main = [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.3 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([10 x i32]* @reltable.main to i64)) to i32)]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 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
%8 = add i32 %7, -13
%9 = icmp ult i32 %8, -12
br i1 %9, label %17, label %10
10: ; preds = %2
%11 = add i32 %7, -2
%12 = icmp ult i32 %11, 10
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = sext i32 %11 to i64
%15 = shl i64 %14, 2
%16 = call i8* @llvm.load.relative.i64(i8* bitcast ([10 x i32]* @reltable.main to i8*), i64 %15)
br label %17
17: ; preds = %10, %13, %2
%18 = phi i8* [ getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %16, %13 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %10 ]
%19 = call i32 @printf(i8* dereferenceable(1) %18)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}