#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 */
int /*<<< orphan*/ strncat(char *, char *, int);
int agrega_periodo(const unsigned int numero, char *buffer) {
  int len = 0;
  if (numero == 1) {
    len = 6;
    strncat(buffer, "millon", len);
  } else if (numero == 2) {
    len = 6;
    strncat(buffer, "billon", len);
  } else if (numero == 3) {
    len = 7;
    strncat(buffer, "trillon", len);
  } else if (numero == 4) {
    len = 10;
    strncat(buffer, "cuatrillon", len);
  } else if (numero == 5) {
    len = 10;
    strncat(buffer, "quintillon", len);
  } else if (numero == 6) {
    len = 9;
    strncat(buffer, "sextillon", len);
  } else if (numero == 7) {
    len = 9;
    strncat(buffer, "septillon", len);
  } else if (numero == 8) {
    len = 8;
    strncat(buffer, "octillon", len);
  } else if (numero == 9) {
    len = 8;
    strncat(buffer, "nonillon", len);
  } else if (numero == 10) {
    len = 8;
    strncat(buffer, "decillon", len);
  } else if (numero == 11) {
    len = 10;
    strncat(buffer, "undecillon", len);
  } else if (numero == 12) {
    len = 11;
    strncat(buffer, "duodecillon", len);
  }
  return len;
}


