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

/* Variables and functions */
int /*<<< orphan*/ fd_binary_unpack_uint64(int /*<<< orphan*/ *);
int /*<<< orphan*/ fd_nrf8001_error();
int /*<<< orphan*/ fd_nrf8001_pipe_status_event(int /*<<< orphan*/,
                                                int /*<<< orphan*/);
void fd_nrf8001_decode_pipe_status_event(uint8_t *buffer, uint32_t length) {
  if (length != 17) {
    fd_nrf8001_error();
    return;
  }
  uint64_t pipes_open = fd_binary_unpack_uint64(&buffer[1]);
  uint64_t pipes_closed = fd_binary_unpack_uint64(&buffer[9]);
  fd_nrf8001_pipe_status_event(pipes_open, pipes_closed);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x11,-0xc(%rbp)
je     1155 <fd_nrf8001_decode_pipe_status_event+0x25>
mov    $0x0,%al
call   1030 <fd_nrf8001_error@plt>
jmp    1180 <fd_nrf8001_decode_pipe_status_event+0x50>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1050 <fd_binary_unpack_uint64@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x24,%rdi
call   1050 <fd_binary_unpack_uint64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <fd_nrf8001_pipe_status_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    $0x11,%esi
jne    1161 <fd_nrf8001_decode_pipe_status_event+0x31>
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x4,%rdi
call   1050 <fd_binary_unpack_uint64@plt>
mov    %eax,%ebp
add    $0x24,%rbx
mov    %rbx,%rdi
call   1050 <fd_binary_unpack_uint64@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fd_nrf8001_pipe_status_event@plt>
xor    %eax,%eax
jmp    1030 <fd_nrf8001_error@plt>

LLVM IR (-O0):
define void @fd_nrf8001_decode_pipe_status_event(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 17
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @fd_nrf8001_error()
br label %21
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = call i32 @fd_binary_unpack_uint64(i32* %13)
store i32 %14, i32* %5
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 9
%17 = call i32 @fd_binary_unpack_uint64(i32* %16)
store i32 %17, i32* %6
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i32 @fd_nrf8001_pipe_status_event(i32 %18, i32 %19)
br label %21
21: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @fd_nrf8001_decode_pipe_status_event(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 17
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @fd_nrf8001_error()
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = tail call i32 @fd_binary_unpack_uint64(i32* %7)
%9 = getelementptr inbounds i32, i32* %0, i64 9
%10 = tail call i32 @fd_binary_unpack_uint64(i32* %9)
%11 = tail call i32 @fd_nrf8001_pipe_status_event(i32 %8, i32 %10)
br label %12
12: ; preds = %6, %4
ret void
}