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

/* Variables and functions */
void copy_wqe_to_udb(volatile uint32_t *udb_offset, void *wqe) {
  uint64_t *src, *dst;
  int len16 = 4;
  src = (uint64_t *)wqe;
  dst = (uint64_t *)udb_offset;
  while (len16) {
    *dst++ = *src++;
    *dst++ = *src++;
    len16--;
  }
}


x86 assembly (clang, -O0):
<copy_wqe_to_udb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     117f <copy_wqe_to_udb+0x7f>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1123 <copy_wqe_to_udb+0x23>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_wqe_to_udb>:
mov    (%rsi),%eax
mov    %eax,(%rdi)
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
mov    0x8(%rsi),%eax
mov    %eax,0x8(%rdi)
mov    0xc(%rsi),%eax
mov    %eax,0xc(%rdi)
mov    0x10(%rsi),%eax
mov    %eax,0x10(%rdi)
mov    0x14(%rsi),%eax
mov    %eax,0x14(%rdi)
mov    0x18(%rsi),%eax
mov    %eax,0x18(%rdi)
mov    0x1c(%rsi),%eax
mov    %eax,0x1c(%rdi)
ret

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

LLVM IR (-O2):
define void @copy_wqe_to_udb(i32* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = getelementptr inbounds i8, i8* %1, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %3
%7 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %6, i32* %0
%8 = getelementptr inbounds i8, i8* %1, i64 8
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %5
%11 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %10, i32* %7
%12 = getelementptr inbounds i8, i8* %1, i64 12
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %9
%15 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %14, i32* %11
%16 = getelementptr inbounds i8, i8* %1, i64 16
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %13
%19 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %18, i32* %15
%20 = getelementptr inbounds i8, i8* %1, i64 20
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %17
%23 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %22, i32* %19
%24 = getelementptr inbounds i8, i8* %1, i64 24
%25 = bitcast i8* %24 to i32*
%26 = load i32, i32* %21
%27 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %26, i32* %23
%28 = getelementptr inbounds i8, i8* %1, i64 28
%29 = bitcast i8* %28 to i32*
%30 = load i32, i32* %25
%31 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %30, i32* %27
%32 = load i32, i32* %29
store i32 %32, i32* %31
ret void
}