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

/* Variables and functions */
unsigned int edc_partial_computeblock(int /*<<< orphan*/, unsigned char const *,
                                      unsigned short);
void edc_computeblock(const unsigned char *src, unsigned short size,
                      unsigned char *dest) {
  unsigned edc = edc_partial_computeblock(0, src, size);
  dest[0] = (edc >> 0) & 0xFF;
  dest[1] = (edc >> 8) & 0xFF;
  dest[2] = (edc >> 16) & 0xFF;
  dest[3] = (edc >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<edc_computeblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
movzwl -0xa(%rbp),%edx
call   1030 <edc_partial_computeblock@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
shr    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1c(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x1c(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x1c(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edc_computeblock>:
push   %rbx
mov    %rdx,%rbx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
call   1030 <edc_partial_computeblock@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @edc_computeblock(i8* %0, i16 zeroext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i16, i16* %5
%10 = call i32 @edc_partial_computeblock(i32 0, i8* %8, i16 zeroext %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = lshr i32 %11, 0
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 %14, i8* %16
%17 = load i32, i32* %7
%18 = lshr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %6
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i32, i32* %7
%24 = lshr i32 %23, 16
%25 = and i32 %24, 255
%26 = trunc i32 %25 to i8
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i64 2
store i8 %26, i8* %28
%29 = load i32, i32* %7
%30 = lshr i32 %29, 24
%31 = and i32 %30, 255
%32 = trunc i32 %31 to i8
%33 = load i8*, i8** %6
%34 = getelementptr inbounds i8, i8* %33, i64 3
store i8 %32, i8* %34
ret void
}

LLVM IR (-O2):
define void @edc_computeblock(i8* %0, i16 zeroext %1, i8* nocapture writeonly %2) {
%4 = tail call i32 @edc_partial_computeblock(i32 0, i8* %0, i16 zeroext %1)
%5 = trunc i32 %4 to i8
store i8 %5, i8* %2
%6 = lshr i32 %4, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %2, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %4, 16
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %2, i64 2
store i8 %10, i8* %11
%12 = lshr i32 %4, 24
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds i8, i8* %2, i64 3
store i8 %13, i8* %14
ret void
}