#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);
  switch (i) {
  case 0:
    strcpy(texto, "janeiro");
    break;
  case 1:
    strcpy(texto, "fevereiro");
    break;
  case 2:
    strcpy(texto, "marco");
    break;
  case 3:
    strcpy(texto, "abril");
    break;
  case 4:
    strcpy(texto, "maio");
    break;
  case 5:
    strcpy(texto, "junho");
    break;
  case 6:
    strcpy(texto, "julho");
    break;
  case 7:
    strcpy(texto, "agosto");
    break;
  case 8:
    strcpy(texto, "setembro");
    break;
  case 9:
    strcpy(texto, "outubro");
    break;
  case 10:
    strcpy(texto, "novembro");
    break;
  case 11:
    strcpy(texto, "dezembro");
    break;
  }
  return texto;
}


x86 assembly (clang, -O0):
<mes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0xb,%rax
ja     1255 <mes+0x135>
mov    -0x18(%rbp),%rax
lea    0xeab(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xe63(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1255 <mes+0x135>
mov    -0x10(%rbp),%rdi
lea    0xe30(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%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
switch i32 %6, label %43 [
i32 0, label %7
i32 1, label %10
i32 2, label %13
i32 3, label %16
i32 4, label %19
i32 5, label %22
i32 6, label %25
i32 7, label %28
i32 8, label %31
i32 9, label %34
i32 10, label %37
i32 11, label %40
]
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %43
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %43
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %43
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %43
19: ; preds = %1
%20 = load i8*, i8** %3
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %43
22: ; preds = %1
%23 = load i8*, i8** %3
%24 = call i32 @strcpy(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %43
25: ; preds = %1
%26 = load i8*, i8** %3
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %43
28: ; preds = %1
%29 = load i8*, i8** %3
%30 = call i32 @strcpy(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %43
31: ; preds = %1
%32 = load i8*, i8** %3
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %43
34: ; preds = %1
%35 = load i8*, i8** %3
%36 = call i32 @strcpy(i8* %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %43
37: ; preds = %1
%38 = load i8*, i8** %3
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
br label %43
40: ; preds = %1
%41 = load i8*, i8** %3
%42 = call i32 @strcpy(i8* %41, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
br label %43
43: ; preds = %1, %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10, %7
%44 = load i8*, i8** %3
ret i8* %44
}

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
}