char *mes(int i) {
  char *meses[12] = {"janeiro",  "fevereiro", "marco",    "abril",
                     "maio",     "junho",     "julho",    "agosto",
                     "setembro", "outubro",   "novembro", "dezembro"};
  return meses[i];
}


x86 assembly (clang, -O0):
<mes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0x2c9a(%rip),%rsi
mov    $0x60,%edx
call   1030 <memcpy@plt>
movslq -0x4(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mes>:
movslq %edi,%rax
lea    0xf52(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
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"
@__const.mes.meses = [12 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i32 0, i32 0)]
define i8* @mes(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8*]
store i32 %0, i32* %2
%4 = bitcast [12 x i8*]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [12 x i8*], [12 x i8*]* %3, i64 0, i64 %6
%8 = load i8*, i8** %7
ret i8* %8
}

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 = sext i32 %0 to i64
%3 = shl i64 %2, 2
%4 = call i8* @llvm.load.relative.i64(i8* bitcast ([12 x i32]* @reltable.mes to i8*), i64 %3)
ret i8* %4
}