#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 */

/* Variables and functions */
scalar_t__ ccnl_ccnb_dehead(unsigned char **, int *, int *, int *);
int ccnb_isContent(unsigned char *buf, int len) {
  int num, typ;
  if (len < 0 || ccnl_ccnb_dehead(&buf, &len, &num, &typ))
    return -1;
  if (typ != 2 || num != 64)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<ccnb_isContent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1148 <ccnb_isContent+0x38>
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <ccnl_ccnb_dehead@plt>
cmp    $0x0,%rax
je     1154 <ccnb_isContent+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <ccnb_isContent+0x6b>
cmpl   $0x2,-0x1c(%rbp)
jne    1168 <ccnb_isContent+0x58>
cmpl   $0x40,-0x18(%rbp)
je     1174 <ccnb_isContent+0x64>
movl   $0x0,-0x4(%rbp)
jmp    117b <ccnb_isContent+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccnb_isContent>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,0x18(%rsp)
mov    %esi,0x14(%rsp)
mov    $0xffffffff,%ebx
test   %esi,%esi
js     115a <ccnb_isContent+0x4a>
lea    0x18(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <ccnl_ccnb_dehead@plt>
test   %rax,%rax
jne    115a <ccnb_isContent+0x4a>
mov    0xc(%rsp),%eax
xor    $0x2,%eax
mov    0x10(%rsp),%ecx
xor    $0x40,%ecx
xor    %ebx,%ebx
or     %eax,%ecx
sete   %bl
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ccnb_isContent(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = call i64 @ccnl_ccnb_dehead(i8** %4, i32* %5, i32* %6, i32* %7)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10, %2
store i32 -1, i32* %3
br label %22
14: ; preds = %10
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 2
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 64
br i1 %19, label %20, label %21
20: ; preds = %17, %14
store i32 0, i32* %3
br label %22
21: ; preds = %17
store i32 1, i32* %3
br label %22
22: ; preds = %21, %20, %13
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @ccnb_isContent(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = bitcast i32* %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = icmp slt i32 %1, 0
br i1 %9, label %20, label %10
10: ; preds = %2
%11 = call i64 @ccnl_ccnb_dehead(i8** %3, i32* %4, i32* %5, i32* %6)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 2
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 64
%18 = select i1 %15, i1 %17, i1 false
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %13, %2, %10
%21 = phi i32 [ -1, %10 ], [ -1, %2 ], [ %19, %13 ]
ret i32 %21
}