#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 */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Colormap;

/* Variables and functions */
int /*<<< orphan*/ memmove(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void Move(uint32_t dst, uint32_t src, uint32_t count, Window *windows,
          Colormap *colormaps, uint8_t *shapes, int32_t *offs) {
  if (count == 0)
    return;
  memmove(windows + dst, windows + src, count * sizeof(Window));
  memmove(colormaps + dst, colormaps + src, count * sizeof(Colormap));
  memmove(shapes + dst, shapes + src, count * sizeof(uint8_t));
  memmove(offs + dst, offs + src, count * sizeof(int32_t));
}


x86 assembly (clang, -O0):
<Move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1140 <Move+0x30>
jmp    11f4 <Move+0xe4>
mov    -0x18(%rbp),%rdi
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
mov    -0x20(%rbp),%rdi
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
mov    -0x28(%rbp),%rdi
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x28(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
mov    0x10(%rbp),%rdi
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    0x10(%rbp),%rsi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move>:
test   %edx,%edx
je     117f <Move+0x6f>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %edx,%ebx
mov    0x40(%rsp),%r12
movslq %edi,%r13
lea    (%rcx,%r13,4),%rdi
movslq %esi,%rbp
lea    (%rcx,%rbp,4),%rsi
shl    $0x2,%ebx
mov    %ebx,%edx
call   1030 <memmove@plt>
lea    (%r15,%r13,4),%rdi
lea    (%r15,%rbp,4),%rsi
mov    %ebx,%edx
call   1030 <memmove@plt>
lea    (%r14,%r13,4),%rdi
lea    (%r14,%rbp,4),%rsi
mov    %ebx,%edx
call   1030 <memmove@plt>
lea    (%r12,%r13,4),%rdi
lea    (%r12,%rbp,4),%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <memmove@plt>
ret

LLVM IR (-O0):
define void @Move(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i32, i32* %10
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %7
br label %71
18: ; preds = %7
%19 = load i32*, i32** %11
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32*, i32** %11
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %10
%28 = sext i32 %27 to i64
%29 = mul i64 %28, 4
%30 = trunc i64 %29 to i32
%31 = call i32 @memmove(i32* %22, i32* %26, i32 %30)
%32 = load i32*, i32** %12
%33 = load i32, i32* %8
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %32, i64 %34
%36 = load i32*, i32** %12
%37 = load i32, i32* %9
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
%40 = load i32, i32* %10
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 4
%43 = trunc i64 %42 to i32
%44 = call i32 @memmove(i32* %35, i32* %39, i32 %43)
%45 = load i32*, i32** %13
%46 = load i32, i32* %8
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i32, i32* %45, i64 %47
%49 = load i32*, i32** %13
%50 = load i32, i32* %9
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %49, i64 %51
%53 = load i32, i32* %10
%54 = sext i32 %53 to i64
%55 = mul i64 %54, 4
%56 = trunc i64 %55 to i32
%57 = call i32 @memmove(i32* %48, i32* %52, i32 %56)
%58 = load i32*, i32** %14
%59 = load i32, i32* %8
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %58, i64 %60
%62 = load i32*, i32** %14
%63 = load i32, i32* %9
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i32, i32* %62, i64 %64
%66 = load i32, i32* %10
%67 = sext i32 %66 to i64
%68 = mul i64 %67, 4
%69 = trunc i64 %68 to i32
%70 = call i32 @memmove(i32* %61, i32* %65, i32 %69)
br label %71
71: ; preds = %18, %17
ret void
}

LLVM IR (-O2):
define void @Move(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = icmp eq i32 %2, 0
br i1 %8, label %25, label %9
9: ; preds = %7
%10 = sext i32 %0 to i64
%11 = getelementptr inbounds i32, i32* %3, i64 %10
%12 = sext i32 %1 to i64
%13 = getelementptr inbounds i32, i32* %3, i64 %12
%14 = shl i32 %2, 2
%15 = tail call i32 @memmove(i32* %11, i32* %13, i32 %14)
%16 = getelementptr inbounds i32, i32* %4, i64 %10
%17 = getelementptr inbounds i32, i32* %4, i64 %12
%18 = tail call i32 @memmove(i32* %16, i32* %17, i32 %14)
%19 = getelementptr inbounds i32, i32* %5, i64 %10
%20 = getelementptr inbounds i32, i32* %5, i64 %12
%21 = tail call i32 @memmove(i32* %19, i32* %20, i32 %14)
%22 = getelementptr inbounds i32, i32* %6, i64 %10
%23 = getelementptr inbounds i32, i32* %6, i64 %12
%24 = tail call i32 @memmove(i32* %22, i32* %23, i32 %14)
br label %25
25: ; preds = %7, %9
ret void
}