#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() {
  char s1[16];
  char *s2 = "Now is the time";
  char s3[25];
  char s4[] = " for all good programmers";
  copy1(s1, s2);
  printf("s1:  %s\n", s1);
  copy2(s3, s4);
  printf("s3:  %s\n", s3);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xedf(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xedc(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xed6(%rip),%ax
mov    %ax,-0x58(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <copy1@plt>
lea    -0x20(%rbp),%rsi
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <copy2@plt>
lea    -0x50(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movups 0xefe(%rip),%xmm0
movups %xmm0,0xa(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xead(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <copy1@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0x30(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <copy2@plt>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Now is the time\00"
@__const.main.s4 = [26 x i8] c" for all good programmers\00"
@.str.1 = [9 x i8] c"s1: %s\0A\00"
@.str.2 = [9 x i8] c"s3: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i8*
%4 = alloca [25 x i8]
%5 = alloca [26 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = bitcast [26 x i8]* %5 to i8*
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @copy1(i8* %7, i8* %8)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [26 x i8], [26 x i8]* %5, i64 0, i64 0
%14 = call i32 @copy2(i8* %12, i8* %13)
%15 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %15)
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"Now is the time\00"
@__const.main.s4 = [26 x i8] c" for all good programmers\00"
@.str.1 = [9 x i8] c"s1: %s\0A\00"
@.str.2 = [9 x i8] c"s3: %s\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = alloca [25 x i8]
%3 = alloca [26 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 0
%7 = call i32 @copy1(i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 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 ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 1
}