#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_fstst0(unsigned short v) {
  char description[64];
  char *rxmixbuf[] = {"690uA", "980uA", "1.16mA", "1.44mA"};
  bits(15, 14, "RXMIXBUF_CUR", "RW", rxmixbuf[(v >> 14) & 3]);
  bits(13, 12, "TXMIXBUF_CUR", "RW", rxmixbuf[(v >> 12) & 3]);
  bits(11, 11, "VCO_ARRAY_SETTLE_LONG", "RW", "");
  bits(10, 10, "VCO_ARRAY_OE", "RW", "");
  sprintf(description, "%d", (v >> 5) & 0xF);
  bits(9, 5, "VCO_ARRAY_O", "RW", description);
  sprintf(description, "%d", v & 0xF);
  bits(4, 0, "VCO_ARRAY_RES", "RO", description);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    0x2cca(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0x2cc7(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0x2cc4(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0x2cc1(%rip),%rax
mov    %rax,-0x58(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0xe,%eax
and    $0x3,%eax
cltq
mov    -0x70(%rbp,%rax,8),%r8
mov    $0xf,%edi
mov    $0xe,%esi
lea    0xe9d(%rip),%rdx
lea    0xea3(%rip),%rcx
call   1030 <bits@plt>
movzwl -0x2(%rbp),%eax
sar    $0xc,%eax
and    $0x3,%eax
cltq
mov    -0x70(%rbp,%rax,8),%r8
mov    $0xd,%edi
mov    $0xc,%esi
lea    0xe7f(%rip),%rdx
lea    0xe75(%rip),%rcx
call   1030 <bits@plt>
mov    $0xb,%esi
lea    0xe74(%rip),%rdx
lea    0xe5d(%rip),%rcx
lea    0xe48(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
mov    $0xa,%esi
lea    0xe69(%rip),%rdx
lea    0xe3c(%rip),%rcx
lea    0xe27(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
lea    -0x50(%rbp),%rdi
movzwl -0x2(%rbp),%eax
sar    $0x5,%eax
and    $0xf,%eax
lea    0xe4c(%rip),%rsi
movzwl %ax,%edx
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0x9,%edi
mov    $0x5,%esi
lea    0xe32(%rip),%rdx
lea    0xdf5(%rip),%rcx
call   1030 <bits@plt>
lea    -0x50(%rbp),%rdi
movzwl -0x2(%rbp),%eax
and    $0xf,%eax
lea    0xe11(%rip),%rsi
movzwl %ax,%edx
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0x4,%edi
xor    %esi,%esi
lea    0xe06(%rip),%rdx
lea    0xe0d(%rip),%rcx
call   1030 <bits@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %edi,%ebx
mov    %edi,%eax
shr    $0xb,%eax
and    $0xfffffff8,%eax
lea    0x2cc4(%rip),%r15
mov    (%rax,%r15,1),%r8
lea    0xed3(%rip),%rdx
lea    0xed9(%rip),%r14
mov    $0xf,%edi
mov    $0xe,%esi
mov    %r14,%rcx
call   1030 <bits@plt>
mov    %ebx,%eax
shr    $0xc,%eax
and    $0x3,%eax
mov    (%r15,%rax,8),%r8
lea    0xeb7(%rip),%rdx
mov    $0xd,%edi
mov    $0xc,%esi
mov    %r14,%rcx
call   1030 <bits@plt>
lea    0xeab(%rip),%rdx
lea    0xe86(%rip),%r15
mov    $0xb,%edi
mov    $0xb,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <bits@plt>
lea    0xe9e(%rip),%rdx
mov    $0xa,%edi
mov    $0xa,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <bits@plt>
mov    %ebx,%edx
shr    $0x5,%edx
and    $0xf,%edx
lea    0xe87(%rip),%r12
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <sprintf@plt>
lea    0xe75(%rip),%rdx
mov    $0x9,%edi
mov    $0x5,%esi
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <bits@plt>
and    $0xf,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1040 <sprintf@plt>
lea    0xe55(%rip),%rdx
lea    0xe5c(%rip),%rcx
mov    $0x4,%edi
xor    %esi,%esi
mov    %r15,%r8
call   1030 <bits@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"690uA\00"
@.str.1 = [6 x i8] c"980uA\00"
@.str.2 = [7 x i8] c"1.16mA\00"
@.str.3 = [7 x i8] c"1.44mA\00"
@__const.cc2400_fstst0.rxmixbuf = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [13 x i8] c"RXMIXBUF_CUR\00"
@.str.5 = [3 x i8] c"RW\00"
@.str.6 = [13 x i8] c"TXMIXBUF_CUR\00"
@.str.7 = [22 x i8] c"VCO_ARRAY_SETTLE_LONG\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [13 x i8] c"VCO_ARRAY_OE\00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [12 x i8] c"VCO_ARRAY_O\00"
@.str.12 = [14 x i8] c"VCO_ARRAY_RES\00"
@.str.13 = [3 x i8] c"RO\00"
define void @cc2400_fstst0(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [64 x i8]
%4 = alloca [4 x i8*]
store i16 %0, i16* %2
%5 = bitcast [4 x i8*]* %4 to i8*
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 14
%9 = and i32 %8, 3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 %10
%12 = load i8*, i8** %11
%13 = call i32 @bits(i32 15, i32 14, 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.5, i64 0, i64 0), i8* %12)
%14 = load i16, i16* %2
%15 = zext i16 %14 to i32
%16 = ashr i32 %15, 12
%17 = and i32 %16, 3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @bits(i32 13, i32 12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %20)
%22 = call i32 @bits(i32 11, i32 11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
%23 = call i32 @bits(i32 10, i32 10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%25 = load i16, i16* %2
%26 = zext i16 %25 to i32
%27 = ashr i32 %26, 5
%28 = and i32 %27, 15
%29 = trunc i32 %28 to i16
%30 = call i32 @sprintf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i16 zeroext %29)
%31 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%32 = call i32 @bits(i32 9, i32 5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %31)
%33 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%34 = load i16, i16* %2
%35 = zext i16 %34 to i32
%36 = and i32 %35, 15
%37 = trunc i32 %36 to i16
%38 = call i32 @sprintf(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i16 zeroext %37)
%39 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%40 = call i32 @bits(i32 4, i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %39)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"690uA\00"
@.str.1 = [6 x i8] c"980uA\00"
@.str.2 = [7 x i8] c"1.16mA\00"
@.str.3 = [7 x i8] c"1.44mA\00"
@__const.cc2400_fstst0.rxmixbuf = [4 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [13 x i8] c"RXMIXBUF_CUR\00"
@.str.5 = [3 x i8] c"RW\00"
@.str.6 = [13 x i8] c"TXMIXBUF_CUR\00"
@.str.7 = [22 x i8] c"VCO_ARRAY_SETTLE_LONG\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [13 x i8] c"VCO_ARRAY_OE\00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [12 x i8] c"VCO_ARRAY_O\00"
@.str.12 = [14 x i8] c"VCO_ARRAY_RES\00"
@.str.13 = [3 x i8] c"RO\00"
define void @cc2400_fstst0(i16 zeroext %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = zext i16 %0 to i32
%5 = lshr i32 %4, 14
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* @__const.cc2400_fstst0.rxmixbuf, i64 0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i32 @bits(i32 15, i32 14, 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.5, i64 0, i64 0), i8* %8)
%10 = lshr i32 %4, 12
%11 = and i32 %10, 3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [4 x i8*], [4 x i8*]* @__const.cc2400_fstst0.rxmixbuf, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i32 @bits(i32 13, i32 12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %14)
%16 = tail call i32 @bits(i32 11, i32 11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
%17 = tail call i32 @bits(i32 10, i32 10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
%18 = lshr i16 %0, 5
%19 = and i16 %18, 15
%20 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i16 zeroext %19)
%21 = call i32 @bits(i32 9, i32 5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%22 = and i16 %0, 15
%23 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i16 zeroext %22)
%24 = call i32 @bits(i32 4, i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i8* %3)
ret void
}