#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 EXIT_SUCCESS;
int /*<<< orphan*/ __memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *, char *);
int main(void) {
  char from[81] = "Hello World\0";
  char to[81] = "Gatieme\0";
  printf("%s %s\n", from, to);
  __memcpy(to, from, 81);
  printf("%s %s\n", from, to);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x51,%edx
call   1040 <memcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    0xefb(%rip),%rsi
mov    $0x51,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rsi
lea    -0xc0(%rbp),%rdx
lea    0xf30(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x51,%edx
call   1050 <__memcpy@plt>
lea    -0x60(%rbp),%rsi
lea    -0xc0(%rbp),%rdx
lea    0xf04(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xc0,%rsp
movaps 0xf0d(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe94(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movb   $0x0,0xb0(%rsp)
movaps 0xf20(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x50(%rsp)
lea    0xef1(%rip),%r14
lea    0x60(%rsp),%rbx
mov    %rsp,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x51,%edx
call   1040 <__memcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <printf@plt>
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
add    $0xc0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.from = [81 x i8] c"Hello World\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.to = [81 x i8] c"Gatieme\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [7 x i8] c"%s %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
%3 = alloca [81 x i8]
store i32 0, i32* %1
%4 = bitcast [81 x i8]* %2 to i8*
%5 = bitcast [81 x i8]* %3 to i8*
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%11 = call i32 @__memcpy(i8* %9, i8* %10, i32 81)
%12 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}

LLVM IR (-O2):
@__const.main.from = [81 x i8] c"Hello World\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.to = [81 x i8] c"Gatieme\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [7 x i8] c"%s %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [81 x i8]
%2 = alloca [81 x i8]
%3 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @__memcpy(i8* %4, i8* %3, i32 81)
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}