#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) {
  size_t i;
  for (i = 0; i < len / 4; i++)
    libcperciva_be32enc(dst + i * 4, src[i]);
}


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)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
shr    $0x2,%rcx
cmp    %rcx,%rax
jae    1175 <be32enc_vect+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <libcperciva_be32enc@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <be32enc_vect+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be32enc_vect>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x4,%rdx
jb     1149 <be32enc_vect+0x39>
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%r12
shr    $0x2,%r15
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r14,%rbx,4),%esi
mov    %r12,%rdi
call   1030 <libcperciva_be32enc@plt>
add    $0x1,%rbx
add    $0x10,%r12
cmp    %rbx,%r15
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
%7 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %23, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = udiv i64 %10, 4
%12 = icmp ult i64 %9, %11
br i1 %12, label %13, label %26
13: ; preds = %8
%14 = load i32*, i32** %4
%15 = load i64, i64* %7
%16 = mul i64 %15, 4
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32*, i32** %5
%19 = load i64, i64* %7
%20 = getelementptr inbounds i32, i32* %18, i64 %19
%21 = load i32, i32* %20
%22 = call i32 @libcperciva_be32enc(i32* %17, i32 %21)
br label %23
23: ; preds = %13
%24 = load i64, i64* %7
%25 = add i64 %24, 1
store i64 %25, i64* %7
br label %8
26: ; preds = %8
ret void
}

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