#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 Columbusday(int);
int Laborday(int);
int Memorialday(int);
int Thanksgivingday(int);
int ThirdMonday(int);
int /*<<< orphan*/ strcpy(char *, char *);
void Clock_Holiday(int month, int day, int monthStartDOW, char answer[100]) {
  switch (month) {
  case 1:
    if (day == 1) {
      strcpy(answer, "New Years Day");
      return;
    } else if (ThirdMonday(monthStartDOW) == day) {
      strcpy(answer, "Martin Luther King Jr Day");
      return;
    }
    break;
  case 2:
    if (ThirdMonday(monthStartDOW) == day) {
      strcpy(answer, "Presidents Day");
      return;
    }
    break;
  case 5:
    if (Memorialday(monthStartDOW) == day) {
      strcpy(answer, "Memorial Day");
      return;
    }
    break;
  case 7:
    if (day == 4) {
      strcpy(answer, "Independence Day");
      return;
    }
    break;
  case 9:
    if (Laborday(monthStartDOW) == day) {
      strcpy(answer, "Labor Day");
      return;
    }
    break;
  case 10:
    if (Columbusday(monthStartDOW) == day) {
      strcpy(answer, "Columbus Day");
      return;
    }
    break;
  case 11:
    if (day == 11) {
      strcpy(answer, "Veterans Day");
      return;
    } else if (Thanksgivingday(monthStartDOW) == day) {
      strcpy(answer, "Thanksgiving Day");
      return;
    }
    break;
  case 12:
    if (day == 25) {
      strcpy(answer, "Christmas Day");
      return;
    }
    break;
  }
  strcpy(answer, "");
  return;
}


