#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*/ esBisiesto(int);
int getDiasMes(int num, int anio) {
  int n;
  switch (num) {
  case 1:
    n = 31;
    break;
  case 2:
    if (esBisiesto(anio))
      n = 29;
    else {
      n = 28;
    }
    break;
  case 3:
    n = 31;
    break;
  case 4:
    n = 30;
    break;
  case 5:
    n = 31;
    break;
  case 6:
    n = 30;
    break;
  case 7:
    n = 31;
    break;
  case 8:
    n = 31;
    break;
  case 9:
    n = 30;
    break;
  case 10:
    n = 31;
    break;
  case 11:
    n = 30;
    break;
  case 12:
    n = 31;
    break;
  }
  return n;
}


x86 assembly (clang, -O0):
<getDiasMes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xb,%eax
ja     11ef <getDiasMes+0xdf>
mov    -0x18(%rbp),%rax
lea    0xec2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1f,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
mov    -0x8(%rbp),%edi
call   1030 <esBisiesto@plt>
cmp    $0x0,%eax
je     1170 <getDiasMes+0x60>
movl   $0x1d,-0xc(%rbp)
jmp    1177 <getDiasMes+0x67>
movl   $0x1c,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1f,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1e,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1f,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1e,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1f,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1f,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1e,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1f,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1e,-0xc(%rbp)
jmp    11ef <getDiasMes+0xdf>
movl   $0x1f,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDiasMes>:
push   %rax
mov    $0x1f,%eax
add    $0xfffffffe,%edi
cmp    $0x9,%edi
ja     1133 <getDiasMes+0x23>
lea    0xedb(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x1e,%eax
pop    %rcx
ret
mov    %esi,%edi
call   1030 <esBisiesto@plt>
cmp    $0x1,%eax
mov    $0x1d,%eax
sbb    $0x0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getDiasMes(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
switch i32 %6, label %25 [
i32 1, label %7
i32 2, label %8
i32 3, label %15
i32 4, label %16
i32 5, label %17
i32 6, label %18
i32 7, label %19
i32 8, label %20
i32 9, label %21
i32 10, label %22
i32 11, label %23
i32 12, label %24
]
7: ; preds = %2
store i32 31, i32* %5
br label %25
8: ; preds = %2
%9 = load i32, i32* %4
%10 = call i32 @esBisiesto(i32 %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 29, i32* %5
br label %14
13: ; preds = %8
store i32 28, i32* %5
br label %14
14: ; preds = %13, %12
br label %25
15: ; preds = %2
store i32 31, i32* %5
br label %25
16: ; preds = %2
store i32 30, i32* %5
br label %25
17: ; preds = %2
store i32 31, i32* %5
br label %25
18: ; preds = %2
store i32 30, i32* %5
br label %25
19: ; preds = %2
store i32 31, i32* %5
br label %25
20: ; preds = %2
store i32 31, i32* %5
br label %25
21: ; preds = %2
store i32 30, i32* %5
br label %25
22: ; preds = %2
store i32 31, i32* %5
br label %25
23: ; preds = %2
store i32 30, i32* %5
br label %25
24: ; preds = %2
store i32 31, i32* %5
br label %25
25: ; preds = %2, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %7
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @getDiasMes(i32 %0, i32 %1) {
switch i32 %0, label %11 [
i32 11, label %10
i32 2, label %3
i32 9, label %9
i32 4, label %7
i32 6, label %8
]
3: ; preds = %2
%4 = tail call i32 @esBisiesto(i32 %1)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 28, i32 29
br label %11
7: ; preds = %2
br label %11
8: ; preds = %2
br label %11
9: ; preds = %2
br label %11
10: ; preds = %2
br label %11
11: ; preds = %3, %2, %10, %9, %8, %7
%12 = phi i32 [ 30, %10 ], [ 30, %9 ], [ 30, %8 ], [ 30, %7 ], [ %6, %3 ], [ 31, %2 ]
ret i32 %12
}