#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 *);
void main() {
  char str1[5] = "love", str2[] = " in China";
  char str3[30];
  char str4[5][6];
  void strcon(char str1[], char str2[], char str3[]);
  int i;
  strcon(str1, str2, str3);
  printf("str1:%s\n", str1);
  printf("str2:%s\n", str2);
  printf("connect string:%s", str3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xec1(%rip),%ax
mov    %ax,-0x7(%rbp)
lea    -0x5(%rbp),%rdi
lea    -0xf(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <strcon@plt>
lea    -0x5(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    -0xf(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x65766f6c,0x8(%rsp)
65
movabs $0x6e696843206e6920,%rax
68 69 6e
mov    %rax,0x10(%rsp)
movw   $0x61,0x18(%rsp)
lea    0x8(%rsp),%rbx
lea    0x10(%rsp),%r14
lea    0x20(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <strcon@plt>
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.str1 = [5 x i8] c"love\00"
@__const.main.str2 = [10 x i8] c" in China\00"
@.str = [9 x i8] c"str1:%s\0A\00"
@.str.1 = [9 x i8] c"str2:%s\0A\00"
@.str.2 = [18 x i8] c"connect string:%s\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = alloca [30 x i8]
%4 = alloca [5 x [6 x i8]]
%5 = alloca i32
%6 = bitcast [5 x i8]* %1 to i8*
%7 = bitcast [10 x i8]* %2 to i8*
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@__const.main.str1 = [5 x i8] c"love\00"
@__const.main.str2 = [10 x i8] c" in China\00"
@.str = [9 x i8] c"str1:%s\0A\00"
@.str.1 = [9 x i8] c"str2:%s\0A\00"
@.str.2 = [18 x i8] c"connect string:%s\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = alloca [10 x i8]
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}