#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*/ write(int, char *, int);
void getmonth(unsigned long month) {
  if (month == 1)
    write(1, "Jan", 3);
  else if (month == 2)
    write(1, "Feb", 3);
  else if (month == 3)
    write(1, "Mar", 3);
  else if (month == 4)
    write(1, "Apr", 3);
  else if (month == 5)
    write(1, "May", 3);
  else if (month == 6)
    write(1, "Jun", 3);
  else if (month == 7)
    write(1, "Jul", 3);
  else if (month == 8)
    write(1, "Aug", 3);
  else if (month == 9)
    write(1, "Sep", 3);
  else if (month == 10)
    write(1, "Oct", 3);
  else if (month == 11)
    write(1, "Nov", 3);
  else if (month == 12)
    write(1, "Dec", 3);
  write(1, " ", 1);
}


x86 assembly (clang, -O0):
<getmonth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jne    1142 <getmonth+0x32>
mov    $0x1,%edi
lea    0xecd(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    1316 <getmonth+0x206>
cmpq   $0x2,-0x8(%rbp)
jne    1168 <getmonth+0x58>
mov    $0x1,%edi
lea    0xeab(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    1311 <getmonth+0x201>
cmpq   $0x3,-0x8(%rbp)
jne    118e <getmonth+0x7e>
mov    $0x1,%edi
lea    0xe89(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    130c <getmonth+0x1fc>
cmpq   $0x4,-0x8(%rbp)
jne    11b4 <getmonth+0xa4>
mov    $0x1,%edi
lea    0xe67(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    1307 <getmonth+0x1f7>
cmpq   $0x5,-0x8(%rbp)
jne    11da <getmonth+0xca>
mov    $0x1,%edi
lea    0xe45(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    1302 <getmonth+0x1f2>
cmpq   $0x6,-0x8(%rbp)
jne    1200 <getmonth+0xf0>
mov    $0x1,%edi
lea    0xe23(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    12fd <getmonth+0x1ed>
cmpq   $0x7,-0x8(%rbp)
jne    1226 <getmonth+0x116>
mov    $0x1,%edi
lea    0xe01(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    12f8 <getmonth+0x1e8>
cmpq   $0x8,-0x8(%rbp)
jne    124c <getmonth+0x13c>
mov    $0x1,%edi
lea    0xddf(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    12f3 <getmonth+0x1e3>
cmpq   $0x9,-0x8(%rbp)
jne    1272 <getmonth+0x162>
mov    $0x1,%edi
lea    0xdbd(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    12ee <getmonth+0x1de>
cmpq   $0xa,-0x8(%rbp)
jne    1298 <getmonth+0x188>
mov    $0x1,%edi
lea    0xd9b(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    12e9 <getmonth+0x1d9>
cmpq   $0xb,-0x8(%rbp)
jne    12be <getmonth+0x1ae>
mov    $0x1,%edi
lea    0xd79(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    12e4 <getmonth+0x1d4>
cmpq   $0xc,-0x8(%rbp)
jne    12df <getmonth+0x1cf>
mov    $0x1,%edi
lea    0xd57(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
jmp    12e4 <getmonth+0x1d4>
jmp    12e9 <getmonth+0x1d9>
jmp    12ee <getmonth+0x1de>
jmp    12f3 <getmonth+0x1e3>
jmp    12f8 <getmonth+0x1e8>
jmp    12fd <getmonth+0x1ed>
jmp    1302 <getmonth+0x1f2>
jmp    1307 <getmonth+0x1f7>
jmp    130c <getmonth+0x1fc>
jmp    1311 <getmonth+0x201>
jmp    1316 <getmonth+0x206>
mov    $0x1,%edx
lea    0xd0e(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmonth>:
add    $0xffffffffffffffff,%rdi
cmp    $0xb,%rdi
ja     113c <getmonth+0x2c>
push   %rax
lea    0xf12(%rip),%rax
movslq (%rax,%rdi,4),%rsi
add    %rax,%rsi
mov    $0x1,%edi
mov    $0x3,%edx
call   1030 <write@plt>
add    $0x8,%rsp
lea    0xeed(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@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 = [2 x i8] c" \00"
define void @getmonth(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
br label %73
7: ; preds = %1
%8 = load i64, i64* %2
%9 = icmp eq i64 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
br label %72
12: ; preds = %7
%13 = load i64, i64* %2
%14 = icmp eq i64 %13, 3
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
br label %71
17: ; preds = %12
%18 = load i64, i64* %2
%19 = icmp eq i64 %18, 4
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
br label %70
22: ; preds = %17
%23 = load i64, i64* %2
%24 = icmp eq i64 %23, 5
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
br label %69
27: ; preds = %22
%28 = load i64, i64* %2
%29 = icmp eq i64 %28, 6
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
br label %68
32: ; preds = %27
%33 = load i64, i64* %2
%34 = icmp eq i64 %33, 7
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
br label %67
37: ; preds = %32
%38 = load i64, i64* %2
%39 = icmp eq i64 %38, 8
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
br label %66
42: ; preds = %37
%43 = load i64, i64* %2
%44 = icmp eq i64 %43, 9
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
br label %65
47: ; preds = %42
%48 = load i64, i64* %2
%49 = icmp eq i64 %48, 10
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
br label %64
52: ; preds = %47
%53 = load i64, i64* %2
%54 = icmp eq i64 %53, 11
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 3)
br label %63
57: ; preds = %52
%58 = load i64, i64* %2
%59 = icmp eq i64 %58, 12
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @write(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 3)
br label %62
62: ; preds = %60, %57
br label %63
63: ; preds = %62, %55
br label %64
64: ; preds = %63, %50
br label %65
65: ; preds = %64, %45
br label %66
66: ; preds = %65, %40
br label %67
67: ; preds = %66, %35
br label %68
68: ; preds = %67, %30
br label %69
69: ; preds = %68, %25
br label %70
70: ; preds = %69, %20
br label %71
71: ; preds = %70, %15
br label %72
72: ; preds = %71, %10
br label %73
73: ; preds = %72, %5
%74 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 1)
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 = [2 x i8] c" \00"
@reltable.getmonth = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.7 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.getmonth to i64)) to i32)]
define void @getmonth(i64 %0) {
%2 = add i64 %0, -1
%3 = icmp ult i64 %2, 12
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = shl i64 %2, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.getmonth to i8*), i64 %5)
%7 = tail call i32 @write(i32 1, i8* %6, i32 3)
br label %8
8: ; preds = %1, %4
%9 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i32 1)
ret void
}