#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 *, ...);
int /*<<< orphan*/ strcat(char *, char *);
int main() {
  char *str[3] = {"Hello,this is a sample!", "Hi,good morning.", "Hello World"};
  char s[80] = {'\0'};
  strcat(s, str[0]);
  strcat(s, str[1]);
  strcat(s, str[2]);
  printf("%s\n", s);
  printf("%s\n", *(str + 0));
  printf("%s\n", *(str + 1));
  printf("%s\n", *(str + 2));
  printf("%c\n", **str);
  printf("%c\n", *(*(str + 0) + 1));
  printf("%c\n", *(*(str + 1) + 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x2cc1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cbe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cbb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x70(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x70(%rbp),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
movsbl (%rax),%esi
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
movsbl 0x1(%rax),%esi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xea3(%rip),%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
lea    0xea6(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
lea    0xea5(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
lea    0xe7f(%rip),%rbx
mov    %rbx,%rdi
mov    $0x48,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x69,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Hello,this is a sample!\00"
@.str.1 = [17 x i8] c"Hi,good morning.\00"
@.str.2 = [12 x i8] c"Hello World\00"
@__const.main.str = [3 x i8*] [i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca [3 x i8*]
%2 = alloca [80 x i8]
%3 = bitcast [3 x i8*]* %1 to i8*
%4 = bitcast [80 x i8]* %2 to i8*
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @strcat(i8* %5, i8* %7)
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcat(i8* %9, i8* %11)
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @strcat(i8* %13, i8* %15)
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%29 = load i8*, i8** %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%32 = load i8*, i8** %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%37 = getelementptr inbounds i8*, i8** %36, i64 0
%38 = load i8*, i8** %37
%39 = getelementptr inbounds i8, i8* %38, i64 1
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%44 = getelementptr inbounds i8*, i8** %43, i64 1
%45 = load i8*, i8** %44
%46 = getelementptr inbounds i8, i8* %45, i64 1
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %48)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Hello,this is a sample!\00"
@.str.1 = [17 x i8] c"Hi,good morning.\00"
@.str.2 = [12 x i8] c"Hello World\00"
@.str.4 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @puts(i8* %2)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 72)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 101)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 105)
ret i32 0
}