#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("Date (mm/dd/yy): ");
  scanf("%d / %d / %d", &month, &day, &year);
  if (year > 99) {
    year %= 100;
  }
  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
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
cmpl   $0x63,-0x10(%rbp)
jle    116d <main+0x4d>
mov    -0x10(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     11f8 <main+0xd8>
jmp    1192 <main+0x72>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     120b <main+0xeb>
jmp    11a3 <main+0x83>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     121e <main+0xfe>
jmp    11b4 <main+0x94>
mov    -0x14(%rbp),%eax
sub    $0x15,%eax
je     11f8 <main+0xd8>
jmp    11c5 <main+0xa5>
mov    -0x14(%rbp),%eax
sub    $0x16,%eax
je     120b <main+0xeb>
jmp    11d6 <main+0xb6>
mov    -0x14(%rbp),%eax
sub    $0x17,%eax
je     121e <main+0xfe>
jmp    11e7 <main+0xc7>
mov    -0x14(%rbp),%eax
sub    $0x1f,%eax
jne    1231 <main+0x111>
jmp    11f8 <main+0xd8>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123f <main+0x11f>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123f <main+0x11f>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123f <main+0x11f>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe20(%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     1355 <main+0x235>
mov    -0x20(%rbp),%rax
lea    0xd93(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xde7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xda6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xd8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1355 <main+0x235>
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xd66(%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    0xed9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x64,%eax
jl     116c <main+0x4c>
mov    %eax,%ecx
imul   $0x51eb851f,%rcx,%rcx
shr    $0x25,%rcx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0xc(%rsp)
mov    0x10(%rsp),%esi
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%eax
cmp    $0x1f,%eax
ja     11c0 <main+0xa0>
mov    $0x80200002,%ecx
bt     %eax,%ecx
jb     11ae <main+0x8e>
mov    $0x400004,%ecx
bt     %eax,%ecx
jb     11b7 <main+0x97>
mov    $0x800008,%ecx
bt     %eax,%ecx
jae    11c0 <main+0xa0>
lea    0xe84(%rip),%rdi
jmp    11c7 <main+0xa7>
lea    0xeb9(%rip),%rdi
jmp    11c7 <main+0xa7>
lea    0xe6f(%rip),%rdi
jmp    11c7 <main+0xa7>
lea    0xe6c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe61(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x14(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0xb,%eax
ja     11ff <main+0xdf>
cltq
lea    0xeaf(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Date (mm/dd/yy): \00"
@.str.1 = [13 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 ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 99
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %4
%11 = srem i32 %10, 100
store i32 %11, i32* %4
br label %12
12: ; preds = %9, %0
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %3
switch i32 %15, label %22 [
i32 1, label %16
i32 21, label %16
i32 31, label %16
i32 2, label %18
i32 22, label %18
i32 3, label %20
i32 23, label %20
]
16: ; preds = %12, %12, %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %24
18: ; preds = %12, %12
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %24
20: ; preds = %12, %12
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %24
22: ; preds = %12
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %24
24: ; preds = %22, %20, %18, %16
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%26 = load i32, i32* %2
switch i32 %26, label %51 [
i32 1, label %27
i32 2, label %29
i32 3, label %31
i32 4, label %33
i32 5, label %35
i32 6, label %37
i32 7, label %39
i32 8, label %41
i32 9, label %43
i32 10, label %45
i32 11, label %47
i32 12, label %49
]
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %51
29: ; preds = %24
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
br label %51
31: ; preds = %24
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %51
33: ; preds = %24
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
br label %51
35: ; preds = %24
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
br label %51
37: ; preds = %24
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
br label %51
39: ; preds = %24
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
br label %51
41: ; preds = %24
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
br label %51
43: ; preds = %24
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
br label %51
45: ; preds = %24
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %51
47: ; preds = %24
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
br label %51
49: ; preds = %24
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.19, i64 0, i64 0))
br label %51
51: ; preds = %24, %49, %47, %45, %43, %41, %39, %37, %35, %33, %31, %29, %27
%52 = load i32, i32* %4
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0), i32 %52)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Date (mm/dd/yy): \00"
@.str.1 = [13 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 ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 99
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = urem i32 %9, 100
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %0
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %2
switch i32 %16, label %19 [
i32 1, label %20
i32 21, label %20
i32 31, label %20
i32 2, label %17
i32 22, label %17
i32 3, label %18
i32 23, label %18
]
17: ; preds = %13, %13
br label %20
18: ; preds = %13, %13
br label %20
19: ; preds = %13
br label %20
20: ; preds = %13, %13, %13, %19, %18, %17
%21 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), %19 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), %18 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %17 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %13 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %13 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %13 ]
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%24 = load i32, i32* %1
%25 = add i32 %24, -1
%26 = icmp ult i32 %25, 12
br i1 %26, label %27, label %32
27: ; preds = %20
%28 = sext i32 %25 to i64
%29 = shl i64 %28, 2
%30 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.main to i8*), i64 %29)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %30)
br label %32
32: ; preds = %20, %27
%33 = load i32, i32* %3
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0), i32 %33)
ret i32 0
}