#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_int(unsigned short v) {
  char description[64];
  bits(15, 8, "-", "W0", "");
  bits(7, 7, "-", "RW", "");
  bits(6, 6, "PKT_POLARITY", "RW", "");
  bits(5, 5, "FIFO_POLARITY", "RW", "");
  sprintf(description, "%d", v & 0x1F);
  bits(4, 0, "FIFO_THRESHOLD", "RW", description);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xf,%edi
mov    $0x8,%esi
lea    0xec0(%rip),%rdx
lea    0xebb(%rip),%rcx
lea    0xeb3(%rip),%r8
call   1030 <bits@plt>
mov    $0x7,%esi
lea    0xea1(%rip),%rdx
lea    0xe9f(%rip),%rcx
lea    0xe94(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
mov    $0x6,%esi
lea    0xe88(%rip),%rdx
lea    0xe7e(%rip),%rcx
lea    0xe73(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
mov    $0x5,%esi
lea    0xe74(%rip),%rdx
lea    0xe5d(%rip),%rcx
lea    0xe52(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
lea    -0x50(%rbp),%rdi
movzwl -0x2(%rbp),%eax
and    $0x1f,%eax
lea    0xe5b(%rip),%rsi
movzwl %ax,%edx
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0x4,%edi
xor    %esi,%esi
lea    0xe44(%rip),%rdx
lea    0xe1c(%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),%r12
lea    0xec7(%rip),%rcx
lea    0xebf(%rip),%r15
mov    $0xf,%edi
mov    $0x8,%esi
mov    %r12,%rdx
mov    %r15,%r8
call   1030 <bits@plt>
lea    0xea7(%rip),%r14
mov    $0x7,%edi
mov    $0x7,%esi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <bits@plt>
lea    0xe8b(%rip),%rdx
mov    $0x6,%edi
mov    $0x6,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <bits@plt>
lea    0xe7c(%rip),%rdx
mov    $0x5,%edi
mov    $0x5,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <bits@plt>
and    $0x1f,%ebx
lea    0xe6b(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %ebx,%edx
call   1040 <sprintf@plt>
lea    0xe5a(%rip),%rdx
mov    $0x4,%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 = [3 x i8] c"RW\00"
@.str.4 = [13 x i8] c"PKT_POLARITY\00"
@.str.5 = [14 x i8] c"FIFO_POLARITY\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [15 x i8] c"FIFO_THRESHOLD\00"
define void @cc2400_int(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [64 x i8]
store i16 %0, i16* %2
%4 = call i32 @bits(i32 15, i32 8, 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 7, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @bits(i32 6, i32 6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @bits(i32 5, i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = and i32 %10, 31
%12 = trunc i32 %11 to i16
%13 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i16 zeroext %12)
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%15 = call i32 @bits(i32 4, i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %14)
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 = [3 x i8] c"RW\00"
@.str.4 = [13 x i8] c"PKT_POLARITY\00"
@.str.5 = [14 x i8] c"FIFO_POLARITY\00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [15 x i8] c"FIFO_THRESHOLD\00"
define void @cc2400_int(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 8, 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 7, i32 7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @bits(i32 6, i32 6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @bits(i32 5, i32 5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%8 = and i16 %0, 31
%9 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i16 zeroext %8)
%10 = call i32 @bits(i32 4, i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %3)
ret void
}