#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 *, short);
void cc2400_frequest(unsigned short v) {
  char description[64];
  sprintf(description, "%d", ((signed short)v) >> 8);
  bits(15, 8, "RX_FREQ_OFFSET", "RO", description);
  bits(7, 0, "-", "W0", "");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x50(%rbp),%rdi
movswl -0x2(%rbp),%eax
sar    $0x8,%eax
lea    0xebf(%rip),%rsi
movswl %ax,%edx
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0xf,%edi
mov    $0x8,%esi
lea    0xea5(%rip),%rdx
lea    0xead(%rip),%rcx
call   1030 <bits@plt>
mov    $0x7,%edi
xor    %esi,%esi
lea    0xe9d(%rip),%rdx
lea    0xe98(%rip),%rcx
lea    0xe90(%rip),%r8
call   1030 <bits@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
sub    $0x40,%rsp
movswl %di,%edx
sar    $0x8,%edx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xebf(%rip),%rdx
lea    0xec7(%rip),%rcx
mov    $0xf,%edi
mov    $0x8,%esi
mov    %rbx,%r8
call   1030 <bits@plt>
lea    0xeb1(%rip),%rdx
lea    0xeac(%rip),%rcx
lea    0xea4(%rip),%r8
mov    $0x7,%edi
xor    %esi,%esi
call   1030 <bits@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"RX_FREQ_OFFSET\00"
@.str.2 = [3 x i8] c"RO\00"
@.str.3 = [2 x i8] c"-\00"
@.str.4 = [3 x i8] c"W0\00"
@.str.5 = [1 x i8] zeroinitializer
define void @cc2400_frequest(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [64 x i8]
store i16 %0, i16* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i16
%9 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %8)
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%11 = call i32 @bits(i32 15, i32 8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = call i32 @bits(i32 7, i32 0, 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.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [15 x i8] c"RX_FREQ_OFFSET\00"
@.str.2 = [3 x i8] c"RO\00"
@.str.3 = [2 x i8] c"-\00"
@.str.4 = [3 x i8] c"W0\00"
@.str.5 = [1 x i8] zeroinitializer
define void @cc2400_frequest(i16 zeroext %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = ashr i16 %0, 8
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i16 signext %4)
%6 = call i32 @bits(i32 15, i32 8, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%7 = call i32 @bits(i32 7, i32 0, 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.5, i64 0, i64 0))
ret void
}