#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*/ uint64_t;

/* Variables and functions */
void blkcpy(uint64_t *dest, const uint64_t *src, size_t count) {
  do {
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
    *dest++ = *src++;
  } while (count -= 4);
}


x86 assembly (clang, -O0):
<blkcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
sub    $0x4,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1110 <blkcpy+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blkcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsi,%rax,4),%ecx
mov    %ecx,(%rdi,%rax,4)
mov    0x4(%rsi,%rax,4),%ecx
mov    %ecx,0x4(%rdi,%rax,4)
mov    0x8(%rsi,%rax,4),%ecx
mov    %ecx,0x8(%rdi,%rax,4)
mov    0xc(%rsi,%rax,4),%ecx
mov    %ecx,0xc(%rdi,%rax,4)
add    $0x4,%rax
cmp    %rax,%rdx
jne    1110 <blkcpy+0x10>
ret

LLVM IR (-O0):
define void @blkcpy(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
br label %7
7: ; preds = %28, %3
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i32 1
store i32* %9, i32** %5
%10 = load i32, i32* %8
%11 = load i32*, i32** %4
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %4
store i32 %10, i32* %11
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i32 1
store i32* %14, i32** %5
%15 = load i32, i32* %13
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i32 1
store i32* %17, i32** %4
store i32 %15, i32* %16
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %5
%20 = load i32, i32* %18
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %4
store i32 %20, i32* %21
%23 = load i32*, i32** %5
%24 = getelementptr inbounds i32, i32* %23, i32 1
store i32* %24, i32** %5
%25 = load i32, i32* %23
%26 = load i32*, i32** %4
%27 = getelementptr inbounds i32, i32* %26, i32 1
store i32* %27, i32** %4
store i32 %25, i32* %26
br label %28
28: ; preds = %7
%29 = load i64, i64* %6
%30 = sub i64 %29, 4
store i64 %30, i64* %6
%31 = icmp ne i64 %30, 0
br i1 %31, label %7, label %32
32: ; preds = %28
ret void
}

LLVM IR (-O2):
define void @blkcpy(i32* nocapture writeonly %0, i32* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32* [ %0, %3 ], [ %19, %4 ]
%6 = phi i32* [ %1, %3 ], [ %17, %4 ]
%7 = phi i64 [ %2, %3 ], [ %20, %4 ]
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %6
%10 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %9, i32* %5
%11 = getelementptr inbounds i32, i32* %6, i64 2
%12 = load i32, i32* %8
%13 = getelementptr inbounds i32, i32* %5, i64 2
store i32 %12, i32* %10
%14 = getelementptr inbounds i32, i32* %6, i64 3
%15 = load i32, i32* %11
%16 = getelementptr inbounds i32, i32* %5, i64 3
store i32 %15, i32* %13
%17 = getelementptr inbounds i32, i32* %6, i64 4
%18 = load i32, i32* %14
%19 = getelementptr inbounds i32, i32* %5, i64 4
store i32 %18, i32* %16
%20 = add i64 %7, -4
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %4
22: ; preds = %4
ret void
}