#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*/ Checkleapyear(int);
int Dayinmonth(int month, int year) {
  switch (month) {
  case 1:
  case 3:
  case 5:
  case 7:
  case 8:
  case 10:
  case 12:
    return 31;
    break;
  case 4:
  case 6:
  case 9:
  case 11:
    return 30;
    break;
  case 2:
    if (Checkleapyear(year))
      return 29;
    else
      return 28;
    break;
  default:
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Dayinmonth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     11df <Dayinmonth+0xcf>
jmp    1132 <Dayinmonth+0x22>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     11f7 <Dayinmonth+0xe7>
jmp    1143 <Dayinmonth+0x33>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     11df <Dayinmonth+0xcf>
jmp    1154 <Dayinmonth+0x44>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     11eb <Dayinmonth+0xdb>
jmp    1165 <Dayinmonth+0x55>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
je     11df <Dayinmonth+0xcf>
jmp    1176 <Dayinmonth+0x66>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
je     11eb <Dayinmonth+0xdb>
jmp    1187 <Dayinmonth+0x77>
mov    -0x10(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x2,%eax
jb     11df <Dayinmonth+0xcf>
jmp    119b <Dayinmonth+0x8b>
mov    -0x10(%rbp),%eax
sub    $0x9,%eax
je     11eb <Dayinmonth+0xdb>
jmp    11ac <Dayinmonth+0x9c>
mov    -0x10(%rbp),%eax
sub    $0xa,%eax
je     11df <Dayinmonth+0xcf>
jmp    11bd <Dayinmonth+0xad>
mov    -0x10(%rbp),%eax
sub    $0xb,%eax
je     11eb <Dayinmonth+0xdb>
jmp    11ce <Dayinmonth+0xbe>
mov    -0x10(%rbp),%eax
sub    $0xc,%eax
jne    1220 <Dayinmonth+0x110>
jmp    11df <Dayinmonth+0xcf>
movl   $0x1f,-0x4(%rbp)
jmp    1227 <Dayinmonth+0x117>
movl   $0x1e,-0x4(%rbp)
jmp    1227 <Dayinmonth+0x117>
mov    -0xc(%rbp),%edi
call   1030 <Checkleapyear@plt>
cmp    $0x0,%eax
je     1214 <Dayinmonth+0x104>
movl   $0x1d,-0x4(%rbp)
jmp    1227 <Dayinmonth+0x117>
movl   $0x1c,-0x4(%rbp)
jmp    1227 <Dayinmonth+0x117>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dayinmonth>:
cmp    $0xc,%edi
ja     1152 <Dayinmonth+0x42>
mov    $0x1f,%eax
mov    $0x15aa,%ecx
bt     %edi,%ecx
jae    1125 <Dayinmonth+0x15>
ret
mov    $0xa50,%eax
bt     %edi,%eax
jae    1135 <Dayinmonth+0x25>
mov    $0x1e,%eax
ret
cmp    $0x2,%edi
jne    1152 <Dayinmonth+0x42>
push   %rax
mov    %esi,%edi
call   1030 <Checkleapyear@plt>
cmp    $0x1,%eax
mov    $0x1d,%eax
sbb    $0x0,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

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