#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*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char *colors[] = {"Red", "Orange", "Yellow", "Green", "Blue", "Purple"};
  char *widths[] = {"Thin", "Medium", "Thick", "Bold"};
  char penText[20];
  int penColor = 3, penThickness = 2;
  strcpy(penText, colors[penColor]);
  strcat(penText, widths[penThickness]);
  printf("My pen is %s\n", penText);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1050 <memset@plt>
lea    0xe97(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe90(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe8c(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe88(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe83(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe7d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2c55(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2c52(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0x2c4f(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0x2c4c(%rip),%rax
mov    %rax,-0x48(%rbp)
movl   $0x3,-0x84(%rbp)
movl   $0x2,-0x88(%rbp)
lea    -0x80(%rbp),%rdi
movslq -0x84(%rbp),%rax
mov    -0x40(%rbp,%rax,8),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rdi
movslq -0x88(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
call   1060 <strcat@plt>
lea    -0x80(%rbp),%rsi
lea    0xe22(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xeaf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Red\00"
@.str.1 = [7 x i8] c"Orange\00"
@.str.2 = [7 x i8] c"Yellow\00"
@.str.3 = [6 x i8] c"Green\00"
@.str.4 = [5 x i8] c"Blue\00"
@.str.5 = [7 x i8] c"Purple\00"
@.str.6 = [5 x i8] c"Thin\00"
@.str.7 = [7 x i8] c"Medium\00"
@.str.8 = [6 x i8] c"Thick\00"
@.str.9 = [5 x i8] c"Bold\00"
@__const.main.widths = [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0)]
@.str.10 = [14 x i8] c"My pen is %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8*]
%3 = alloca [4 x i8*]
%4 = alloca [20 x i8]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [6 x i8*]* %2 to i8*
%8 = bitcast i8* %7 to [6 x i8*]*
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 4
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %8, i32 0, i32 5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i32 0, i32 0), i8** %14
%15 = bitcast [4 x i8*]* %3 to i8*
store i32 3, i32* %5
store i32 2, i32* %6
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [6 x i8*], [6 x i8*]* %2, i64 0, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @strcpy(i8* %16, i8* %20)
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 @strcat(i8* %22, i8* %26)
%28 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%29 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %28)
ret i32 0
}

LLVM IR (-O2):
@.str.3 = [6 x i8] c"Green\00"
@.str.8 = [6 x i8] c"Thick\00"
@.str.10 = [14 x i8] c"My pen is %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %2)
ret i32 0
}