#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*/ memmove(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  char des[128];
  char src[] = "Linux C";
  strcpy(des, src);
  printf("%s\n", des);
  memmove(src, src + 5, strlen(src) - 5);
  src[strlen(src) - 11] = '\0';
  printf("%s\n", src);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x98(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
lea    -0x98(%rbp),%rax
mov    %rax,-0xa8(%rbp)
lea    -0x98(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0xa0(%rbp)
lea    -0x98(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xa8(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
mov    %eax,%edx
sub    $0x5,%edx
call   1060 <memmove@plt>
lea    -0x98(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0xb,%eax
cltq
movb   $0x0,-0x98(%rbp,%rax,1)
lea    -0x98(%rbp),%rsi
lea    0xe17(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x90,%rsp
movabs $0x432078756e694c,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xe89(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
lea    0xd(%rsp),%r14
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    -0x5(%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <memmove@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0xb(%rax,%rbx,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.src = [8 x i8] c"Linux C\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca [8 x i8]
store i32 0, i32* %1
%4 = bitcast [8 x i8]* %3 to i8*
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds i8, i8* %11, i64 5
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
%15 = sub nsw i32 %14, 5
%16 = call i32 @memmove(i8* %10, i8* %12, i32 %15)
%17 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%18 = call i32 @strlen(i8* %17)
%19 = sub nsw i32 %18, 11
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 %20
store i8 0, i8* %21
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca i64
%3 = bitcast i64* %2 to [8 x i8]*
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%5 = bitcast i64* %2 to i8*
store i64 18894525177948492, i64* %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = getelementptr inbounds i8, i8* %5, i64 5
%9 = call i32 @strlen(i8* %5)
%10 = add nsw i32 %9, -5
%11 = call i32 @memmove(i8* %5, i8* %8, i32 %10)
%12 = call i32 @strlen(i8* %5)
%13 = add nsw i32 %12, -11
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 %14
store i8 0, i8* %15
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}