#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
char *mes(int i) {
  char *texto = (char *)malloc(10);
  if (i == 0) {
    strcpy(texto, "janeiro");
  } else if (i == 1) {
    strcpy(texto, "fevereiro");
  } else if (i == 2) {
    strcpy(texto, "marco");
  } else if (i == 3) {
    strcpy(texto, "abril");
  } else if (i == 4) {
    strcpy(texto, "maio");
  } else if (i == 5) {
    strcpy(texto, "junho");
  } else if (i == 6) {
    strcpy(texto, "julho");
  } else if (i == 7) {
    strcpy(texto, "agosto");
  } else if (i == 8) {
    strcpy(texto, "setembro");
  } else if (i == 9) {
    strcpy(texto, "outubro");
  } else if (i == 10) {
    strcpy(texto, "novembro");
  } else if (i == 11) {
    strcpy(texto, "dezembro");
  }
  return texto;
}


x86 assembly (clang, -O0):
<mes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1158 <mes+0x38>
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12df <mes+0x1bf>
cmpl   $0x1,-0x4(%rbp)
jne    1177 <mes+0x57>
mov    -0x10(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12da <mes+0x1ba>
cmpl   $0x2,-0x4(%rbp)
jne    1196 <mes+0x76>
mov    -0x10(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12d5 <mes+0x1b5>
cmpl   $0x3,-0x4(%rbp)
jne    11b5 <mes+0x95>
mov    -0x10(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12d0 <mes+0x1b0>
cmpl   $0x4,-0x4(%rbp)
jne    11d4 <mes+0xb4>
mov    -0x10(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12cb <mes+0x1ab>
cmpl   $0x5,-0x4(%rbp)
jne    11f3 <mes+0xd3>
mov    -0x10(%rbp),%rdi
lea    0xe3a(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c6 <mes+0x1a6>
cmpl   $0x6,-0x4(%rbp)
jne    1212 <mes+0xf2>
mov    -0x10(%rbp),%rdi
lea    0xe21(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c1 <mes+0x1a1>
cmpl   $0x7,-0x4(%rbp)
jne    1231 <mes+0x111>
mov    -0x10(%rbp),%rdi
lea    0xe08(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12bc <mes+0x19c>
cmpl   $0x8,-0x4(%rbp)
jne    1250 <mes+0x130>
mov    -0x10(%rbp),%rdi
lea    0xdf0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b7 <mes+0x197>
cmpl   $0x9,-0x4(%rbp)
jne    126f <mes+0x14f>
mov    -0x10(%rbp),%rdi
lea    0xdda(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b2 <mes+0x192>
cmpl   $0xa,-0x4(%rbp)
jne    128e <mes+0x16e>
mov    -0x10(%rbp),%rdi
lea    0xdc3(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12ad <mes+0x18d>
cmpl   $0xb,-0x4(%rbp)
jne    12a8 <mes+0x188>
mov    -0x10(%rbp),%rdi
lea    0xdad(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12ad <mes+0x18d>
jmp    12b2 <mes+0x192>
jmp    12b7 <mes+0x197>
jmp    12bc <mes+0x19c>
jmp    12c1 <mes+0x1a1>
jmp    12c6 <mes+0x1a6>
jmp    12cb <mes+0x1ab>
jmp    12d0 <mes+0x1b0>
jmp    12d5 <mes+0x1b5>
jmp    12da <mes+0x1ba>
jmp    12df <mes+0x1bf>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mes>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
cmp    $0xb,%ebp
ja     1150 <mes+0x30>
movslq %ebp,%rax
lea    0xf1b(%rip),%rcx
movslq (%rcx,%rax,4),%rsi
add    %rcx,%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"janeiro\00"
@.str.1 = [10 x i8] c"fevereiro\00"
@.str.2 = [6 x i8] c"marco\00"
@.str.3 = [6 x i8] c"abril\00"
@.str.4 = [5 x i8] c"maio\00"
@.str.5 = [6 x i8] c"junho\00"
@.str.6 = [6 x i8] c"julho\00"
@.str.7 = [7 x i8] c"agosto\00"
@.str.8 = [9 x i8] c"setembro\00"
@.str.9 = [8 x i8] c"outubro\00"
@.str.10 = [9 x i8] c"novembro\00"
@.str.11 = [9 x i8] c"dezembro\00"
define i8* @mes(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 10)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %88
11: ; preds = %1
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %87
17: ; preds = %11
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i8*, i8** %3
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %86
23: ; preds = %17
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 3
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i8*, i8** %3
%28 = call i32 @strcpy(i8* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %85
29: ; preds = %23
%30 = load i32, i32* %2
%31 = icmp eq i32 %30, 4
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i8*, i8** %3
%34 = call i32 @strcpy(i8* %33, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %84
35: ; preds = %29
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 5
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i8*, i8** %3
%40 = call i32 @strcpy(i8* %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %83
41: ; preds = %35
%42 = load i32, i32* %2
%43 = icmp eq i32 %42, 6
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i8*, i8** %3
%46 = call i32 @strcpy(i8* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %82
47: ; preds = %41
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, 7
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load i8*, i8** %3
%52 = call i32 @strcpy(i8* %51, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %81
53: ; preds = %47
%54 = load i32, i32* %2
%55 = icmp eq i32 %54, 8
br i1 %55, label %56, label %59
56: ; preds = %53
%57 = load i8*, i8** %3
%58 = call i32 @strcpy(i8* %57, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %80
59: ; preds = %53
%60 = load i32, i32* %2
%61 = icmp eq i32 %60, 9
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = load i8*, i8** %3
%64 = call i32 @strcpy(i8* %63, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %79
65: ; preds = %59
%66 = load i32, i32* %2
%67 = icmp eq i32 %66, 10
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i8*, i8** %3
%70 = call i32 @strcpy(i8* %69, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
br label %78
71: ; preds = %65
%72 = load i32, i32* %2
%73 = icmp eq i32 %72, 11
br i1 %73, label %74, label %77
74: ; preds = %71
%75 = load i8*, i8** %3
%76 = call i32 @strcpy(i8* %75, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
br label %77
77: ; preds = %74, %71
br label %78
78: ; preds = %77, %68
br label %79
79: ; preds = %78, %62
br label %80
80: ; preds = %79, %56
br label %81
81: ; preds = %80, %50
br label %82
82: ; preds = %81, %44
br label %83
83: ; preds = %82, %38
br label %84
84: ; preds = %83, %32
br label %85
85: ; preds = %84, %26
br label %86
86: ; preds = %85, %20
br label %87
87: ; preds = %86, %14
br label %88
88: ; preds = %87, %8
%89 = load i8*, i8** %3
ret i8* %89
}

LLVM IR (-O2):
@.str = [8 x i8] c"janeiro\00"
@.str.1 = [10 x i8] c"fevereiro\00"
@.str.2 = [6 x i8] c"marco\00"
@.str.3 = [6 x i8] c"abril\00"
@.str.4 = [5 x i8] c"maio\00"
@.str.5 = [6 x i8] c"junho\00"
@.str.6 = [6 x i8] c"julho\00"
@.str.7 = [7 x i8] c"agosto\00"
@.str.8 = [9 x i8] c"setembro\00"
@.str.9 = [8 x i8] c"outubro\00"
@.str.10 = [9 x i8] c"novembro\00"
@.str.11 = [9 x i8] c"dezembro\00"
@reltable.mes = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.3 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.5 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.7 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.8 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.9 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.10 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.11 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32)]
define i8* @mes(i32 %0) {
%2 = tail call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
%4 = icmp ult i32 %0, 12
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = sext i32 %0 to i64
%7 = shl i64 %6, 2
%8 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.mes to i8*), i64 %7)
%9 = tail call i32 @strcpy(i8* %3, i8* %8)
br label %10
10: ; preds = %1, %5
ret i8* %3
}