#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 */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int main(int argc, char *argv[]) {
  char *a[] = {"I", "LOVE", "C", "PROGRAMMING"};
  char buf[1024] = {0};
  int i, len = sizeof(a) / sizeof(a[0]);
  for (i = 0; i < len; i++) {
    strcat(buf, a[i]);
    if (i < len - 1)
      strcat(buf, " ");
  }
  printf("[%s]\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cb0(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cad(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2caa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ca7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x430(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movl   $0x4,-0x438(%rbp)
movl   $0x0,-0x434(%rbp)
mov    -0x434(%rbp),%eax
cmp    -0x438(%rbp),%eax
jge    1209 <main+0xd9>
lea    -0x430(%rbp),%rdi
movslq -0x434(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rsi
call   1050 <strcat@plt>
mov    -0x434(%rbp),%eax
mov    -0x438(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11f0 <main+0xc0>
lea    -0x430(%rbp),%rdi
lea    0xe2a(%rip),%rsi
call   1050 <strcat@plt>
jmp    11f5 <main+0xc5>
mov    -0x434(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x434(%rbp)
jmp    119c <main+0x6c>
lea    -0x430(%rbp),%rsi
lea    0xe00(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xeb3(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
lea    0xe79(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
lea    0xe61(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xe60(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"I\00"
@.str.1 = [5 x i8] c"LOVE\00"
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [12 x i8] c"PROGRAMMING\00"
@__const.main.a = [4 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [2 x i8] c" \00"
@.str.5 = [6 x i8] c"[%s]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8*]
%7 = alloca [1024 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [4 x i8*]* %6 to i8*
%11 = bitcast [1024 x i8]* %7 to i8*
store i32 4, i32* %9
store i32 0, i32* %8
br label %12
12: ; preds = %31, %2
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %34
16: ; preds = %12
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @strcat(i8* %17, i8* %21)
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = sub nsw i32 %24, 1
%26 = icmp slt i32 %23, %25
br i1 %26, label %27, label %30
27: ; preds = %16
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%29 = call i32 @strcat(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %30
30: ; preds = %27, %16
br label %31
31: ; preds = %30
%32 = load i32, i32* %8
%33 = add nsw i32 %32, 1
store i32 %33, i32* %8
br label %12
34: ; preds = %12
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%36 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"I\00"
@.str.1 = [5 x i8] c"LOVE\00"
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [12 x i8] c"PROGRAMMING\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [6 x i8] c"[%s]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %4)
ret i32 0
}