#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*/ nios_pkt_32x32_unpack(int const *, int *, int *,
                                         int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ *);
void nios_pkt_32x32_resp_unpack(const uint8_t *buf, uint8_t *target,
                                bool *write, uint32_t *addr, uint32_t *data,
                                bool *success) {
  nios_pkt_32x32_unpack(buf, target, write, addr, data);
  if ((buf[2] & (1 << 1)) != 0) {
    *success = true;
  } else {
    *success = false;
  }
}


x86 assembly (clang, -O0):
<nios_pkt_32x32_resp_unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <nios_pkt_32x32_unpack@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     116b <nios_pkt_32x32_resp_unpack+0x5b>
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
jmp    1175 <nios_pkt_32x32_resp_unpack+0x65>
mov    -0x30(%rbp),%rax
movl   $0x0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_pkt_32x32_resp_unpack>:
push   %r14
push   %rbx
push   %rax
mov    %r9,%r14
mov    %rdi,%rbx
call   1030 <nios_pkt_32x32_unpack@plt>
mov    0x8(%rbx),%eax
shr    %eax
and    $0x1,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @nios_pkt_32x32_resp_unpack(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* nocapture writeonly %5) {
%7 = tail call i32 @nios_pkt_32x32_unpack(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4)
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = lshr i32 %9, 1
%11 = and i32 %10, 1
store i32 %11, i32* %5
ret void
}