#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 day;
  int month;
  int year;
  const char *months[13];
  months[0] = "Invalid";
  months[1] = "January";
  months[2] = "February";
  months[3] = "March";
  months[4] = "April";
  months[5] = "May";
  months[6] = "June";
  months[7] = "July";
  months[8] = "August";
  months[9] = "September";
  months[10] = "October";
  months[11] = "November";
  months[12] = "December";
  printf("Enter a date (mm/dd/yyyy): ");
  scanf("%d/%d/%d", &month, &day, &year);
  printf("You entered: %s %d, %d\n", months[month], day, year);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    0xec4(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    0xec1(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xebf(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xeb5(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xeae(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xea2(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe9e(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe98(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movslq -0xc(%rbp),%rax
mov    -0x80(%rbp,%rax,8),%rsi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
lea    0xed5(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xed1(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xecd(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xeca(%rip),%rax
mov    %rax,0x28(%rsp)
lea    0xec4(%rip),%rax
mov    %rax,0x30(%rsp)
lea    0xebe(%rip),%rax
mov    %rax,0x38(%rsp)
lea    0xeb6(%rip),%rax
mov    %rax,0x40(%rsp)
lea    0xeaf(%rip),%rax
mov    %rax,0x48(%rsp)
lea    0xea8(%rip),%rax
mov    %rax,0x50(%rsp)
lea    0xea3(%rip),%rax
mov    %rax,0x58(%rsp)
lea    0xea1(%rip),%rax
mov    %rax,0x60(%rsp)
lea    0xe9d(%rip),%rax
mov    %rax,0x68(%rsp)
lea    0xe9a(%rip),%rax
mov    %rax,0x70(%rsp)
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1040 <scanf@plt>
movslq 0x8(%rsp),%rax
mov    0x10(%rsp,%rax,8),%rsi
mov    0xc(%rsp),%edx
mov    0x4(%rsp),%ecx
lea    0xe81(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Invalid\00"
@.str.1 = [8 x i8] c"January\00"
@.str.2 = [9 x i8] c"February\00"
@.str.3 = [6 x i8] c"March\00"
@.str.4 = [6 x i8] c"April\00"
@.str.5 = [4 x i8] c"May\00"
@.str.6 = [5 x i8] c"June\00"
@.str.7 = [5 x i8] c"July\00"
@.str.8 = [7 x i8] c"August\00"
@.str.9 = [10 x i8] c"September\00"
@.str.10 = [8 x i8] c"October\00"
@.str.11 = [9 x i8] c"November\00"
@.str.12 = [9 x i8] c"December\00"
@.str.13 = [28 x i8] c"Enter a date (mm/dd/yyyy): \00"
@.str.14 = [9 x i8] c"%d/%d/%d\00"
@.str.15 = [24 x i8] c"You entered: %s %d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [13 x i8*]
store i32 0, i32* %1
%6 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 5
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 8
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 9
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 10
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 11
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8** %17
%18 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 12
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8** %18
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32* %3, i32* %2, i32* %4)
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [13 x i8*], [13 x i8*]* %5, i64 0, i64 %22
%24 = load i8*, i8** %23
%25 = load i32, i32* %2
%26 = load i32, i32* %4
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %24, i32 %25, i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Invalid\00"
@.str.1 = [8 x i8] c"January\00"
@.str.2 = [9 x i8] c"February\00"
@.str.3 = [6 x i8] c"March\00"
@.str.4 = [6 x i8] c"April\00"
@.str.5 = [4 x i8] c"May\00"
@.str.6 = [5 x i8] c"June\00"
@.str.7 = [5 x i8] c"July\00"
@.str.8 = [7 x i8] c"August\00"
@.str.9 = [10 x i8] c"September\00"
@.str.10 = [8 x i8] c"October\00"
@.str.11 = [9 x i8] c"November\00"
@.str.12 = [9 x i8] c"December\00"
@.str.13 = [28 x i8] c"Enter a date (mm/dd/yyyy): \00"
@.str.14 = [9 x i8] c"%d/%d/%d\00"
@.str.15 = [24 x i8] c"You entered: %s %d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [13 x i8*]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast [13 x i8*]* %4 to i8*
%9 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 4
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 5
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %16
%17 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 8
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %17
%18 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 9
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8** %18
%19 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 10
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8** %19
%20 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 11
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8** %20
%21 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 12
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8** %21
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32* %2, i32* %1, i32* %3)
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [13 x i8*], [13 x i8*]* %4, i64 0, i64 %25
%27 = load i8*, i8** %26
%28 = load i32, i32* %1
%29 = load i32, i32* %3
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %27, i32 %28, i32 %29)
ret i32 0
}