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

/* Variables and functions */
int /*<<< orphan*/ toUint32(int, int, int, int);
int /*<<< orphan*/ toUint8(int *, int *, int *, int *, int /*<<< orphan*/);
void functionR(uint32_t *buf) {
  uint8_t s[8] = {0x00};
  toUint8(s + 0, s + 1, s + 2, s + 3, buf[0]);
  toUint8(s + 4, s + 5, s + 6, s + 7, buf[1]);
  buf[0] = toUint32(s[4], s[5], s[2], s[3]);
  buf[1] = toUint32(s[0], s[1], s[6], s[7]);
}


x86 assembly (clang, -O0):
<functionR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x4,%rsi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
lea    -0x30(%rbp),%rcx
add    $0xc,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%r8d
call   1040 <toUint8@plt>
lea    -0x30(%rbp),%rdi
add    $0x10,%rdi
lea    -0x30(%rbp),%rsi
add    $0x14,%rsi
lea    -0x30(%rbp),%rdx
add    $0x18,%rdx
lea    -0x30(%rbp),%rcx
add    $0x1c,%rcx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r8d
call   1040 <toUint8@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1050 <toUint32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1050 <toUint32@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<functionR>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r14
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    (%rdi),%r8d
mov    %rsp,%rdi
call   1030 <toUint8@plt>
lea    0x14(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x1c(%rsp),%rcx
mov    0x4(%rbx),%r8d
mov    %r14,%rdi
call   1030 <toUint8@plt>
mov    0x10(%rsp),%edi
mov    0x14(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
call   1040 <toUint32@plt>
mov    %eax,(%rbx)
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
mov    0x18(%rsp),%edx
mov    0x1c(%rsp),%ecx
call   1040 <toUint32@plt>
mov    %eax,0x4(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @functionR(i32* %0) {
%2 = alloca i32*
%3 = alloca [8 x i32]
store i32* %0, i32** %2
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 0
%15 = load i32, i32* %14
%16 = call i32 @toUint8(i32* %6, i32* %8, i32* %10, i32* %12, i32 %15)
%17 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%18 = getelementptr inbounds i32, i32* %17, i64 4
%19 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%20 = getelementptr inbounds i32, i32* %19, i64 5
%21 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%22 = getelementptr inbounds i32, i32* %21, i64 6
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%24 = getelementptr inbounds i32, i32* %23, i64 7
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 1
%27 = load i32, i32* %26
%28 = call i32 @toUint8(i32* %18, i32* %20, i32* %22, i32* %24, i32 %27)
%29 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 4
%30 = load i32, i32* %29
%31 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 5
%32 = load i32, i32* %31
%33 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 2
%34 = load i32, i32* %33
%35 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 3
%36 = load i32, i32* %35
%37 = call i32 @toUint32(i32 %30, i32 %32, i32 %34, i32 %36)
%38 = load i32*, i32** %2
%39 = getelementptr inbounds i32, i32* %38, i64 0
store i32 %37, i32* %39
%40 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%41 = load i32, i32* %40
%42 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 1
%43 = load i32, i32* %42
%44 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 6
%45 = load i32, i32* %44
%46 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 7
%47 = load i32, i32* %46
%48 = call i32 @toUint32(i32 %41, i32 %43, i32 %45, i32 %47)
%49 = load i32*, i32** %2
%50 = getelementptr inbounds i32, i32* %49, i64 1
store i32 %48, i32* %50
ret void
}

LLVM IR (-O2):
define void @functionR(i32* nocapture %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 1
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 2
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 3
%8 = load i32, i32* %0
%9 = call i32 @toUint8(i32* %4, i32* %5, i32* %6, i32* %7, i32 %8)
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 4
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 5
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 6
%13 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 7
%14 = getelementptr inbounds i32, i32* %0, i64 1
%15 = load i32, i32* %14
%16 = call i32 @toUint8(i32* %10, i32* %11, i32* %12, i32* %13, i32 %15)
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = call i32 @toUint32(i32 %17, i32 %18, i32 %19, i32 %20)
store i32 %21, i32* %0
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = load i32, i32* %12
%25 = load i32, i32* %13
%26 = call i32 @toUint32(i32 %22, i32 %23, i32 %24, i32 %25)
store i32 %26, i32* %14
ret void
}