#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 uint64_t;

/* Variables and functions */
void nios_pkt_retune_resp_unpack(const uint8_t *buf, uint64_t *duration,
                                 uint8_t *vcocap, uint8_t *flags) {
  *duration = buf[1 + 0];
  *duration |= ((uint64_t)buf[1 + 1]) << 8;
  *duration |= ((uint64_t)buf[1 + 2]) << 16;
  *duration |= ((uint64_t)buf[1 + 3]) << 24;
  *duration |= ((uint64_t)buf[1 + 4]) << 32;
  *duration |= ((uint64_t)buf[1 + 5]) << 40;
  *duration |= ((uint64_t)buf[1 + 6]) << 48;
  *duration |= ((uint64_t)buf[1 + 7]) << 56;
  *vcocap = buf[9];
  *flags = buf[10];
}


x86 assembly (clang, -O0):
<nios_pkt_retune_resp_unpack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
shl    $0x8,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
shl    $0x10,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
shl    $0x18,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
mov    $0x28,%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
mov    $0x30,%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_pkt_retune_resp_unpack>:
mov    0x24(%rdi),%eax
mov    %eax,(%rdx)
mov    0x28(%rdi),%eax
mov    %eax,(%rcx)
ret

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

LLVM IR (-O2):
define void @nios_pkt_retune_resp_unpack(i32* nocapture %0, i32* nocapture readnone %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = getelementptr inbounds i32, i32* %0, i64 9
%6 = load i32, i32* %5
store i32 %6, i32* %2
%7 = getelementptr inbounds i32, i32* %0, i64 10
%8 = load i32, i32* %7
store i32 %8, i32* %3
ret void
}