#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_las_centenas(const unsigned int numero, char *buffer) {
  int len = 0;
  if (numero == 1) {
    len = 6;
    strncat(buffer, "ciento", 6);
  } else if (numero == 2) {
    len = 10;
    strncat(buffer, "doscientos", len);
  } else if (numero == 3) {
    len = 11;
    strncat(buffer, "trescientos", len);
  } else if (numero == 4) {
    len = 13;
    strncat(buffer, "cuatrocientos", len);
  } else if (numero == 5) {
    len = 10;
    strncat(buffer, "quinientos", len);
  } else if (numero == 6) {
    len = 11;
    strncat(buffer, "seiscientos", len);
  } else if (numero == 7) {
    len = 11;
    strncat(buffer, "setecientos", len);
  } else if (numero == 8) {
    len = 11;
    strncat(buffer, "ochocientos", len);
  } else if (numero == 9) {
    len = 11;
    strncat(buffer, "novecientos", len);
  }
  return len;
}


x86 assembly (clang, -O0):
<agrega_las_centenas>:
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    1151 <agrega_las_centenas+0x41>
movl   $0x6,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncat@plt>
jmp    12bc <agrega_las_centenas+0x1ac>
cmpl   $0x2,-0x4(%rbp)
jne    117a <agrega_las_centenas+0x6a>
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe97(%rip),%rsi
call   1030 <strncat@plt>
jmp    12b7 <agrega_las_centenas+0x1a7>
cmpl   $0x3,-0x4(%rbp)
jne    11a3 <agrega_las_centenas+0x93>
movl   $0xb,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe79(%rip),%rsi
call   1030 <strncat@plt>
jmp    12b2 <agrega_las_centenas+0x1a2>
cmpl   $0x4,-0x4(%rbp)
jne    11cc <agrega_las_centenas+0xbc>
movl   $0xd,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe5c(%rip),%rsi
call   1030 <strncat@plt>
jmp    12ad <agrega_las_centenas+0x19d>
cmpl   $0x5,-0x4(%rbp)
jne    11f5 <agrega_las_centenas+0xe5>
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe41(%rip),%rsi
call   1030 <strncat@plt>
jmp    12a8 <agrega_las_centenas+0x198>
cmpl   $0x6,-0x4(%rbp)
jne    121e <agrega_las_centenas+0x10e>
movl   $0xb,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe23(%rip),%rsi
call   1030 <strncat@plt>
jmp    12a3 <agrega_las_centenas+0x193>
cmpl   $0x7,-0x4(%rbp)
jne    1247 <agrega_las_centenas+0x137>
movl   $0xb,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe06(%rip),%rsi
call   1030 <strncat@plt>
jmp    129e <agrega_las_centenas+0x18e>
cmpl   $0x8,-0x4(%rbp)
jne    1270 <agrega_las_centenas+0x160>
movl   $0xb,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xde9(%rip),%rsi
call   1030 <strncat@plt>
jmp    1299 <agrega_las_centenas+0x189>
cmpl   $0x9,-0x4(%rbp)
jne    1294 <agrega_las_centenas+0x184>
movl   $0xb,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xdcc(%rip),%rsi
call   1030 <strncat@plt>
jmp    1299 <agrega_las_centenas+0x189>
jmp    129e <agrega_las_centenas+0x18e>
jmp    12a3 <agrega_las_centenas+0x193>
jmp    12a8 <agrega_las_centenas+0x198>
jmp    12ad <agrega_las_centenas+0x19d>
jmp    12b2 <agrega_las_centenas+0x1a2>
jmp    12b7 <agrega_las_centenas+0x1a7>
jmp    12bc <agrega_las_centenas+0x1ac>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agrega_las_centenas>:
push   %rbx
add    $0xffffffff,%edi
cmp    $0x8,%edi
ja     1142 <agrega_las_centenas+0x32>
lea    0xee0(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xef4(%rip),%rax
mov    $0x6,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x6,%edx
jmp    11bc <agrega_las_centenas+0xac>
xor    %ebx,%ebx
jmp    11c1 <agrega_las_centenas+0xb1>
lea    0xede(%rip),%rax
jmp    1178 <agrega_las_centenas+0x68>
lea    0xee0(%rip),%rax
jmp    11ac <agrega_las_centenas+0x9c>
lea    0xee3(%rip),%rax
mov    $0xd,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0xd,%edx
jmp    11bc <agrega_las_centenas+0xac>
lea    0xed8(%rip),%rax
mov    $0xa,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0xa,%edx
jmp    11bc <agrega_las_centenas+0xac>
lea    0xeca(%rip),%rax
jmp    11ac <agrega_las_centenas+0x9c>
lea    0xecd(%rip),%rax
jmp    11ac <agrega_las_centenas+0x9c>
lea    0xed0(%rip),%rax
jmp    11ac <agrega_las_centenas+0x9c>
lea    0xed3(%rip),%rax
mov    $0xb,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0xb,%edx
call   1030 <strncat@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ciento\00"
@.str.1 = [11 x i8] c"doscientos\00"
@.str.2 = [12 x i8] c"trescientos\00"
@.str.3 = [14 x i8] c"cuatrocientos\00"
@.str.4 = [11 x i8] c"quinientos\00"
@.str.5 = [12 x i8] c"seiscientos\00"
@.str.6 = [12 x i8] c"setecientos\00"
@.str.7 = [12 x i8] c"ochocientos\00"
@.str.8 = [12 x i8] c"novecientos\00"
define i32 @agrega_las_centenas(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 %11
8: ; preds = %2
store i32 6, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %75
11: ; preds = %2
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %18
14: ; preds = %11
store i32 10, i32* %5
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = call i32 @strncat(i8* %15, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %74
18: ; preds = %11
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 3
br i1 %20, label %21, label %25
21: ; preds = %18
store i32 11, i32* %5
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = call i32 @strncat(i8* %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %73
25: ; preds = %18
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 4
br i1 %27, label %28, label %32
28: ; preds = %25
store i32 13, i32* %5
%29 = load i8*, i8** %4
%30 = load i32, i32* %5
%31 = call i32 @strncat(i8* %29, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %30)
br label %72
32: ; preds = %25
%33 = load i32, i32* %3
%34 = icmp eq i32 %33, 5
br i1 %34, label %35, label %39
35: ; preds = %32
store i32 10, i32* %5
%36 = load i8*, i8** %4
%37 = load i32, i32* %5
%38 = call i32 @strncat(i8* %36, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %37)
br label %71
39: ; preds = %32
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, 6
br i1 %41, label %42, label %46
42: ; preds = %39
store i32 11, i32* %5
%43 = load i8*, i8** %4
%44 = load i32, i32* %5
%45 = call i32 @strncat(i8* %43, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %44)
br label %70
46: ; preds = %39
%47 = load i32, i32* %3
%48 = icmp eq i32 %47, 7
br i1 %48, label %49, label %53
49: ; preds = %46
store i32 11, i32* %5
%50 = load i8*, i8** %4
%51 = load i32, i32* %5
%52 = call i32 @strncat(i8* %50, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %51)
br label %69
53: ; preds = %46
%54 = load i32, i32* %3
%55 = icmp eq i32 %54, 8
br i1 %55, label %56, label %60
56: ; preds = %53
store i32 11, i32* %5
%57 = load i8*, i8** %4
%58 = load i32, i32* %5
%59 = call i32 @strncat(i8* %57, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %58)
br label %68
60: ; preds = %53
%61 = load i32, i32* %3
%62 = icmp eq i32 %61, 9
br i1 %62, label %63, label %67
63: ; preds = %60
store i32 11, i32* %5
%64 = load i8*, i8** %4
%65 = load i32, i32* %5
%66 = call i32 @strncat(i8* %64, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %65)
br label %67
67: ; preds = %63, %60
br label %68
68: ; preds = %67, %56
br label %69
69: ; preds = %68, %49
br label %70
70: ; preds = %69, %42
br label %71
71: ; preds = %70, %35
br label %72
72: ; preds = %71, %28
br label %73
73: ; preds = %72, %21
br label %74
74: ; preds = %73, %14
br label %75
75: ; preds = %74, %8
%76 = load i32, i32* %5
ret i32 %76
}

LLVM IR (-O2):
@.str = [7 x i8] c"ciento\00"
@.str.1 = [11 x i8] c"doscientos\00"
@.str.2 = [12 x i8] c"trescientos\00"
@.str.3 = [14 x i8] c"cuatrocientos\00"
@.str.4 = [11 x i8] c"quinientos\00"
@.str.5 = [12 x i8] c"seiscientos\00"
@.str.6 = [12 x i8] c"setecientos\00"
@.str.7 = [12 x i8] c"ochocientos\00"
@.str.8 = [12 x i8] c"novecientos\00"
define i32 @agrega_las_centenas(i32 %0, i8* %1) {
switch i32 %0, label %21 [
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
]
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 %21
5: ; preds = %2
%6 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 10)
br label %21
7: ; preds = %2
%8 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 11)
br label %21
9: ; preds = %2
%10 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 13)
br label %21
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 %21
13: ; preds = %2
%14 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 11)
br label %21
15: ; preds = %2
%16 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 11)
br label %21
17: ; preds = %2
%18 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 11)
br label %21
19: ; preds = %2
%20 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 11)
br label %21
21: ; preds = %2, %5, %9, %13, %17, %19, %15, %11, %7, %3
%22 = phi i32 [ 6, %3 ], [ 10, %5 ], [ 11, %7 ], [ 13, %9 ], [ 10, %11 ], [ 11, %13 ], [ 11, %15 ], [ 11, %17 ], [ 11, %19 ], [ 0, %2 ]
ret i32 %22
}