#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*/ strcpy(char *, char *);
void DE_MONTH_NAME(int month, char *monthStr) {
  switch (month + 1) {
  case 1:
    strcpy(monthStr, "Jan");
    break;
  case 2:
    strcpy(monthStr, "Feb");
    break;
  case 3:
    strcpy(monthStr, "Mar");
    break;
  case 4:
    strcpy(monthStr, "Apr");
    break;
  case 5:
    strcpy(monthStr, "May");
    break;
  case 6:
    strcpy(monthStr, "Jun");
    break;
  case 7:
    strcpy(monthStr, "Jul");
    break;
  case 8:
    strcpy(monthStr, "Aug");
    break;
  case 9:
    strcpy(monthStr, "Sep");
    break;
  case 10:
    strcpy(monthStr, "Oct");
    break;
  case 11:
    strcpy(monthStr, "Nov");
    break;
  case 12:
    strcpy(monthStr, "Dec");
    break;
  default:
    strcpy(monthStr, "Err");
    break;
  }
}


x86 assembly (clang, -O0):
<DE_MONTH_NAME>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0xb,%rax
ja     1240 <DE_MONTH_NAME+0x130>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
lea    0xee1(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xed0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe48(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe37(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe26(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1250 <DE_MONTH_NAME+0x140>
mov    -0x10(%rbp),%rdi
lea    0xe15(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DE_MONTH_NAME>:
mov    %rsi,%rax
cmp    $0xb,%edi
ja     1131 <DE_MONTH_NAME+0x21>
movslq %edi,%rcx
lea    0xf12(%rip),%rdx
movslq (%rdx,%rcx,4),%rsi
add    %rdx,%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>
lea    0xef8(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"Jan\00"
@.str.1 = [4 x i8] c"Feb\00"
@.str.2 = [4 x i8] c"Mar\00"
@.str.3 = [4 x i8] c"Apr\00"
@.str.4 = [4 x i8] c"May\00"
@.str.5 = [4 x i8] c"Jun\00"
@.str.6 = [4 x i8] c"Jul\00"
@.str.7 = [4 x i8] c"Aug\00"
@.str.8 = [4 x i8] c"Sep\00"
@.str.9 = [4 x i8] c"Oct\00"
@.str.10 = [4 x i8] c"Nov\00"
@.str.11 = [4 x i8] c"Dec\00"
@.str.12 = [4 x i8] c"Err\00"
define void @DE_MONTH_NAME(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
switch i32 %6, label %43 [
i32 1, label %7
i32 2, label %10
i32 3, label %13
i32 4, label %16
i32 5, label %19
i32 6, label %22
i32 7, label %25
i32 8, label %28
i32 9, label %31
i32 10, label %34
i32 11, label %37
i32 12, label %40
]
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %46
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %46
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %46
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %46
19: ; preds = %2
%20 = load i8*, i8** %4
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %46
22: ; preds = %2
%23 = load i8*, i8** %4
%24 = call i32 @strcpy(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %46
25: ; preds = %2
%26 = load i8*, i8** %4
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
br label %46
28: ; preds = %2
%29 = load i8*, i8** %4
%30 = call i32 @strcpy(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %46
31: ; preds = %2
%32 = load i8*, i8** %4
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %46
34: ; preds = %2
%35 = load i8*, i8** %4
%36 = call i32 @strcpy(i8* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %46
37: ; preds = %2
%38 = load i8*, i8** %4
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %46
40: ; preds = %2
%41 = load i8*, i8** %4
%42 = call i32 @strcpy(i8* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %46
43: ; preds = %2
%44 = load i8*, i8** %4
%45 = call i32 @strcpy(i8* %44, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
br label %46
46: ; preds = %43, %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10, %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"Jan\00"
@.str.1 = [4 x i8] c"Feb\00"
@.str.2 = [4 x i8] c"Mar\00"
@.str.3 = [4 x i8] c"Apr\00"
@.str.4 = [4 x i8] c"May\00"
@.str.5 = [4 x i8] c"Jun\00"
@.str.6 = [4 x i8] c"Jul\00"
@.str.7 = [4 x i8] c"Aug\00"
@.str.8 = [4 x i8] c"Sep\00"
@.str.9 = [4 x i8] c"Oct\00"
@.str.10 = [4 x i8] c"Nov\00"
@.str.11 = [4 x i8] c"Dec\00"
@.str.12 = [4 x i8] c"Err\00"
@reltable.DE_MONTH_NAME = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.DE_MONTH_NAME to i64)) to i32)]
define void @DE_MONTH_NAME(i32 %0, i8* %1) {
%3 = icmp ult i32 %0, 12
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.DE_MONTH_NAME to i8*), i64 %6)
br label %8
8: ; preds = %2, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), %2 ]
%10 = tail call i32 @strcpy(i8* %1, i8* %9)
ret void
}