#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*/ free(char *);
int /*<<< orphan*/ memmove(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
char *strdup(char *);
int main(int argc, char *argv[]) {
  char tmp[] = "tsmjkfrjsdlkfjpoer";
  char tmp2[] = "abcdefghijklmnopqrstiov";
  char *str;
  memmove(NULL, NULL, 0);
  str = strdup(tmp);
  printf("str => %s | ", tmp2);
  memmove(&tmp2[2], &tmp2[0], 5);
  printf("str -> %s\n", tmp2);
  free(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe9d(%rip),%ax
mov    %ax,-0x20(%rbp)
mov    0xe95(%rip),%al
mov    %al,-0x1e(%rbp)
mov    0xe99(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe96(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe93(%rip),%rax
mov    %rax,-0x40(%rbp)
xor    %edx,%edx
mov    %edx,%esi
mov    %rsi,%rdi
call   1050 <memmove@plt>
lea    -0x30(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
add    $0x2,%rdi
lea    -0x50(%rbp),%rsi
mov    $0x5,%edx
call   1050 <memmove@plt>
lea    -0x50(%rbp),%rsi
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x72656f,0x2f(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x766f6974737271,%rax
mov    %rax,0x10(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <memmove@plt>
lea    0x20(%rsp),%rdi
call   1060 <strdup@plt>
mov    %rax,%r14
lea    0xea4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0x2(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x5,%edx
call   1050 <memmove@plt>
lea    0xe8d(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.tmp = [19 x i8] c"tsmjkfrjsdlkfjpoer\00"
@__const.main.tmp2 = [24 x i8] c"abcdefghijklmnopqrstiov\00"
@.str = [13 x i8] c"str => %s | \00"
@.str.1 = [11 x i8] c"str -> %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [19 x i8]
%7 = alloca [24 x i8]
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [19 x i8]* %6 to i8*
%10 = bitcast [24 x i8]* %7 to i8*
%11 = call i32 @memmove(i8* null, i8* null, i32 0)
%12 = getelementptr inbounds [19 x i8], [19 x i8]* %6, i64 0, i64 0
%13 = call i8* @strdup(i8* %12)
store i8* %13, i8** %8
%14 = getelementptr inbounds [24 x i8], [24 x i8]* %7, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [24 x i8], [24 x i8]* %7, i64 0, i64 2
%17 = getelementptr inbounds [24 x i8], [24 x i8]* %7, i64 0, i64 0
%18 = call i32 @memmove(i8* %16, i8* %17, i32 5)
%19 = getelementptr inbounds [24 x i8], [24 x i8]* %7, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %8
%22 = call i32 @free(i8* %21)
ret i32 0
}

LLVM IR (-O2):
@__const.main.tmp = [19 x i8] c"tsmjkfrjsdlkfjpoer\00"
@__const.main.tmp2 = [24 x i8] c"abcdefghijklmnopqrstiov\00"
@.str = [13 x i8] c"str => %s | \00"
@.str.1 = [11 x i8] c"str -> %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [19 x i8]
%4 = alloca [24 x i8]
%5 = getelementptr inbounds [19 x i8], [19 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @memmove(i8* null, i8* null, i32 0)
%8 = call i8* @strdup(i8* %5)
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6)
%10 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 2
%11 = call i32 @memmove(i8* %10, i8* %6, i32 5)
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%13 = call i32 @free(i8* %8)
ret i32 0
}