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

/* Variables and functions */
int /*<<< orphan*/ libcperciva_be32enc(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ const);
void be32enc_vect(uint8_t *dst, const uint32_t *src, size_t len) {
  do {
    libcperciva_be32enc(&dst[0], src[0]);
    libcperciva_be32enc(&dst[4], src[1]);
    src += 2;
    dst += 8;
  } while (--len);
}


x86 assembly (clang, -O0):
<be32enc_vect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <libcperciva_be32enc@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%esi
call   1030 <libcperciva_be32enc@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1124 <be32enc_vect+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32enc_vect>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%rbx,8),%esi
mov    %r12,%rdi
call   1030 <libcperciva_be32enc@plt>
mov    0x4(%r15,%rbx,8),%esi
lea    0x10(%r12),%rdi
call   1030 <libcperciva_be32enc@plt>
add    $0x1,%rbx
add    $0x20,%r12
cmp    %rbx,%r14
jne    1130 <be32enc_vect+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @be32enc_vect(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 = %24, %3
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = call i32 @libcperciva_be32enc(i32* %9, i32 %12)
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 4
%16 = load i32*, i32** %5
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = call i32 @libcperciva_be32enc(i32* %15, i32 %18)
%20 = load i32*, i32** %5
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32* %21, i32** %5
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 8
store i32* %23, i32** %4
br label %24
24: ; preds = %7
%25 = load i64, i64* %6
%26 = add i64 %25, -1
store i64 %26, i64* %6
%27 = icmp ne i64 %26, 0
br i1 %27, label %7, label %28
28: ; preds = %24
ret void
}

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