#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 /*<<< orphan*/ strcpy(char *, char *);
int main() {
  int m, d, a = 0;
  char cad[20] = "";
  printf("Ingrese el mes:\n");
  scanf("%d", &m);
  printf("Ingrese el anio\n");
  scanf("%d", &a);
  switch (m) {
  case 1:
    d = 31;
    strcpy(cad, "ENERO");
    break;
  case 2:
    if (a % 4 == 0 && (a % 100 != 0 || a % 400 == 0))
      d = 29;
    else
      d = 28;
    strcpy(cad, "FEBRERO");
    break;
  case 3:
    d = 31;
    strcpy(cad, "MARZO");
    break;
  case 4:
    d = 30;
    strcpy(cad, "ABRIL");
    break;
  case 5:
    d = 31;
    strcpy(cad, "MAYO");
    break;
  case 6:
    d = 30;
    strcpy(cad, "JUNIO");
    break;
  case 7:
    d = 31;
    strcpy(cad, "JUlIO");
    break;
  case 8:
    d = 31;
    strcpy(cad, "AGOSTO");
    break;
  case 9:
    d = 30;
    strcpy(cad, "SEPTIEMBRE");
    break;
  case 10:
    d = 31;
    strcpy(cad, "OCTUBRE");
    break;
  case 11:
    d = 30;
    strcpy(cad, "NOVIEMBRE");
    break;
  case 12:
    d = 31;
    strcpy(cad, "DICIEMBRE");
    break;
  }
  printf(".....................\n");
  printf("MES : %s\n", cad);
  printf("DIAS: %d\n", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movaps %xmm0,-0x30(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xed5(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x41(%rbp)
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
mov    %rdi,-0x40(%rbp)
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x41(%rbp),%al
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x40(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0xb,%eax
ja     1351 <main+0x221>
mov    -0x38(%rbp),%rax
lea    0xe4b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1f,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1222 <main+0xf2>
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1216 <main+0xe6>
mov    -0x10(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1222 <main+0xf2>
movl   $0x1d,-0xc(%rbp)
jmp    1229 <main+0xf9>
movl   $0x1c,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe27(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1f,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1e,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xdfd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1f,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xde7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1e,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xdd0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1f,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xdba(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1f,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xda4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1e,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xd8f(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1f,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1e,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1351 <main+0x221>
movl   $0x1f,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xd58(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movl   $0x0,0x8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
lea    0xf3c(%rip),%rdi
call   1040 <puts@plt>
lea    0xec0(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xf2c(%rip),%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xb,%eax
ja     121c <main+0xdc>
mov    $0x1f,%ebx
lea    0xe85(%rip),%rsi
lea    0xe4b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x8(%rsp),%eax
test   $0x3,%al
jne    120e <main+0xce>
imul   $0xc28f5c29,%eax,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x1d,%ebx
lea    0xe58(%rip),%rsi
cmp    $0x28f5c28,%ecx
ja     128a <main+0x14a>
movslq %eax,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%eax
je     128a <main+0x14a>
mov    $0x1c,%ebx
lea    0xe1f(%rip),%rsi
jmp    128a <main+0x14a>
jmp    1294 <main+0x154>
lea    0xe1c(%rip),%rsi
jmp    128a <main+0x14a>
mov    $0x1e,%ebx
lea    0xe14(%rip),%rsi
jmp    128a <main+0x14a>
lea    0xe11(%rip),%rsi
jmp    128a <main+0x14a>
mov    $0x1e,%ebx
lea    0xe08(%rip),%rsi
jmp    128a <main+0x14a>
lea    0xe05(%rip),%rsi
jmp    128a <main+0x14a>
lea    0xe02(%rip),%rsi
jmp    128a <main+0x14a>
mov    $0x1e,%ebx
lea    0xdfb(%rip),%rsi
jmp    128a <main+0x14a>
lea    0xdfd(%rip),%rsi
jmp    128a <main+0x14a>
mov    $0x1e,%ebx
lea    0xdf7(%rip),%rsi
jmp    128a <main+0x14a>
lea    0xdf8(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xe25(%rip),%rdi
call   1040 <puts@plt>
lea    0xde5(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xddc(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Ingrese el mes:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Ingrese el anio\0A\00"
@.str.3 = [6 x i8] c"ENERO\00"
@.str.4 = [8 x i8] c"FEBRERO\00"
@.str.5 = [6 x i8] c"MARZO\00"
@.str.6 = [6 x i8] c"ABRIL\00"
@.str.7 = [5 x i8] c"MAYO\00"
@.str.8 = [6 x i8] c"JUNIO\00"
@.str.9 = [6 x i8] c"JUlIO\00"
@.str.10 = [7 x i8] c"AGOSTO\00"
@.str.11 = [11 x i8] c"SEPTIEMBRE\00"
@.str.12 = [8 x i8] c"OCTUBRE\00"
@.str.13 = [10 x i8] c"NOVIEMBRE\00"
@.str.14 = [10 x i8] c"DICIEMBRE\00"
@.str.15 = [23 x i8] c".....................\0A\00"
@.str.16 = [10 x i8] c"MES : %s\0A\00"
@.str.17 = [10 x i8] c"DIAS: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
store i32 0, i32* %1
store i32 0, i32* %4
%6 = bitcast [20 x i8]* %5 to i8*
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 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* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %2
switch i32 %11, label %62 [
i32 1, label %12
i32 2, label %15
i32 3, label %32
i32 4, label %35
i32 5, label %38
i32 6, label %41
i32 7, label %44
i32 8, label %47
i32 9, label %50
i32 10, label %53
i32 11, label %56
i32 12, label %59
]
12: ; preds = %0
store i32 31, i32* %3
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %62
15: ; preds = %0
%16 = load i32, i32* %4
%17 = srem i32 %16, 4
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i32, i32* %4
%21 = srem i32 %20, 100
%22 = icmp ne i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i32, i32* %4
%25 = srem i32 %24, 400
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23, %19
store i32 29, i32* %3
br label %29
28: ; preds = %23, %15
store i32 28, i32* %3
br label %29
29: ; preds = %28, %27
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%31 = call i32 @strcpy(i8* %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %62
32: ; preds = %0
store i32 31, i32* %3
%33 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%34 = call i32 @strcpy(i8* %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %62
35: ; preds = %0
store i32 30, i32* %3
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%37 = call i32 @strcpy(i8* %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %62
38: ; preds = %0
store i32 31, i32* %3
%39 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%40 = call i32 @strcpy(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %62
41: ; preds = %0
store i32 30, i32* %3
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%43 = call i32 @strcpy(i8* %42, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %62
44: ; preds = %0
store i32 31, i32* %3
%45 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%46 = call i32 @strcpy(i8* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %62
47: ; preds = %0
store i32 31, i32* %3
%48 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%49 = call i32 @strcpy(i8* %48, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
br label %62
50: ; preds = %0
store i32 30, i32* %3
%51 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%52 = call i32 @strcpy(i8* %51, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
br label %62
53: ; preds = %0
store i32 31, i32* %3
%54 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%55 = call i32 @strcpy(i8* %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
br label %62
56: ; preds = %0
store i32 30, i32* %3
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%58 = call i32 @strcpy(i8* %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0))
br label %62
59: ; preds = %0
store i32 31, i32* %3
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%61 = call i32 @strcpy(i8* %60, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
br label %62
62: ; preds = %0, %59, %56, %53, %50, %47, %44, %41, %38, %35, %32, %29, %12
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0))
%64 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i8* %64)
%66 = load i32, i32* %3
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i32 %66)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [6 x i8] c"ENERO\00"
@.str.4 = [8 x i8] c"FEBRERO\00"
@.str.5 = [6 x i8] c"MARZO\00"
@.str.6 = [6 x i8] c"ABRIL\00"
@.str.7 = [5 x i8] c"MAYO\00"
@.str.8 = [6 x i8] c"JUNIO\00"
@.str.9 = [6 x i8] c"JUlIO\00"
@.str.10 = [7 x i8] c"AGOSTO\00"
@.str.11 = [11 x i8] c"SEPTIEMBRE\00"
@.str.12 = [8 x i8] c"OCTUBRE\00"
@.str.13 = [10 x i8] c"NOVIEMBRE\00"
@.str.14 = [10 x i8] c"DICIEMBRE\00"
@.str.16 = [10 x i8] c"MES : %s\0A\00"
@.str.17 = [10 x i8] c"DIAS: %d\0A\00"
@str = [16 x i8] c"Ingrese el mes:\00"
@str.18 = [16 x i8] c"Ingrese el anio\00"
@str.19 = [22 x i8] c".....................\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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* %1)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.18, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %1
switch i32 %11, label %37 [
i32 1, label %33
i32 2, label %12
i32 3, label %23
i32 4, label %24
i32 5, label %25
i32 6, label %26
i32 7, label %27
i32 8, label %28
i32 9, label %29
i32 10, label %30
i32 11, label %31
i32 12, label %32
]
12: ; preds = %0
%13 = load i32, i32* %2
%14 = and i32 %13, 3
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = srem i32 %13, 100
%18 = icmp ne i32 %17, 0
%19 = srem i32 %13, 400
%20 = icmp eq i32 %19, 0
%21 = or i1 %18, %20
br i1 %21, label %33, label %22
22: ; preds = %16, %12
br label %33
23: ; preds = %0
br label %33
24: ; preds = %0
br label %33
25: ; preds = %0
br label %33
26: ; preds = %0
br label %33
27: ; preds = %0
br label %33
28: ; preds = %0
br label %33
29: ; preds = %0
br label %33
30: ; preds = %0
br label %33
31: ; preds = %0
br label %33
32: ; preds = %0
br label %33
33: ; preds = %22, %16, %0, %23, %24, %25, %26, %27, %28, %29, %30, %31, %32
%34 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), %32 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), %31 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0), %30 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), %29 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), %28 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %27 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), %26 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %25 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %24 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %23 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %0 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %16 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), %22 ]
%35 = phi i32 [ 31, %32 ], [ 30, %31 ], [ 31, %30 ], [ 30, %29 ], [ 31, %28 ], [ 31, %27 ], [ 30, %26 ], [ 31, %25 ], [ 30, %24 ], [ 31, %23 ], [ 31, %0 ], [ 29, %16 ], [ 28, %22 ]
%36 = call i32 @strcpy(i8* %6, i8* %34)
br label %37
37: ; preds = %33, %0
%38 = phi i32 [ undef, %0 ], [ %35, %33 ]
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.19, i64 0, i64 0))
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i8* %6)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i32 %38)
ret i32 0
}