x86 assembly (clang, -O0):
<Clock_Holiday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xb,%eax
ja     1330 <Clock_Holiday+0x1d0>
mov    -0x20(%rbp),%rax
lea    0xe6b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x1,-0x8(%rbp)
jne    11bd <Clock_Holiday+0x5d>
mov    -0x18(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
mov    -0xc(%rbp),%edi
call   1080 <ThirdMonday@plt>
cmp    -0x8(%rbp),%eax
jne    11e3 <Clock_Holiday+0x83>
mov    -0x18(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
jmp    11e8 <Clock_Holiday+0x88>
jmp    1330 <Clock_Holiday+0x1d0>
mov    -0xc(%rbp),%edi
call   1080 <ThirdMonday@plt>
cmp    -0x8(%rbp),%eax
jne    1213 <Clock_Holiday+0xb3>
mov    -0x18(%rbp),%rdi
lea    0xe4f(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
jmp    1330 <Clock_Holiday+0x1d0>
mov    -0xc(%rbp),%edi
call   1040 <Memorialday@plt>
cmp    -0x8(%rbp),%eax
jne    123e <Clock_Holiday+0xde>
mov    -0x18(%rbp),%rdi
lea    0xe33(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
jmp    1330 <Clock_Holiday+0x1d0>
cmpl   $0x4,-0x8(%rbp)
jne    1262 <Clock_Holiday+0x102>
mov    -0x18(%rbp),%rdi
lea    0xe1c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
jmp    1330 <Clock_Holiday+0x1d0>
mov    -0xc(%rbp),%edi
call   1060 <Laborday@plt>
cmp    -0x8(%rbp),%eax
jne    128d <Clock_Holiday+0x12d>
mov    -0x18(%rbp),%rdi
lea    0xe02(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
jmp    1330 <Clock_Holiday+0x1d0>
mov    -0xc(%rbp),%edi
call   1070 <Columbusday@plt>
cmp    -0x8(%rbp),%eax
jne    12b8 <Clock_Holiday+0x158>
mov    -0x18(%rbp),%rdi
lea    0xde1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
jmp    1330 <Clock_Holiday+0x1d0>
cmpl   $0xb,-0x8(%rbp)
jne    12dc <Clock_Holiday+0x17c>
mov    -0x18(%rbp),%rdi
lea    0xdca(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
mov    -0xc(%rbp),%edi
call   1050 <Thanksgivingday@plt>
cmp    -0x8(%rbp),%eax
jne    1302 <Clock_Holiday+0x1a2>
mov    -0x18(%rbp),%rdi
lea    0xdb1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
jmp    1307 <Clock_Holiday+0x1a7>
jmp    1330 <Clock_Holiday+0x1d0>
cmpl   $0x19,-0x8(%rbp)
jne    132b <Clock_Holiday+0x1cb>
mov    -0x18(%rbp),%rdi
lea    0xd99(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1340 <Clock_Holiday+0x1e0>
jmp    1330 <Clock_Holiday+0x1d0>
mov    -0x18(%rbp),%rdi
lea    0xd49(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clock_Holiday>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
add    $0xffffffff,%edi
cmp    $0xb,%edi
ja     1249 <Clock_Holiday+0xe9>
mov    %esi,%ebp
lea    0xe85(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
cmp    $0x1,%ebp
jne    1235 <Clock_Holiday+0xd5>
lea    0xe9c(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
mov    %edx,%edi
call   1080 <ThirdMonday@plt>
cmp    %ebp,%eax
jne    1249 <Clock_Holiday+0xe9>
lea    0xea9(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
mov    %edx,%edi
call   1040 <Memorialday@plt>
cmp    %ebp,%eax
jne    1249 <Clock_Holiday+0xe9>
lea    0xe9d(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
mov    %edx,%edi
call   1070 <Columbusday@plt>
cmp    %ebp,%eax
jne    1249 <Clock_Holiday+0xe9>
lea    0xeae(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
cmp    $0xb,%ebp
jne    1221 <Clock_Holiday+0xc1>
lea    0xead(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
cmp    $0x19,%ebp
jne    1249 <Clock_Holiday+0xe9>
lea    0xebd(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
cmp    $0x4,%ebp
jne    1249 <Clock_Holiday+0xe9>
lea    0xe69(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
mov    %edx,%edi
call   1060 <Laborday@plt>
cmp    %ebp,%eax
jne    1249 <Clock_Holiday+0xe9>
lea    0xe66(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
mov    %edx,%edi
call   1050 <Thanksgivingday@plt>
cmp    %ebp,%eax
jne    1249 <Clock_Holiday+0xe9>
lea    0xe76(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
mov    %edx,%edi
call   1080 <ThirdMonday@plt>
cmp    %ebp,%eax
jne    1249 <Clock_Holiday+0xe9>
lea    0xdf7(%rip),%rsi
jmp    1250 <Clock_Holiday+0xf0>
lea    0xe34(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"New Years Day\00"
@.str.1 = [26 x i8] c"Martin Luther King Jr Day\00"
@.str.2 = [15 x i8] c"Presidents Day\00"
@.str.3 = [13 x i8] c"Memorial Day\00"
@.str.4 = [17 x i8] c"Independence Day\00"
@.str.5 = [10 x i8] c"Labor Day\00"
@.str.6 = [13 x i8] c"Columbus Day\00"
@.str.7 = [13 x i8] c"Veterans Day\00"
@.str.8 = [17 x i8] c"Thanksgiving Day\00"
@.str.9 = [14 x i8] c"Christmas Day\00"
@.str.10 = [1 x i8] zeroinitializer
define void @Clock_Holiday(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
switch i32 %9, label %92 [
i32 1, label %10
i32 2, label %26
i32 5, label %35
i32 7, label %44
i32 9, label %51
i32 10, label %60
i32 11, label %69
i32 12, label %85
]
10: ; preds = %4
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %8
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %95
16: ; preds = %10
%17 = load i32, i32* %7
%18 = call i32 @ThirdMonday(i32 %17)
%19 = load i32, i32* %6
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load i8*, i8** %8
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %95
24: ; preds = %16
br label %25
25: ; preds = %24
br label %92
26: ; preds = %4
%27 = load i32, i32* %7
%28 = call i32 @ThirdMonday(i32 %27)
%29 = load i32, i32* %6
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %34
31: ; preds = %26
%32 = load i8*, i8** %8
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %95
34: ; preds = %26
br label %92
35: ; preds = %4
%36 = load i32, i32* %7
%37 = call i32 @Memorialday(i32 %36)
%38 = load i32, i32* %6
%39 = icmp eq i32 %37, %38
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = load i8*, i8** %8
%42 = call i32 @strcpy(i8* %41, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %95
43: ; preds = %35
br label %92
44: ; preds = %4
%45 = load i32, i32* %6
%46 = icmp eq i32 %45, 4
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = load i8*, i8** %8
%49 = call i32 @strcpy(i8* %48, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %95
50: ; preds = %44
br label %92
51: ; preds = %4
%52 = load i32, i32* %7
%53 = call i32 @Laborday(i32 %52)
%54 = load i32, i32* %6
%55 = icmp eq i32 %53, %54
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = load i8*, i8** %8
%58 = call i32 @strcpy(i8* %57, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %95
59: ; preds = %51
br label %92
60: ; preds = %4
%61 = load i32, i32* %7
%62 = call i32 @Columbusday(i32 %61)
%63 = load i32, i32* %6
%64 = icmp eq i32 %62, %63
br i1 %64, label %65, label %68
65: ; preds = %60
%66 = load i8*, i8** %8
%67 = call i32 @strcpy(i8* %66, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %95
68: ; preds = %60
br label %92
69: ; preds = %4
%70 = load i32, i32* %6
%71 = icmp eq i32 %70, 11
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = load i8*, i8** %8
%74 = call i32 @strcpy(i8* %73, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
br label %95
75: ; preds = %69
%76 = load i32, i32* %7
%77 = call i32 @Thanksgivingday(i32 %76)
%78 = load i32, i32* %6
%79 = icmp eq i32 %77, %78
br i1 %79, label %80, label %83
80: ; preds = %75
%81 = load i8*, i8** %8
%82 = call i32 @strcpy(i8* %81, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
br label %95
83: ; preds = %75
br label %84
84: ; preds = %83
br label %92
85: ; preds = %4
%86 = load i32, i32* %6
%87 = icmp eq i32 %86, 25
br i1 %87, label %88, label %91
88: ; preds = %85
%89 = load i8*, i8** %8
%90 = call i32 @strcpy(i8* %89, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0))
br label %95
91: ; preds = %85
br label %92
92: ; preds = %4, %91, %84, %68, %59, %50, %43, %34, %25
%93 = load i8*, i8** %8
%94 = call i32 @strcpy(i8* %93, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
br label %95
95: ; preds = %92, %88, %80, %72, %65, %56, %47, %40, %31, %21, %13
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"New Years Day\00"
@.str.1 = [26 x i8] c"Martin Luther King Jr Day\00"
@.str.2 = [15 x i8] c"Presidents Day\00"
@.str.3 = [13 x i8] c"Memorial Day\00"
@.str.4 = [17 x i8] c"Independence Day\00"
@.str.5 = [10 x i8] c"Labor Day\00"
@.str.6 = [13 x i8] c"Columbus Day\00"
@.str.7 = [13 x i8] c"Veterans Day\00"
@.str.8 = [17 x i8] c"Thanksgiving Day\00"
@.str.9 = [14 x i8] c"Christmas Day\00"
@.str.10 = [1 x i8] zeroinitializer
define void @Clock_Holiday(i32 %0, i32 %1, i32 %2, i8* %3) {
switch i32 %0, label %31 [
i32 1, label %5
i32 2, label %10
i32 5, label %13
i32 7, label %16
i32 9, label %18
i32 10, label %21
i32 11, label %24
i32 12, label %29
]
5: ; preds = %4
%6 = icmp eq i32 %1, 1
br i1 %6, label %32, label %7
7: ; preds = %5
%8 = tail call i32 @ThirdMonday(i32 %2)
%9 = icmp eq i32 %8, %1
br i1 %9, label %32, label %31
10: ; preds = %4
%11 = tail call i32 @ThirdMonday(i32 %2)
%12 = icmp eq i32 %11, %1
br i1 %12, label %32, label %31
13: ; preds = %4
%14 = tail call i32 @Memorialday(i32 %2)
%15 = icmp eq i32 %14, %1
br i1 %15, label %32, label %31
16: ; preds = %4
%17 = icmp eq i32 %1, 4
br i1 %17, label %32, label %31
18: ; preds = %4
%19 = tail call i32 @Laborday(i32 %2)
%20 = icmp eq i32 %19, %1
br i1 %20, label %32, label %31
21: ; preds = %4
%22 = tail call i32 @Columbusday(i32 %2)
%23 = icmp eq i32 %22, %1
br i1 %23, label %32, label %31
24: ; preds = %4
%25 = icmp eq i32 %1, 11
br i1 %25, label %32, label %26
26: ; preds = %24
%27 = tail call i32 @Thanksgivingday(i32 %2)
%28 = icmp eq i32 %27, %1
br i1 %28, label %32, label %31
29: ; preds = %4
%30 = icmp eq i32 %1, 25
br i1 %30, label %32, label %31
31: ; preds = %29, %26, %21, %18, %16, %13, %10, %7, %4
br label %32
32: ; preds = %29, %26, %24, %21, %18, %16, %13, %10, %7, %5, %31
%33 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0), %31 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %5 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), %7 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), %10 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), %13 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), %16 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), %18 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), %21 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), %24 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), %26 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), %29 ]
%34 = tail call i32 @strcpy(i8* %3, i8* %33)
ret void
}