#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*/ printf(char *, ...);
void nrf_display_status(char Status) {
  printf("*** STATUS REGISTER ***\n");
  printf(" RX_DR   : %d\n", (Status & 0x40) >> 6);
  printf(" TX_DS   : %d\n", (Status & 0x20) >> 5);
  printf(" MAX_RT  : %d\n", (Status & 0x10) >> 4);
  if (((Status & (0x08 | 0x04 | 0x02)) >> 1) == 7)
    printf(" RX_P_NO : EMPTY\n");
  else
    printf(" RX_P_NO : %d\n", (Status & (0x08 | 0x04 | 0x02)) >> 1);
  printf(" TX_FULL : %d\n", (Status & 0x01));
  printf("***********************\n");
}


x86 assembly (clang, -O0):
<nrf_display_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
and    $0x40,%esi
sar    $0x6,%esi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
and    $0x20,%esi
sar    $0x5,%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
and    $0x10,%esi
sar    $0x4,%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
and    $0xe,%eax
sar    $0x1,%eax
cmp    $0x7,%eax
jne    119a <nrf_display_status+0x8a>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <nrf_display_status+0xa2>
movsbl -0x1(%rbp),%esi
and    $0xe,%esi
sar    $0x1,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%esi
and    $0x1,%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_display_status>:
push   %rbx
mov    %edi,%ebx
lea    0xf21(%rip),%rdi
call   1030 <puts@plt>
movzbl %bl,%ebx
mov    %ebx,%esi
shr    $0x6,%esi
and    $0x1,%esi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    $0x5,%esi
and    $0x1,%esi
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    $0x4,%esi
and    $0x1,%esi
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%esi
shr    %esi
and    $0x7,%esi
cmp    $0x7,%esi
jne    118e <nrf_display_status+0x6e>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
jmp    119c <nrf_display_status+0x7c>
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
and    $0x1,%ebx
lea    0xe96(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"*** STATUS REGISTER ***\0A\00"
@.str.1 = [15 x i8] c" RX_DR : %d\0A\00"
@.str.2 = [15 x i8] c" TX_DS : %d\0A\00"
@.str.3 = [15 x i8] c" MAX_RT : %d\0A\00"
@.str.4 = [18 x i8] c" RX_P_NO : EMPTY\0A\00"
@.str.5 = [15 x i8] c" RX_P_NO : %d\0A\00"
@.str.6 = [15 x i8] c" TX_FULL : %d\0A\00"
@.str.7 = [25 x i8] c"***********************\0A\00"
define void @nrf_display_status(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = and i32 %5, 64
%7 = ashr i32 %6, 6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = and i32 %10, 32
%12 = ashr i32 %11, 5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = and i32 %15, 16
%17 = ashr i32 %16, 4
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = and i32 %20, 14
%22 = ashr i32 %21, 1
%23 = icmp eq i32 %22, 7
br i1 %23, label %24, label %26
24: ; preds = %1
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %32
26: ; preds = %1
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = and i32 %28, 14
%30 = ashr i32 %29, 1
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %26, %24
%33 = load i8, i8* %2
%34 = sext i8 %33 to i32
%35 = and i32 %34, 1
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c" RX_DR : %d\0A\00"
@.str.2 = [15 x i8] c" TX_DS : %d\0A\00"
@.str.3 = [15 x i8] c" MAX_RT : %d\0A\00"
@.str.5 = [15 x i8] c" RX_P_NO : %d\0A\00"
@.str.6 = [15 x i8] c" TX_FULL : %d\0A\00"
@str = [24 x i8] c"*** STATUS REGISTER ***\00"
@str.8 = [24 x i8] c"***********************\00"
@str.9 = [17 x i8] c" RX_P_NO : EMPTY\00"
define void @nrf_display_status(i8 signext %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = zext i8 %0 to i32
%4 = lshr i32 %3, 6
%5 = and i32 %4, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = lshr i32 %3, 5
%8 = and i32 %7, 1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = lshr i32 %3, 4
%11 = and i32 %10, 1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = lshr i32 %3, 1
%14 = and i32 %13, 7
%15 = icmp eq i32 %14, 7
br i1 %15, label %16, label %18
16: ; preds = %1
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.9, i64 0, i64 0))
br label %20
18: ; preds = %1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %14)
br label %20
20: ; preds = %18, %16
%21 = and i32 %3, 1
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %21)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.8, i64 0, i64 0))
ret void
}