#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*/ uint16_t;
typedef int /*<<< orphan*/ temp;
typedef scalar_t__ int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(scalar_t__ *, int /*<<< orphan*/ const *,
                                       int);
void inv_fifo_protocol_helper_decode_raw_data(const void *in, uint16_t len,
                                              int32_t *x, int32_t *y,
                                              int32_t *z) {
  const uint8_t *rcvbuf = (const uint8_t *)in;
  int16_t temp[3];
  FifoProtocol_memcpy((&temp[0]), (&rcvbuf[0]), (sizeof(temp[0])));
  FifoProtocol_memcpy((&temp[1]), (&rcvbuf[2]), (sizeof(temp[1])));
  FifoProtocol_memcpy((&temp[2]), (&rcvbuf[4]), (sizeof(temp[2])));
  *x = (int32_t)temp[0];
  *y = (int32_t)temp[1];
  *z = (int32_t)temp[2];
  (void)len;
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_raw_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
lea    -0x50(%rbp),%rdi
add    $0x8,%rdi
mov    -0x30(%rbp),%rsi
add    $0x8,%rsi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
lea    -0x50(%rbp),%rdi
add    $0x10,%rdi
mov    -0x30(%rbp),%rsi
add    $0x10,%rsi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    -0x50(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x48(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x40(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_raw_data>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
lea    0x8(%rsp),%rdi
lea    0x8(%rbx),%rsi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
lea    0x10(%rsp),%rdi
add    $0x10,%rbx
mov    %rbx,%rsi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    (%rsp),%rax
mov    %rax,(%r12)
mov    0x8(%rsp),%rax
mov    %rax,(%r15)
mov    0x10(%rsp),%rax
mov    %rax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @inv_fifo_protocol_helper_decode_raw_data(i8* %0, i32 %1, i64* %2, i64* %3, i64* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i64*
%9 = alloca i64*
%10 = alloca i64*
%11 = alloca i32*
%12 = alloca [3 x i64]
store i8* %0, i8** %6
store i32 %1, i32* %7
store i64* %2, i64** %8
store i64* %3, i64** %9
store i64* %4, i64** %10
%13 = load i8*, i8** %6
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %11
%15 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 0
%16 = load i32*, i32** %11
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = call i32 @FifoProtocol_memcpy(i64* %15, i32* %17, i32 8)
%19 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 1
%20 = load i32*, i32** %11
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = call i32 @FifoProtocol_memcpy(i64* %19, i32* %21, i32 8)
%23 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 2
%24 = load i32*, i32** %11
%25 = getelementptr inbounds i32, i32* %24, i64 4
%26 = call i32 @FifoProtocol_memcpy(i64* %23, i32* %25, i32 8)
%27 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 0
%28 = load i64, i64* %27
%29 = load i64*, i64** %8
store i64 %28, i64* %29
%30 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 1
%31 = load i64, i64* %30
%32 = load i64*, i64** %9
store i64 %31, i64* %32
%33 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 0, i64 2
%34 = load i64, i64* %33
%35 = load i64*, i64** %10
store i64 %34, i64* %35
%36 = load i32, i32* %7
ret void
}

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