#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(int *, int *, int const);
void mapshorten(int *charmap, int *typemap, const int start, const int length) {
  memmove(charmap + start + 1, charmap + start + 2, (length - 1) * sizeof(int));
  memmove(typemap + start + 1, typemap + start + 2, (length - 1) * sizeof(int));
}


x86 assembly (clang, -O0):
<mapshorten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapshorten>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
movslq %edx,%rbx
lea    0x4(%rdi,%rbx,4),%rax
lea    0x8(%rdi,%rbx,4),%rsi
lea    -0x4(,%rcx,4),%ebp
mov    %rax,%rdi
mov    %ebp,%edx
call   1030 <memmove@plt>
lea    (%r14,%rbx,4),%rdi
add    $0x4,%rdi
lea    0x8(%r14,%rbx,4),%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @mapshorten(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32*, i32** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = getelementptr inbounds i32, i32* %17, i64 2
%19 = load i32, i32* %8
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = mul i64 %21, 4
%23 = trunc i64 %22 to i32
%24 = call i32 @memmove(i32* %13, i32* %18, i32 %23)
%25 = load i32*, i32** %6
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %25, i64 %27
%29 = getelementptr inbounds i32, i32* %28, i64 1
%30 = load i32*, i32** %6
%31 = load i32, i32* %7
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %30, i64 %32
%34 = getelementptr inbounds i32, i32* %33, i64 2
%35 = load i32, i32* %8
%36 = sub nsw i32 %35, 1
%37 = sext i32 %36 to i64
%38 = mul i64 %37, 4
%39 = trunc i64 %38 to i32
%40 = call i32 @memmove(i32* %29, i32* %34, i32 %39)
ret void
}

LLVM IR (-O2):
define void @mapshorten(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = getelementptr inbounds i32, i32* %6, i64 2
%9 = shl i32 %3, 2
%10 = add i32 %9, -4
%11 = tail call i32 @memmove(i32* %7, i32* %8, i32 %10)
%12 = getelementptr inbounds i32, i32* %1, i64 %5
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = getelementptr inbounds i32, i32* %12, i64 2
%15 = tail call i32 @memmove(i32* %13, i32* %14, i32 %10)
ret void
}