#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 */
int /*<<< orphan*/ bits(int, int, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned short);
void cc2400_rxbpftst(unsigned short v) {
  char description[64];
  bits(15, 15, "-", "W0", "");
  bits(14, 14, "RXBPF_CAP_OE", "RW", "");
  sprintf(description, "%d", (v >> 7) & 0x7F);
  bits(13, 7, "RXBPF_CAP_O", "RW", description);
  sprintf(description, "%d", v & 0x7F);
  bits(6, 0, "RXBPF_CAP_RES", "RW", description);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xf,%esi
lea    0xec5(%rip),%rdx
lea    0xec0(%rip),%rcx
lea    0xeb8(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
mov    $0xe,%esi
lea    0xea9(%rip),%rdx
lea    0xeaf(%rip),%rcx
lea    0xe97(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
lea    -0x50(%rbp),%rdi
movzwl -0x2(%rbp),%eax
sar    $0x7,%eax
and    $0x7f,%eax
lea    0xe8f(%rip),%rsi
movzwl %ax,%edx
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0xd,%edi
mov    $0x7,%esi
lea    0xe75(%rip),%rdx
lea    0xe68(%rip),%rcx
call   1030 <bits@plt>
lea    -0x50(%rbp),%rdi
movzwl -0x2(%rbp),%eax
and    $0x7f,%eax
lea    0xe54(%rip),%rsi
movzwl %ax,%edx
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0x6,%edi
xor    %esi,%esi
lea    0xe49(%rip),%rdx
lea    0xe30(%rip),%rcx
call   1030 <bits@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %edi,%ebx
lea    0xecc(%rip),%rdx
lea    0xec7(%rip),%rcx
lea    0xebf(%rip),%r15
mov    $0xf,%edi
mov    $0xf,%esi
mov    %r15,%r8
call   1030 <bits@plt>
lea    0xeaa(%rip),%rdx
lea    0xeb0(%rip),%r14
mov    $0xe,%edi
mov    $0xe,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <bits@plt>
mov    %ebx,%edx
shr    $0x7,%edx
and    $0x7f,%edx
lea    0xe8f(%rip),%r12
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <sprintf@plt>
lea    0xe7d(%rip),%rdx
mov    $0xd,%edi
mov    $0x7,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <bits@plt>
and    $0x7f,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1040 <sprintf@plt>
lea    0xe5d(%rip),%rdx
mov    $0x6,%edi
xor    %esi,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <bits@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [3 x i8] c"W0\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [13 x i8] c"RXBPF_CAP_OE\00"
@.str.4 = [3 x i8] c"RW\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [12 x i8] c"RXBPF_CAP_O\00"
@.str.7 = [14 x i8] c"RXBPF_CAP_RES\00"
define void @cc2400_rxbpftst(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [64 x i8]
store i16 %0, i16* %2
%4 = call i32 @bits(i32 15, i32 15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @bits(i32 14, i32 14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 7
%10 = and i32 %9, 127
%11 = trunc i32 %10 to i16
%12 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i16 zeroext %11)
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%14 = call i32 @bits(i32 13, i32 7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%16 = load i16, i16* %2
%17 = zext i16 %16 to i32
%18 = and i32 %17, 127
%19 = trunc i32 %18 to i16
%20 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i16 zeroext %19)
%21 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%22 = call i32 @bits(i32 6, i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@.str.1 = [3 x i8] c"W0\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [13 x i8] c"RXBPF_CAP_OE\00"
@.str.4 = [3 x i8] c"RW\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [12 x i8] c"RXBPF_CAP_O\00"
@.str.7 = [14 x i8] c"RXBPF_CAP_RES\00"
define void @cc2400_rxbpftst(i16 zeroext %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @bits(i32 15, i32 15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @bits(i32 14, i32 14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%6 = lshr i16 %0, 7
%7 = and i16 %6, 127
%8 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i16 zeroext %7)
%9 = call i32 @bits(i32 13, i32 7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%10 = and i16 %0, 127
%11 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i16 zeroext %10)
%12 = call i32 @bits(i32 6, i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %3)
ret void
}