x86 assembly (clang, -O0):
<agrega_periodo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    114f <agrega_periodo+0x3f>
movl   $0x6,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xebb(%rip),%rsi
call   1030 <strncat@plt>
jmp    1344 <agrega_periodo+0x234>
cmpl   $0x2,-0x4(%rbp)
jne    1178 <agrega_periodo+0x68>
movl   $0x6,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe99(%rip),%rsi
call   1030 <strncat@plt>
jmp    133f <agrega_periodo+0x22f>
cmpl   $0x3,-0x4(%rbp)
jne    11a1 <agrega_periodo+0x91>
movl   $0x7,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe7a(%rip),%rsi
call   1030 <strncat@plt>
jmp    133a <agrega_periodo+0x22a>
cmpl   $0x4,-0x4(%rbp)
jne    11ca <agrega_periodo+0xba>
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe4e(%rip),%rsi
call   1030 <strncat@plt>
jmp    1335 <agrega_periodo+0x225>
cmpl   $0x5,-0x4(%rbp)
jne    11f3 <agrega_periodo+0xe3>
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe30(%rip),%rsi
call   1030 <strncat@plt>
jmp    1330 <agrega_periodo+0x220>
cmpl   $0x6,-0x4(%rbp)
jne    121c <agrega_periodo+0x10c>
movl   $0x9,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe12(%rip),%rsi
call   1030 <strncat@plt>
jmp    132b <agrega_periodo+0x21b>
cmpl   $0x7,-0x4(%rbp)
jne    1245 <agrega_periodo+0x135>
movl   $0x9,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xdf3(%rip),%rsi
call   1030 <strncat@plt>
jmp    1326 <agrega_periodo+0x216>
cmpl   $0x8,-0x4(%rbp)
jne    126e <agrega_periodo+0x15e>
movl   $0x8,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xdd4(%rip),%rsi
call   1030 <strncat@plt>
jmp    1321 <agrega_periodo+0x211>
cmpl   $0x9,-0x4(%rbp)
jne    1297 <agrega_periodo+0x187>
movl   $0x8,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xdb4(%rip),%rsi
call   1030 <strncat@plt>
jmp    131c <agrega_periodo+0x20c>
cmpl   $0xa,-0x4(%rbp)
jne    12c0 <agrega_periodo+0x1b0>
movl   $0x8,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd96(%rip),%rsi
call   1030 <strncat@plt>
jmp    1317 <agrega_periodo+0x207>
cmpl   $0xb,-0x4(%rbp)
jne    12e9 <agrega_periodo+0x1d9>
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd6b(%rip),%rsi
call   1030 <strncat@plt>
jmp    1312 <agrega_periodo+0x202>
cmpl   $0xc,-0x4(%rbp)
jne    130d <agrega_periodo+0x1fd>
movl   $0xb,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xd4d(%rip),%rsi
call   1030 <strncat@plt>
jmp    1312 <agrega_periodo+0x202>
jmp    1317 <agrega_periodo+0x207>
jmp    131c <agrega_periodo+0x20c>
jmp    1321 <agrega_periodo+0x211>
jmp    1326 <agrega_periodo+0x216>
jmp    132b <agrega_periodo+0x21b>
jmp    1330 <agrega_periodo+0x220>
jmp    1335 <agrega_periodo+0x225>
jmp    133a <agrega_periodo+0x22a>
jmp    133f <agrega_periodo+0x22f>
jmp    1344 <agrega_periodo+0x234>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agrega_periodo>:
push   %rbx
add    $0xffffffff,%edi
cmp    $0xb,%edi
ja     1206 <agrega_periodo+0xf6>
lea    0xedc(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xefc(%rip),%rax
jmp    113d <agrega_periodo+0x2d>
lea    0xefa(%rip),%rax
mov    $0x6,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x6,%edx
jmp    11fd <agrega_periodo+0xed>
lea    0xee8(%rip),%rax
mov    $0x7,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x7,%edx
jmp    11fd <agrega_periodo+0xed>
lea    0xec9(%rip),%rax
jmp    11d4 <agrega_periodo+0xc4>
lea    0xecb(%rip),%rax
jmp    11d4 <agrega_periodo+0xc4>
lea    0xecd(%rip),%rax
jmp    1190 <agrega_periodo+0x80>
lea    0xece(%rip),%rax
mov    $0x9,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x9,%edx
jmp    11fd <agrega_periodo+0xed>
lea    0xebf(%rip),%rax
jmp    11bb <agrega_periodo+0xab>
lea    0xebf(%rip),%rax
jmp    11bb <agrega_periodo+0xab>
lea    0xec1(%rip),%rax
mov    $0x8,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
jmp    11fd <agrega_periodo+0xed>
lea    0xea6(%rip),%rax
mov    $0xa,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0xa,%edx
jmp    11fd <agrega_periodo+0xed>
lea    0xe98(%rip),%rax
mov    $0xb,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0xb,%edx
call   1030 <strncat@plt>
mov    %ebx,%eax
pop    %rbx
ret
xor    %ebx,%ebx
jmp    1202 <agrega_periodo+0xf2>

LLVM IR (-O0):
@.str = [7 x i8] c"millon\00"
@.str.1 = [7 x i8] c"billon\00"
@.str.2 = [8 x i8] c"trillon\00"
@.str.3 = [11 x i8] c"cuatrillon\00"
@.str.4 = [11 x i8] c"quintillon\00"
@.str.5 = [10 x i8] c"sextillon\00"
@.str.6 = [10 x i8] c"septillon\00"
@.str.7 = [9 x i8] c"octillon\00"
@.str.8 = [9 x i8] c"nonillon\00"
@.str.9 = [9 x i8] c"decillon\00"
@.str.10 = [11 x i8] c"undecillon\00"
@.str.11 = [12 x i8] c"duodecillon\00"
define i32 @agrega_periodo(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %12
8: ; preds = %2
store i32 6, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %100
12: ; preds = %2
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %19
15: ; preds = %12
store i32 6, i32* %5
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = call i32 @strncat(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %99
19: ; preds = %12
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %26
22: ; preds = %19
store i32 7, i32* %5
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = call i32 @strncat(i8* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %98
26: ; preds = %19
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 4
br i1 %28, label %29, label %33
29: ; preds = %26
store i32 10, i32* %5
%30 = load i8*, i8** %4
%31 = load i32, i32* %5
%32 = call i32 @strncat(i8* %30, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %31)
br label %97
33: ; preds = %26
%34 = load i32, i32* %3
%35 = icmp eq i32 %34, 5
br i1 %35, label %36, label %40
36: ; preds = %33
store i32 10, i32* %5
%37 = load i8*, i8** %4
%38 = load i32, i32* %5
%39 = call i32 @strncat(i8* %37, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %38)
br label %96
40: ; preds = %33
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 6
br i1 %42, label %43, label %47
43: ; preds = %40
store i32 9, i32* %5
%44 = load i8*, i8** %4
%45 = load i32, i32* %5
%46 = call i32 @strncat(i8* %44, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %45)
br label %95
47: ; preds = %40
%48 = load i32, i32* %3
%49 = icmp eq i32 %48, 7
br i1 %49, label %50, label %54
50: ; preds = %47
store i32 9, i32* %5
%51 = load i8*, i8** %4
%52 = load i32, i32* %5
%53 = call i32 @strncat(i8* %51, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %52)
br label %94
54: ; preds = %47
%55 = load i32, i32* %3
%56 = icmp eq i32 %55, 8
br i1 %56, label %57, label %61
57: ; preds = %54
store i32 8, i32* %5
%58 = load i8*, i8** %4
%59 = load i32, i32* %5
%60 = call i32 @strncat(i8* %58, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 %59)
br label %93
61: ; preds = %54
%62 = load i32, i32* %3
%63 = icmp eq i32 %62, 9
br i1 %63, label %64, label %68
64: ; preds = %61
store i32 8, i32* %5
%65 = load i8*, i8** %4
%66 = load i32, i32* %5
%67 = call i32 @strncat(i8* %65, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 %66)
br label %92
68: ; preds = %61
%69 = load i32, i32* %3
%70 = icmp eq i32 %69, 10
br i1 %70, label %71, label %75
71: ; preds = %68
store i32 8, i32* %5
%72 = load i8*, i8** %4
%73 = load i32, i32* %5
%74 = call i32 @strncat(i8* %72, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 %73)
br label %91
75: ; preds = %68
%76 = load i32, i32* %3
%77 = icmp eq i32 %76, 11
br i1 %77, label %78, label %82
78: ; preds = %75
store i32 10, i32* %5
%79 = load i8*, i8** %4
%80 = load i32, i32* %5
%81 = call i32 @strncat(i8* %79, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32 %80)
br label %90
82: ; preds = %75
%83 = load i32, i32* %3
%84 = icmp eq i32 %83, 12
br i1 %84, label %85, label %89
85: ; preds = %82
store i32 11, i32* %5
%86 = load i8*, i8** %4
%87 = load i32, i32* %5
%88 = call i32 @strncat(i8* %86, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32 %87)
br label %89
89: ; preds = %85, %82
br label %90
90: ; preds = %89, %78
br label %91
91: ; preds = %90, %71
br label %92
92: ; preds = %91, %64
br label %93
93: ; preds = %92, %57
br label %94
94: ; preds = %93, %50
br label %95
95: ; preds = %94, %43
br label %96
96: ; preds = %95, %36
br label %97
97: ; preds = %96, %29
br label %98
98: ; preds = %97, %22
br label %99
99: ; preds = %98, %15
br label %100
100: ; preds = %99, %8
%101 = load i32, i32* %5
ret i32 %101
}

LLVM IR (-O2):
@.str = [7 x i8] c"millon\00"
@.str.1 = [7 x i8] c"billon\00"
@.str.2 = [8 x i8] c"trillon\00"
@.str.3 = [11 x i8] c"cuatrillon\00"
@.str.4 = [11 x i8] c"quintillon\00"
@.str.5 = [10 x i8] c"sextillon\00"
@.str.6 = [10 x i8] c"septillon\00"
@.str.7 = [9 x i8] c"octillon\00"
@.str.8 = [9 x i8] c"nonillon\00"
@.str.9 = [9 x i8] c"decillon\00"
@.str.10 = [11 x i8] c"undecillon\00"
@.str.11 = [12 x i8] c"duodecillon\00"
define i32 @agrega_periodo(i32 %0, i8* %1) {
switch i32 %0, label %27 [
i32 1, label %3
i32 2, label %5
i32 3, label %7
i32 4, label %9
i32 5, label %11
i32 6, label %13
i32 7, label %15
i32 8, label %17
i32 9, label %19
i32 10, label %21
i32 11, label %23
i32 12, label %25
]
3: ; preds = %2
%4 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %27
5: ; preds = %2
%6 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
br label %27
7: ; preds = %2
%8 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 7)
br label %27
9: ; preds = %2
%10 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 10)
br label %27
11: ; preds = %2
%12 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 10)
br label %27
13: ; preds = %2
%14 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 9)
br label %27
15: ; preds = %2
%16 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 9)
br label %27
17: ; preds = %2
%18 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 8)
br label %27
19: ; preds = %2
%20 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 8)
br label %27
21: ; preds = %2
%22 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i32 8)
br label %27
23: ; preds = %2
%24 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32 10)
br label %27
25: ; preds = %2
%26 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32 11)
br label %27
27: ; preds = %2, %5, %9, %13, %17, %21, %25, %23, %19, %15, %11, %7, %3
%28 = phi i32 [ 6, %3 ], [ 6, %5 ], [ 7, %7 ], [ 10, %9 ], [ 10, %11 ], [ 9, %13 ], [ 9, %15 ], [ 8, %17 ], [ 8, %19 ], [ 8, %21 ], [ 10, %23 ], [ 11, %25 ], [ 0, %2 ]
ret i32 %28
}