#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 *);
void cc2400_main(unsigned short v) {
  bits(15, 15, "RESETN", "RW", "");
  bits(14, 10, "-", "W0", "");
  bits(9, 9, "FS_FORCE_EN", "RW", "");
  bits(8, 8, "RXN_TX", "RW", (v & (1 << 8)) ? "TX" : "RX");
  bits(7, 4, "-", "W0", "");
  bits(3, 3, "-", "W0", "");
  bits(2, 2, "-", "W0", "");
  bits(1, 1, "XOSC16M_BYPASS", "RW", "");
  bits(0, 0, "XOSC16M_EN", "RW", "");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xf,%esi
lea    0xed5(%rip),%rdx
lea    0xed5(%rip),%rcx
lea    0xed2(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
mov    $0xe,%edi
mov    $0xa,%esi
lea    0xeb9(%rip),%rdx
lea    0xeb4(%rip),%rcx
lea    0xeac(%rip),%r8
call   1030 <bits@plt>
mov    $0x9,%esi
lea    0xe9f(%rip),%rdx
lea    0xe90(%rip),%rcx
lea    0xe8d(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
movzwl -0x2(%rbp),%ecx
and    $0x100,%ecx
lea    0xe8c(%rip),%r8
lea    0xe82(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%r8
mov    $0x8,%esi
lea    0xe6b(%rip),%rdx
lea    0xe50(%rip),%rcx
mov    %esi,%edi
call   1030 <bits@plt>
mov    $0x7,%edi
mov    $0x4,%esi
lea    0xe3b(%rip),%rdx
lea    0xe36(%rip),%rcx
lea    0xe2e(%rip),%r8
call   1030 <bits@plt>
mov    $0x3,%esi
lea    0xe1c(%rip),%rdx
lea    0xe17(%rip),%rcx
lea    0xe0f(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
mov    $0x2,%esi
lea    0xdfb(%rip),%rdx
lea    0xdf6(%rip),%rcx
lea    0xdee(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
mov    $0x1,%esi
lea    0xdf5(%rip),%rdx
lea    0xdd0(%rip),%rcx
lea    0xdcd(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
xor    %esi,%esi
lea    0xde6(%rip),%rdx
lea    0xdb2(%rip),%rcx
lea    0xdaf(%rip),%r8
mov    %esi,%edi
call   1030 <bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%ebp
lea    0xedf(%rip),%rdx
lea    0xedf(%rip),%r14
lea    0xedc(%rip),%rbx
mov    $0xf,%edi
mov    $0xf,%esi
mov    %r14,%rcx
mov    %rbx,%r8
call   1030 <bits@plt>
lea    0xebf(%rip),%r15
lea    0xeba(%rip),%r12
mov    $0xe,%edi
mov    $0xa,%esi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
call   1030 <bits@plt>
lea    0xe9e(%rip),%rdx
mov    $0x9,%edi
mov    $0x9,%esi
mov    %r14,%rcx
mov    %rbx,%r8
call   1030 <bits@plt>
test   $0x100,%ebp
lea    0xe8f(%rip),%rax
lea    0xe85(%rip),%r8
cmove  %rax,%r8
lea    0xe76(%rip),%rdx
mov    $0x8,%edi
mov    $0x8,%esi
mov    %r14,%rcx
call   1030 <bits@plt>
mov    $0x7,%edi
mov    $0x4,%esi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
call   1030 <bits@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
call   1030 <bits@plt>
mov    $0x2,%edi
mov    $0x2,%esi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
call   1030 <bits@plt>
lea    0xe1f(%rip),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
mov    %r14,%rcx
mov    %rbx,%r8
call   1030 <bits@plt>
lea    0xe12(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rcx
mov    %rbx,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <bits@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"RESETN\00"
@.str.1 = [3 x i8] c"RW\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"-\00"
@.str.4 = [3 x i8] c"W0\00"
@.str.5 = [12 x i8] c"FS_FORCE_EN\00"
@.str.6 = [7 x i8] c"RXN_TX\00"
@.str.7 = [3 x i8] c"TX\00"
@.str.8 = [3 x i8] c"RX\00"
@.str.9 = [15 x i8] c"XOSC16M_BYPASS\00"
@.str.10 = [11 x i8] c"XOSC16M_EN\00"
define void @cc2400_main(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call i32 @bits(i32 15, i32 15, i8* getelementptr inbounds ([7 x i8], [7 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))
%4 = call i32 @bits(i32 14, i32 10, i8* getelementptr inbounds ([2 x i8], [2 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))
%5 = call i32 @bits(i32 9, i32 9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, 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))
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = and i32 %7, 256
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0)
%12 = call i32 @bits(i32 8, i32 8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 @bits(i32 7, i32 4, i8* getelementptr inbounds ([2 x i8], [2 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))
%14 = call i32 @bits(i32 3, i32 3, i8* getelementptr inbounds ([2 x i8], [2 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))
%15 = call i32 @bits(i32 2, i32 2, i8* getelementptr inbounds ([2 x i8], [2 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))
%16 = call i32 @bits(i32 1, i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, 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))
%17 = call i32 @bits(i32 0, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, 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))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"RESETN\00"
@.str.1 = [3 x i8] c"RW\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"-\00"
@.str.4 = [3 x i8] c"W0\00"
@.str.5 = [12 x i8] c"FS_FORCE_EN\00"
@.str.6 = [7 x i8] c"RXN_TX\00"
@.str.7 = [3 x i8] c"TX\00"
@.str.8 = [3 x i8] c"RX\00"
@.str.9 = [15 x i8] c"XOSC16M_BYPASS\00"
@.str.10 = [11 x i8] c"XOSC16M_EN\00"
define void @cc2400_main(i16 zeroext %0) {
%2 = tail call i32 @bits(i32 15, i32 15, i8* getelementptr inbounds ([7 x i8], [7 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))
%3 = tail call i32 @bits(i32 14, i32 10, i8* getelementptr inbounds ([2 x i8], [2 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))
%4 = tail call i32 @bits(i32 9, i32 9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, 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 = and i16 %0, 256
%6 = icmp eq i16 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0)
%8 = tail call i32 @bits(i32 8, i32 8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = tail call i32 @bits(i32 7, i32 4, i8* getelementptr inbounds ([2 x i8], [2 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))
%10 = tail call i32 @bits(i32 3, i32 3, i8* getelementptr inbounds ([2 x i8], [2 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))
%11 = tail call i32 @bits(i32 2, i32 2, i8* getelementptr inbounds ([2 x i8], [2 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))
%12 = tail call i32 @bits(i32 1, i32 1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, 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))
%13 = tail call i32 @bits(i32 0, i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, 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))
ret void
}