#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*/ copy1(char *, char *);
int /*<<< orphan*/ copy2(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char string1[10];
  char *string2 = "Hello";
  char string3[10];
  char string4[] = "Good Bye";
  copy1(string1, string2);
  printf("string1 = %s\n", string1);
  copy2(string3, string4);
  printf("string3 = %s\n", string3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb5(%rip),%rax
mov    %rax,-0x2b(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x23(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <copy1@plt>
lea    -0xe(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
lea    -0x22(%rbp),%rdi
lea    -0x2b(%rbp),%rsi
call   1030 <copy2@plt>
lea    -0x22(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x65794220646f6f47,%rax
42 79 65
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0xeb1(%rip),%rsi
lea    0x16(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <copy1@plt>
lea    0xeac(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xc(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <copy2@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@__const.main.string4 = [9 x i8] c"Good Bye\00"
@.str.1 = [14 x i8] c"string1 = %s\0A\00"
@.str.2 = [14 x i8] c"string3 = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i8*
%4 = alloca [10 x i8]
%5 = alloca [9 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = bitcast [9 x i8]* %5 to i8*
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @copy1(i8* %7, i8* %8)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%14 = call i32 @copy2(i8* %12, i8* %13)
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@__const.main.string4 = [9 x i8] c"Good Bye\00"
@.str.1 = [14 x i8] c"string1 = %s\0A\00"
@.str.2 = [14 x i8] c"string3 = %s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%7 = call i32 @copy1(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 @copy2(i8* %5, i8* %6)
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}