#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*/ strcpy(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int main(void) {
  char color[] = "rojo";
  char grosor[] = "grueso";
  char descripcion[1024];
  strcpy(descripcion, "Lapiz color ");
  strncat(descripcion, color, 1024);
  strncat(descripcion, " de trazo ", 1024);
  strncat(descripcion, grosor, 1024);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0xc(%rbp)
mov    0xead(%rip),%al
mov    %al,-0xa(%rbp)
lea    -0x410(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x410(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x400,%edx
call   1040 <strncat@plt>
lea    -0x410(%rbp),%rdi
lea    0xe82(%rip),%rsi
mov    $0x400,%edx
call   1040 <strncat@plt>
lea    -0x410(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x400,%edx
call   1040 <strncat@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
movb   $0x0,0x4(%rsp)
movl   $0x6f6a6f72,(%rsp)
movl   $0x6f7365,0xb(%rsp)
movl   $0x65757267,0x8(%rsp)
65
lea    0xec1(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x400,%edx
call   1040 <strncat@plt>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
mov    $0x400,%edx
call   1040 <strncat@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x400,%edx
call   1040 <strncat@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.color = [5 x i8] c"rojo\00"
@__const.main.grosor = [7 x i8] c"grueso\00"
@.str = [13 x i8] c"Lapiz color \00"
@.str.1 = [11 x i8] c" de trazo \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [7 x i8]
%4 = alloca [1024 x i8]
store i32 0, i32* %1
%5 = bitcast [5 x i8]* %2 to i8*
%6 = bitcast [7 x i8]* %3 to i8*
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%11 = call i32 @strncat(i8* %9, i8* %10, i32 1024)
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%13 = call i32 @strncat(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1024)
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%15 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%16 = call i32 @strncat(i8* %14, i8* %15, i32 1024)
ret i32 0
}

LLVM IR (-O2):
@__const.main.color = [5 x i8] c"rojo\00"
@__const.main.grosor = [7 x i8] c"grueso\00"
@.str = [13 x i8] c"Lapiz color \00"
@.str.1 = [11 x i8] c" de trazo \00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [7 x i8]
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @strncat(i8* %6, i8* %4, i32 1024)
%9 = call i32 @strncat(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1024)
%10 = call i32 @strncat(i8* %6, i8* %5, i32 1024)
ret i32 0
}