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

/* Variables and functions */
int /*<<< orphan*/ byteswap32(int /*<<< orphan*/);
void __attribute__((unused)) byteswap_digest(uint32_t *p) {
  unsigned int i;
  for (i = 0; i < 4; i++) {
    byteswap32(p++);
    byteswap32(p++);
    byteswap32(p++);
    byteswap32(p++);
  }
}


x86 assembly (clang, -O0):
<byteswap_digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jae    1193 <byteswap_digest+0x83>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%edi
call   1030 <byteswap32@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%edi
call   1030 <byteswap32@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%edi
call   1030 <byteswap32@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    %eax,%edi
call   1030 <byteswap32@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <byteswap_digest+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteswap_digest>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0x4(%rdi),%ebp
call   1030 <byteswap32@plt>
lea    0x8(%rbx),%r14d
mov    %ebp,%edi
call   1030 <byteswap32@plt>
lea    0xc(%rbx),%ebp
mov    %r14d,%edi
call   1030 <byteswap32@plt>
lea    0x10(%rbx),%r14d
mov    %ebp,%edi
call   1030 <byteswap32@plt>
lea    0x14(%rbx),%ebp
mov    %r14d,%edi
call   1030 <byteswap32@plt>
lea    0x18(%rbx),%r14d
mov    %ebp,%edi
call   1030 <byteswap32@plt>
lea    0x1c(%rbx),%ebp
mov    %r14d,%edi
call   1030 <byteswap32@plt>
lea    0x20(%rbx),%r14d
mov    %ebp,%edi
call   1030 <byteswap32@plt>
lea    0x24(%rbx),%ebp
mov    %r14d,%edi
call   1030 <byteswap32@plt>
lea    0x28(%rbx),%r14d
mov    %ebp,%edi
call   1030 <byteswap32@plt>
lea    0x2c(%rbx),%ebp
mov    %r14d,%edi
call   1030 <byteswap32@plt>
lea    0x30(%rbx),%r14d
mov    %ebp,%edi
call   1030 <byteswap32@plt>
lea    0x34(%rbx),%ebp
mov    %r14d,%edi
call   1030 <byteswap32@plt>
lea    0x38(%rbx),%r14d
mov    %ebp,%edi
call   1030 <byteswap32@plt>
add    $0x3c,%ebx
mov    %r14d,%edi
call   1030 <byteswap32@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <byteswap32@plt>

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

LLVM IR (-O2):
define void @byteswap_digest(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @byteswap32(i32 %4)
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = ptrtoint i32* %2 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @byteswap32(i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = ptrtoint i32* %6 to i64
%12 = trunc i64 %11 to i32
%13 = tail call i32 @byteswap32(i32 %12)
%14 = getelementptr inbounds i32, i32* %0, i64 4
%15 = ptrtoint i32* %10 to i64
%16 = trunc i64 %15 to i32
%17 = tail call i32 @byteswap32(i32 %16)
%18 = getelementptr inbounds i32, i32* %0, i64 5
%19 = ptrtoint i32* %14 to i64
%20 = trunc i64 %19 to i32
%21 = tail call i32 @byteswap32(i32 %20)
%22 = getelementptr inbounds i32, i32* %0, i64 6
%23 = ptrtoint i32* %18 to i64
%24 = trunc i64 %23 to i32
%25 = tail call i32 @byteswap32(i32 %24)
%26 = getelementptr inbounds i32, i32* %0, i64 7
%27 = ptrtoint i32* %22 to i64
%28 = trunc i64 %27 to i32
%29 = tail call i32 @byteswap32(i32 %28)
%30 = getelementptr inbounds i32, i32* %0, i64 8
%31 = ptrtoint i32* %26 to i64
%32 = trunc i64 %31 to i32
%33 = tail call i32 @byteswap32(i32 %32)
%34 = getelementptr inbounds i32, i32* %0, i64 9
%35 = ptrtoint i32* %30 to i64
%36 = trunc i64 %35 to i32
%37 = tail call i32 @byteswap32(i32 %36)
%38 = getelementptr inbounds i32, i32* %0, i64 10
%39 = ptrtoint i32* %34 to i64
%40 = trunc i64 %39 to i32
%41 = tail call i32 @byteswap32(i32 %40)
%42 = getelementptr inbounds i32, i32* %0, i64 11
%43 = ptrtoint i32* %38 to i64
%44 = trunc i64 %43 to i32
%45 = tail call i32 @byteswap32(i32 %44)
%46 = getelementptr inbounds i32, i32* %0, i64 12
%47 = ptrtoint i32* %42 to i64
%48 = trunc i64 %47 to i32
%49 = tail call i32 @byteswap32(i32 %48)
%50 = getelementptr inbounds i32, i32* %0, i64 13
%51 = ptrtoint i32* %46 to i64
%52 = trunc i64 %51 to i32
%53 = tail call i32 @byteswap32(i32 %52)
%54 = getelementptr inbounds i32, i32* %0, i64 14
%55 = ptrtoint i32* %50 to i64
%56 = trunc i64 %55 to i32
%57 = tail call i32 @byteswap32(i32 %56)
%58 = getelementptr inbounds i32, i32* %0, i64 15
%59 = ptrtoint i32* %54 to i64
%60 = trunc i64 %59 to i32
%61 = tail call i32 @byteswap32(i32 %60)
%62 = ptrtoint i32* %58 to i64
%63 = trunc i64 %62 to i32
%64 = tail call i32 @byteswap32(i32 %63)
ret void
}