#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:
  case 1:
  case 2:
  case 3:
    strcpy(texto, "abril");
    break;
  case 4:
  case 5:
  case 6:
  case 7:
    strcpy(texto, "agosto");
    break;
  case 8:
  case 9:
  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     11ad <mes+0x8d>
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    11ad <mes+0x8d>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11ad <mes+0x8d>
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcpy@plt>
jmp    11ad <mes+0x8d>
mov    -0x10(%rbp),%rdi
lea    0xe9e(%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    0xedf(%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 = [6 x i8] c"abril\00"
@.str.1 = [7 x i8] c"agosto\00"
@.str.2 = [9 x i8] c"novembro\00"
@.str.3 = [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 %19 [
i32 0, label %7
i32 1, label %7
i32 2, label %7
i32 3, label %7
i32 4, label %10
i32 5, label %10
i32 6, label %10
i32 7, label %10
i32 8, label %13
i32 9, label %13
i32 10, label %13
i32 11, label %16
]
7: ; preds = %1, %1, %1, %1
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %19
10: ; preds = %1, %1, %1, %1
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %19
13: ; preds = %1, %1, %1
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %19
16: ; preds = %1
%17 = load i8*, i8** %3
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %1, %16, %13, %10, %7
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"abril\00"
@.str.1 = [7 x i8] c"agosto\00"
@.str.2 = [9 x i8] c"novembro\00"
@.str.3 = [9 x i8] c"dezembro\00"
@reltable.mes = [12 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.1 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.2 to i64), i64 ptrtoint ([12 x i32]* @reltable.mes to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.3 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
}