int main(int argc, char *argv[]) {
  char src[100] = {"123456789"};
  char *dst;
  int len = strlen(src);
  printf("src %s len %d\n", src, len);
  dst = ((char *)src + 8);
  mymove((void *)dst, (void *)(src), len);
  printf("src %s, dst(+8) %s %d\n", src, dst, len);
  char src2[100] = {"abcdefghijklmnopqrstuvwxyz"};
  len = strlen(src2);
  dst = ((char *)src2 + 50);
  mymove((void *)dst, (void *)(src2), len + 1);
  printf("src2 %s, dst(+8) %s %d\n", src2, dst, len);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x64,%edx
call   1060 <memcpy@plt>
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x8c(%rbp)
lea    -0x80(%rbp),%rsi
mov    -0x8c(%rbp),%edx
lea    0xf4d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x8c(%rbp),%edx
mov    $0x0,%al
call   1030 <mymove@plt>
lea    -0x80(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    -0x8c(%rbp),%ecx
lea    0xf16(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xf0(%rbp),%rdi
lea    0xe8e(%rip),%rsi
mov    $0x64,%edx
call   1060 <memcpy@plt>
lea    -0xf0(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x8c(%rbp)
lea    -0xf0(%rbp),%rax
add    $0x32,%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    -0x8c(%rbp),%edx
add    $0x1,%edx
mov    $0x0,%al
call   1030 <mymove@plt>
lea    -0xf0(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    -0x8c(%rbp),%ecx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
movaps 0xf0d(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xeee(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xe91(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe72(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xd0(%rsp)
lea    0x70(%rsp),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
lea    0xf1f(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x78(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <mymove@plt>
lea    0xf07(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe96(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe7a(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe5e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe42(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rbx
lea    0x32(%rsp),%r15
lea    0x1(%rax),%edx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <mymove@plt>
lea    0xe96(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.src = [100 x i8] c"123456789\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [15 x i8] c"src %s len %d\0A\00"
@.str.1 = [23 x i8] c"src %s, dst(+8) %s %d\0A\00"
@__const.main.src2 = [100 x i8] c"abcdefghijklmnopqrstuvwxyz\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.2 = [24 x i8] c"src2 %s, dst(+8) %s %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [100 x i8]
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [100 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = bitcast [100 x i8]* %5 to i8*
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i64 @strlen(i8* %10)
%12 = trunc i64 %11 to i32
store i32 %12, i32* %7
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%14 = load i32, i32* %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%17 = getelementptr inbounds i8, i8* %16, i64 8
store i8* %17, i8** %6
%18 = load i8*, i8** %6
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%20 = load i32, i32* %7
%21 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mymove to i32 (i8*, i8*, i32, ...)*)(i8* %18, i8* %19, i32 %20)
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%23 = load i8*, i8** %6
%24 = load i32, i32* %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %22, i8* %23, i32 %24)
%26 = bitcast [100 x i8]* %8 to i8*
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%28 = call i64 @strlen(i8* %27)
%29 = trunc i64 %28 to i32
store i32 %29, i32* %7
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%31 = getelementptr inbounds i8, i8* %30, i64 50
store i8* %31, i8** %6
%32 = load i8*, i8** %6
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
%36 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mymove to i32 (i8*, i8*, i32, ...)*)(i8* %32, i8* %33, i32 %35)
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%38 = load i8*, i8** %6
%39 = load i32, i32* %7
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %37, i8* %38, i32 %39)
ret i32 0
}

LLVM IR (-O2):
@__const.main.src = [100 x i8] c"123456789\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\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [15 x i8] c"src %s len %d\0A\00"
@.str.1 = [23 x i8] c"src %s, dst(+8) %s %d\0A\00"
@__const.main.src2 = [100 x i8] c"abcdefghijklmnopqrstuvwxyz\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.2 = [24 x i8] c"src2 %s, dst(+8) %s %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i64 @strlen(i8* %5)
%7 = trunc i64 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 8
%10 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mymove to i32 (i8*, i8*, i32, ...)*)(i8* %9, i8* %5, i32 %7)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %9, i32 %7)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = call i64 @strlen(i8* %12)
%14 = trunc i64 %13 to i32
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 50
%16 = add nsw i32 %14, 1
%17 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mymove to i32 (i8*, i8*, i32, ...)*)(i8* %15, i8* %12, i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %12, i8* %15, i32 %14)
ret i32 0
}