#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_decenas(const unsigned int numero, char *buffer) {
  int len = 0;
  if (numero == 3) {
    len = 7;
    strncat(buffer, "treinta", len);
  } else if (numero == 4) {
    len = 8;
    strncat(buffer, "cuarenta", len);
  } else if (numero == 5) {
    len = 9;
    strncat(buffer, "cincuenta", len);
  } else if (numero == 6) {
    len = 7;
    strncat(buffer, "sesenta", len);
  } else if (numero == 7) {
    len = 7;
    strncat(buffer, "setenta", len);
  } else if (numero == 8) {
    len = 7;
    strncat(buffer, "ochenta", len);
  } else if (numero == 9) {
    len = 7;
    strncat(buffer, "noventa", len);
  }
  return len;
}


x86 assembly (clang, -O0):
<agrega_las_decenas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    114f <agrega_las_decenas+0x3f>
movl   $0x7,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xebb(%rip),%rsi
call   1030 <strncat@plt>
jmp    125e <agrega_las_decenas+0x14e>
cmpl   $0x4,-0x4(%rbp)
jne    1178 <agrega_las_decenas+0x68>
movl   $0x8,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe9a(%rip),%rsi
call   1030 <strncat@plt>
jmp    1259 <agrega_las_decenas+0x149>
cmpl   $0x5,-0x4(%rbp)
jne    11a1 <agrega_las_decenas+0x91>
movl   $0x9,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe7a(%rip),%rsi
call   1030 <strncat@plt>
jmp    1254 <agrega_las_decenas+0x144>
cmpl   $0x6,-0x4(%rbp)
jne    11ca <agrega_las_decenas+0xba>
movl   $0x7,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe5b(%rip),%rsi
call   1030 <strncat@plt>
jmp    124f <agrega_las_decenas+0x13f>
cmpl   $0x7,-0x4(%rbp)
jne    11f3 <agrega_las_decenas+0xe3>
movl   $0x7,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe3a(%rip),%rsi
call   1030 <strncat@plt>
jmp    124a <agrega_las_decenas+0x13a>
cmpl   $0x8,-0x4(%rbp)
jne    121c <agrega_las_decenas+0x10c>
movl   $0x7,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe19(%rip),%rsi
call   1030 <strncat@plt>
jmp    1245 <agrega_las_decenas+0x135>
cmpl   $0x9,-0x4(%rbp)
jne    1240 <agrega_las_decenas+0x130>
movl   $0x7,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xdf8(%rip),%rsi
call   1030 <strncat@plt>
jmp    1245 <agrega_las_decenas+0x135>
jmp    124a <agrega_las_decenas+0x13a>
jmp    124f <agrega_las_decenas+0x13f>
jmp    1254 <agrega_las_decenas+0x144>
jmp    1259 <agrega_las_decenas+0x149>
jmp    125e <agrega_las_decenas+0x14e>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agrega_las_decenas>:
push   %rbx
add    $0xfffffffd,%edi
cmp    $0x6,%edi
ja     1132 <agrega_las_decenas+0x22>
lea    0xee0(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xeec(%rip),%rax
jmp    118a <agrega_las_decenas+0x7a>
xor    %ebx,%ebx
jmp    119f <agrega_las_decenas+0x8f>
lea    0xee7(%rip),%rax
mov    $0x8,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x8,%edx
jmp    119a <agrega_las_decenas+0x8a>
lea    0xed7(%rip),%rax
mov    $0x9,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x9,%edx
jmp    119a <agrega_las_decenas+0x8a>
lea    0xec8(%rip),%rax
jmp    118a <agrega_las_decenas+0x7a>
lea    0xec7(%rip),%rax
jmp    118a <agrega_las_decenas+0x7a>
lea    0xec6(%rip),%rax
jmp    118a <agrega_las_decenas+0x7a>
lea    0xec5(%rip),%rax
mov    $0x7,%ebx
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x7,%edx
call   1030 <strncat@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"treinta\00"
@.str.1 = [9 x i8] c"cuarenta\00"
@.str.2 = [10 x i8] c"cincuenta\00"
@.str.3 = [8 x i8] c"sesenta\00"
@.str.4 = [8 x i8] c"setenta\00"
@.str.5 = [8 x i8] c"ochenta\00"
@.str.6 = [8 x i8] c"noventa\00"
define i32 @agrega_las_decenas(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, 3
br i1 %7, label %8, label %12
8: ; preds = %2
store i32 7, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @strncat(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %60
12: ; preds = %2
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 4
br i1 %14, label %15, label %19
15: ; preds = %12
store i32 8, i32* %5
%16 = load i8*, i8** %4
%17 = load i32, i32* %5
%18 = call i32 @strncat(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %59
19: ; preds = %12
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 5
br i1 %21, label %22, label %26
22: ; preds = %19
store i32 9, i32* %5
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = call i32 @strncat(i8* %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %58
26: ; preds = %19
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 6
br i1 %28, label %29, label %33
29: ; preds = %26
store i32 7, i32* %5
%30 = load i8*, i8** %4
%31 = load i32, i32* %5
%32 = call i32 @strncat(i8* %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %31)
br label %57
33: ; preds = %26
%34 = load i32, i32* %3
%35 = icmp eq i32 %34, 7
br i1 %35, label %36, label %40
36: ; preds = %33
store i32 7, i32* %5
%37 = load i8*, i8** %4
%38 = load i32, i32* %5
%39 = call i32 @strncat(i8* %37, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %38)
br label %56
40: ; preds = %33
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 8
br i1 %42, label %43, label %47
43: ; preds = %40
store i32 7, i32* %5
%44 = load i8*, i8** %4
%45 = load i32, i32* %5
%46 = call i32 @strncat(i8* %44, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 %45)
br label %55
47: ; preds = %40
%48 = load i32, i32* %3
%49 = icmp eq i32 %48, 9
br i1 %49, label %50, label %54
50: ; preds = %47
store i32 7, i32* %5
%51 = load i8*, i8** %4
%52 = load i32, i32* %5
%53 = call i32 @strncat(i8* %51, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %50, %47
br label %55
55: ; preds = %54, %43
br label %56
56: ; preds = %55, %36
br label %57
57: ; preds = %56, %29
br label %58
58: ; preds = %57, %22
br label %59
59: ; preds = %58, %15
br label %60
60: ; preds = %59, %8
%61 = load i32, i32* %5
ret i32 %61
}

LLVM IR (-O2):
@.str = [8 x i8] c"treinta\00"
@.str.1 = [9 x i8] c"cuarenta\00"
@.str.2 = [10 x i8] c"cincuenta\00"
@.str.3 = [8 x i8] c"sesenta\00"
@.str.4 = [8 x i8] c"setenta\00"
@.str.5 = [8 x i8] c"ochenta\00"
@.str.6 = [8 x i8] c"noventa\00"
define i32 @agrega_las_decenas(i32 %0, i8* %1) {
switch i32 %0, label %17 [
i32 3, label %3
i32 4, label %5
i32 5, label %7
i32 6, label %9
i32 7, label %11
i32 8, label %13
i32 9, label %15
]
3: ; preds = %2
%4 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
br label %17
5: ; preds = %2
%6 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
br label %17
7: ; preds = %2
%8 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 9)
br label %17
9: ; preds = %2
%10 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 7)
br label %17
11: ; preds = %2
%12 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 7)
br label %17
13: ; preds = %2
%14 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 7)
br label %17
15: ; preds = %2
%16 = tail call i32 @strncat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 7)
br label %17
17: ; preds = %2, %5, %9, %13, %15, %11, %7, %3
%18 = phi i32 [ 7, %3 ], [ 8, %5 ], [ 9, %7 ], [ 7, %9 ], [ 7, %11 ], [ 7, %13 ], [ 7, %15 ], [ 0, %2 ]
ret i32 %18
}