#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 */
typedef enum month { ____Placeholder_month } month;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  enum month {
    january = 1,
    february,
    march,
    april,
    may,
    june,
    july,
    august,
    september,
    october,
    novermber,
    december
  };
  enum month aMonth;
  int days;
  printf("Enter month number: ");
  scanf("%i", &aMonth);
  switch (aMonth) {
  case january:
  case march:
  case may:
  case july:
  case august:
  case october:
  case december:
    days = 31;
    break;
  case april:
  case june:
  case september:
  case novermber:
    days = 30;
    break;
  case february:
    days = 28;
    break;
  default:
    printf("bad month numbe\n");
    days = 0;
    break;
  }
  if (days != 0)
    printf("Number of days is %i\n", days);
  if (aMonth == february)
    printf("...or 29 if it's a leap year\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     120e <main+0xee>
jmp    1161 <main+0x41>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1226 <main+0x106>
jmp    1172 <main+0x52>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     120e <main+0xee>
jmp    1183 <main+0x63>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     121a <main+0xfa>
jmp    1194 <main+0x74>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
je     120e <main+0xee>
jmp    11a5 <main+0x85>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
je     121a <main+0xfa>
jmp    11b6 <main+0x96>
mov    -0x10(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x2,%eax
jb     120e <main+0xee>
jmp    11ca <main+0xaa>
mov    -0x10(%rbp),%eax
sub    $0x9,%eax
je     121a <main+0xfa>
jmp    11db <main+0xbb>
mov    -0x10(%rbp),%eax
sub    $0xa,%eax
je     120e <main+0xee>
jmp    11ec <main+0xcc>
mov    -0x10(%rbp),%eax
sub    $0xb,%eax
je     121a <main+0xfa>
jmp    11fd <main+0xdd>
mov    -0x10(%rbp),%eax
sub    $0xc,%eax
jne    1232 <main+0x112>
jmp    120e <main+0xee>
movl   $0x1f,-0xc(%rbp)
jmp    1247 <main+0x127>
movl   $0x1e,-0xc(%rbp)
jmp    1247 <main+0x127>
movl   $0x1c,-0xc(%rbp)
jmp    1247 <main+0x127>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1262 <main+0x142>
mov    -0xc(%rbp),%esi
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    127a <main+0x15a>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xc,%eax
jae    117f <main+0x4f>
cltq
lea    0xef7(%rip),%rcx
mov    (%rcx,%rax,4),%esi
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x2,0x4(%rsp)
je     1192 <main+0x62>
jmp    119e <main+0x6e>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x2,0x4(%rsp)
jne    119e <main+0x6e>
lea    0xe95(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter month number: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [17 x i8] c"bad month numbe\0A\00"
@.str.3 = [22 x i8] c"Number of days is %i\0A\00"
@.str.4 = [30 x i8] c"...or 29 if it's a leap year\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %10 [
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 = %0, %0, %0, %0, %0, %0, %0
store i32 31, i32* %3
br label %12
8: ; preds = %0, %0, %0, %0
store i32 30, i32* %3
br label %12
9: ; preds = %0
store i32 28, i32* %3
br label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %12
12: ; preds = %10, %9, %8, %7
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 2
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter month number: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.3 = [22 x i8] c"Number of days is %i\0A\00"
@str = [29 x i8] c"...or 29 if it's a leap year\00"
@str.5 = [16 x i8] c"bad month numbe\00"
@switch.table.main = [12 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add i32 %5, -1
%7 = icmp ult i32 %6, 12
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
br label %15
10: ; preds = %0
%11 = sext i32 %6 to i64
%12 = getelementptr inbounds [12 x i32], [12 x i32]* @switch.table.main, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %8, %10
%16 = load i32, i32* %1
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
ret i32 0
}