#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 *, int *);
int main(void) {
  int month, day, year;
  printf("Enter date (mm/dd/yy): ");
  scanf("%d /%d /%d", &month, &day, &year);
  printf("Dated this %d", day);
  switch (day) {
  case 1:
  case 21:
  case 31:
    printf("st");
    break;
  case 2:
  case 22:
    printf("nd");
    break;
  case 3:
  case 23:
    printf("rd");
    break;
  default:
    printf("th");
    break;
  }
  printf(" day of ");
  switch (month) {
  case 1:
    printf("January");
    break;
  case 2:
    printf("February");
    break;
  case 3:
    printf("March");
    break;
  case 4:
    printf("April");
    break;
  case 5:
    printf("May");
    break;
  case 6:
    printf("June");
    break;
  case 7:
    printf("July");
    break;
  case 8:
    printf("August");
    break;
  case 9:
    printf("September");
    break;
  case 10:
    printf("October");
    break;
  case 11:
    printf("November");
    break;
  case 12:
    printf("December");
    break;
  }
  printf(", 20%.2d.\n", year);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x15(%rbp)
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x15(%rbp),%al
mov    -0xc(%rbp),%esi
lea    0xeee(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     11e4 <main+0xc4>
jmp    117e <main+0x5e>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     11f7 <main+0xd7>
jmp    118f <main+0x6f>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     120a <main+0xea>
jmp    11a0 <main+0x80>
mov    -0x14(%rbp),%eax
sub    $0x15,%eax
je     11e4 <main+0xc4>
jmp    11b1 <main+0x91>
mov    -0x14(%rbp),%eax
sub    $0x16,%eax
je     11f7 <main+0xd7>
jmp    11c2 <main+0xa2>
mov    -0x14(%rbp),%eax
sub    $0x17,%eax
je     120a <main+0xea>
jmp    11d3 <main+0xb3>
mov    -0x14(%rbp),%eax
sub    $0x1f,%eax
jne    121d <main+0xfd>
jmp    11e4 <main+0xc4>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122b <main+0x10b>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122b <main+0x10b>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122b <main+0x10b>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe38(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xb,%eax
ja     1341 <main+0x221>
mov    -0x20(%rbp),%rax
lea    0xda7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1341 <main+0x221>
lea    0xd86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    $0x1f,%eax
ja     11a1 <main+0x81>
mov    $0x80200002,%ecx
bt     %eax,%ecx
jb     118f <main+0x6f>
mov    $0x400004,%ecx
bt     %eax,%ecx
jb     1198 <main+0x78>
mov    $0x800008,%ecx
bt     %eax,%ecx
jae    11a1 <main+0x81>
lea    0xea7(%rip),%rdi
jmp    11a8 <main+0x88>
lea    0xedc(%rip),%rdi
jmp    11a8 <main+0x88>
lea    0xe92(%rip),%rdi
jmp    11a8 <main+0x88>
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xb,%eax
ja     11e0 <main+0xc0>
cltq
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter date (mm/dd/yy): \00"
@.str.1 = [11 x i8] c"%d /%d /%d\00"
@.str.2 = [14 x i8] c"Dated this %d\00"
@.str.3 = [3 x i8] c"st\00"
@.str.4 = [3 x i8] c"nd\00"
@.str.5 = [3 x i8] c"rd\00"
@.str.6 = [3 x i8] c"th\00"
@.str.7 = [9 x i8] c" day of \00"
@.str.8 = [8 x i8] c"January\00"
@.str.9 = [9 x i8] c"February\00"
@.str.10 = [6 x i8] c"March\00"
@.str.11 = [6 x i8] c"April\00"
@.str.12 = [4 x i8] c"May\00"
@.str.13 = [5 x i8] c"June\00"
@.str.14 = [5 x i8] c"July\00"
@.str.15 = [7 x i8] c"August\00"
@.str.16 = [10 x i8] c"September\00"
@.str.17 = [8 x i8] c"October\00"
@.str.18 = [9 x i8] c"November\00"
@.str.19 = [9 x i8] c"December\00"
@.str.20 = [11 x i8] c", 20%.2d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
switch i32 %9, label %16 [
i32 1, label %10
i32 21, label %10
i32 31, label %10
i32 2, label %12
i32 22, label %12
i32 3, label %14
i32 23, label %14
]
10: ; preds = %0, %0, %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %18
12: ; preds = %0, %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %18
14: ; preds = %0, %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %18
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %18
18: ; preds = %16, %14, %12, %10
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%20 = load i32, i32* %2
switch i32 %20, label %45 [
i32 1, label %21
i32 2, label %23
i32 3, label %25
i32 4, label %27
i32 5, label %29
i32 6, label %31
i32 7, label %33
i32 8, label %35
i32 9, label %37
i32 10, label %39
i32 11, label %41
i32 12, label %43
]
21: ; preds = %18
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %45
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
br label %45
25: ; preds = %18
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %45
27: ; preds = %18
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
br label %45
29: ; preds = %18
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
br label %45
31: ; preds = %18
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
br label %45
33: ; preds = %18
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
br label %45
35: ; preds = %18
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
br label %45
37: ; preds = %18
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
br label %45
39: ; preds = %18
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %45
41: ; preds = %18
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
br label %45
43: ; preds = %18
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0))
br label %45
45: ; preds = %18, %43, %41, %39, %37, %35, %33, %31, %29, %27, %25, %23, %21
%46 = load i32, i32* %4
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0), i32 %46)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter date (mm/dd/yy): \00"
@.str.1 = [11 x i8] c"%d /%d /%d\00"
@.str.2 = [14 x i8] c"Dated this %d\00"
@.str.3 = [3 x i8] c"st\00"
@.str.4 = [3 x i8] c"nd\00"
@.str.5 = [3 x i8] c"rd\00"
@.str.6 = [3 x i8] c"th\00"
@.str.7 = [9 x i8] c" day of \00"
@.str.8 = [8 x i8] c"January\00"
@.str.9 = [9 x i8] c"February\00"
@.str.10 = [6 x i8] c"March\00"
@.str.11 = [6 x i8] c"April\00"
@.str.12 = [4 x i8] c"May\00"
@.str.13 = [5 x i8] c"June\00"
@.str.14 = [5 x i8] c"July\00"
@.str.15 = [7 x i8] c"August\00"
@.str.16 = [10 x i8] c"September\00"
@.str.17 = [8 x i8] c"October\00"
@.str.18 = [9 x i8] c"November\00"
@.str.19 = [9 x i8] c"December\00"
@.str.20 = [11 x i8] c", 20%.2d.\0A\00"
@reltable.main = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.12 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.13 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.14 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.15 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.16 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.17 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.18 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.19 to i64), i64 ptrtoint ([12 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
switch i32 %11, label %14 [
i32 1, label %15
i32 21, label %15
i32 31, label %15
i32 2, label %12
i32 22, label %12
i32 3, label %13
i32 23, label %13
]
12: ; preds = %0, %0
br label %15
13: ; preds = %0, %0
br label %15
14: ; preds = %0
br label %15
15: ; preds = %0, %0, %0, %14, %13, %12
%16 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %14 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %13 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %12 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %0 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %0 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %0 ]
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%19 = load i32, i32* %1
%20 = add i32 %19, -1
%21 = icmp ult i32 %20, 12
br i1 %21, label %22, label %27
22: ; preds = %15
%23 = sext i32 %20 to i64
%24 = shl i64 %23, 2
%25 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.main to i8*), i64 %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %25)
br label %27
27: ; preds = %15, %22
%28 = load i32, i32* %3
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0), i32 %28)
ret i32 0
}