#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 10:
    strcpy(texto, "fevereiro");
    break;
  case 24:
    strcpy(texto, "marco");
    break;
  case 39:
    strcpy(texto, "abril");
    break;
  case 412:
    strcpy(texto, "maio");
    break;
  case 529:
    strcpy(texto, "junho");
    break;
  case 678:
    strcpy(texto, "julho");
    break;
  case 1715:
    strcpy(texto, "agosto");
    break;
  case 8234:
    strcpy(texto, "setembro");
    break;
  case 9123:
    strcpy(texto, "outubro");
    break;
  case 10123:
    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    %eax,-0x14(%rbp)
test   %eax,%eax
je     1215 <mes+0xf5>
jmp    114c <mes+0x2c>
mov    -0x14(%rbp),%eax
sub    $0xa,%eax
je     122a <mes+0x10a>
jmp    115d <mes+0x3d>
mov    -0x14(%rbp),%eax
sub    $0xb,%eax
je     12fc <mes+0x1dc>
jmp    116e <mes+0x4e>
mov    -0x14(%rbp),%eax
sub    $0x18,%eax
je     123f <mes+0x11f>
jmp    117f <mes+0x5f>
mov    -0x14(%rbp),%eax
sub    $0x27,%eax
je     1254 <mes+0x134>
jmp    1190 <mes+0x70>
mov    -0x14(%rbp),%eax
sub    $0x19c,%eax
je     1269 <mes+0x149>
jmp    11a3 <mes+0x83>
mov    -0x14(%rbp),%eax
sub    $0x211,%eax
je     127e <mes+0x15e>
jmp    11b6 <mes+0x96>
mov    -0x14(%rbp),%eax
sub    $0x2a6,%eax
je     1293 <mes+0x173>
jmp    11c9 <mes+0xa9>
mov    -0x14(%rbp),%eax
sub    $0x6b3,%eax
je     12a8 <mes+0x188>
jmp    11dc <mes+0xbc>
mov    -0x14(%rbp),%eax
sub    $0x202a,%eax
je     12bd <mes+0x19d>
jmp    11ef <mes+0xcf>
mov    -0x14(%rbp),%eax
sub    $0x23a3,%eax
je     12d2 <mes+0x1b2>
jmp    1202 <mes+0xe2>
mov    -0x14(%rbp),%eax
sub    $0x278b,%eax
je     12e7 <mes+0x1c7>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xde0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xdd3(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xdb9(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xdaa(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xd9a(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xd8b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xd7c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xd6e(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xd62(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xd55(%rip),%rsi
call   1030 <strcpy@plt>
jmp    130c <mes+0x1ec>
mov    -0x10(%rbp),%rdi
lea    0xd49(%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    $0x210,%ebp
jg     1164 <mes+0x44>
cmp    $0x27,%ebp
ja     11b2 <mes+0x92>
lea    0xf5a(%rip),%rsi
mov    %ebp,%eax
lea    0xeb1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf49(%rip),%rsi
jmp    1200 <mes+0xe0>
cmp    $0x2029,%ebp
jg     1191 <mes+0x71>
cmp    $0x211,%ebp
je     11de <mes+0xbe>
cmp    $0x2a6,%ebp
je     11e7 <mes+0xc7>
cmp    $0x6b3,%ebp
jne    1208 <mes+0xe8>
lea    0xf40(%rip),%rsi
jmp    1200 <mes+0xe0>
cmp    $0x202a,%ebp
je     11f0 <mes+0xd0>
cmp    $0x23a3,%ebp
je     11f9 <mes+0xd9>
cmp    $0x278b,%ebp
jne    1208 <mes+0xe8>
lea    0xf37(%rip),%rsi
jmp    1200 <mes+0xe0>
cmp    $0x19c,%ebp
jne    1208 <mes+0xe8>
lea    0xefd(%rip),%rsi
jmp    1200 <mes+0xe0>
lea    0xf26(%rip),%rsi
jmp    1200 <mes+0xe0>
lea    0xedf(%rip),%rsi
jmp    1200 <mes+0xe0>
lea    0xedc(%rip),%rsi
jmp    1200 <mes+0xe0>
lea    0xede(%rip),%rsi
jmp    1200 <mes+0xe0>
lea    0xedb(%rip),%rsi
jmp    1200 <mes+0xe0>
lea    0xedf(%rip),%rsi
jmp    1200 <mes+0xe0>
lea    0xedf(%rip),%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 10, label %10
i32 24, label %13
i32 39, label %16
i32 412, label %19
i32 529, label %22
i32 678, label %25
i32 1715, label %28
i32 8234, label %31
i32 9123, label %34
i32 10123, 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"
define i8* @mes(i32 %0) {
%2 = tail call i64 @malloc(i32 10)
%3 = inttoptr i64 %2 to i8*
switch i32 %0, label %18 [
i32 0, label %15
i32 10, label %4
i32 24, label %5
i32 39, label %6
i32 412, label %7
i32 529, label %8
i32 678, label %9
i32 1715, label %10
i32 8234, label %11
i32 9123, label %12
i32 10123, label %13
i32 11, label %14
]
4: ; preds = %1
br label %15
5: ; preds = %1
br label %15
6: ; preds = %1
br label %15
7: ; preds = %1
br label %15
8: ; preds = %1
br label %15
9: ; preds = %1
br label %15
10: ; preds = %1
br label %15
11: ; preds = %1
br label %15
12: ; preds = %1
br label %15
13: ; preds = %1
br label %15
14: ; preds = %1
br label %15
15: ; preds = %1, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14
%16 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), %14 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), %13 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), %12 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), %11 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), %10 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %1 ]
%17 = tail call i32 @strcpy(i8* %3, i8* %16)
br label %18
18: ; preds = %15, %1
ret i8* %3
}