#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 nRF24L01P_getRegister(int);
int /*<<< orphan*/ nRF24L01P_setRegister(int, int);
int /*<<< orphan*/ printf(char *, int);
void nRF24L01P_enableAutoAcknowledge(int pipe) {
  int enAA;
  if ((pipe < 0) || (pipe > 5)) {
    printf("nRF24L01P: Invalid Enable AutoAcknowledge pipe number %d\r\n",
           pipe);
    return;
  }
  enAA = nRF24L01P_getRegister(0x01);
  enAA |= (1 << (pipe - 0));
  nRF24L01P_setRegister(0x01, enAA);
}


x86 assembly (clang, -O0):
<nRF24L01P_enableAutoAcknowledge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     114f <nRF24L01P_enableAutoAcknowledge+0x1f>
cmpl   $0x5,-0x4(%rbp)
jle    1163 <nRF24L01P_enableAutoAcknowledge+0x33>
mov    -0x4(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1190 <nRF24L01P_enableAutoAcknowledge+0x60>
mov    $0x1,%edi
call   1050 <nRF24L01P_getRegister@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
sub    $0x0,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
call   1040 <nRF24L01P_setRegister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nRF24L01P_enableAutoAcknowledge>:
push   %rbx
mov    %edi,%ebx
cmp    $0x6,%edi
jb     1147 <nRF24L01P_enableAutoAcknowledge+0x17>
lea    0xec1(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>
mov    $0x1,%edi
call   1050 <nRF24L01P_getRegister@plt>
bts    %ebx,%eax
mov    $0x1,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <nRF24L01P_setRegister@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"nRF24L01P: Invalid Enable AutoAcknowledge pipe number %d\0D\0A\00"
define void @nRF24L01P_enableAutoAcknowledge(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 5
br i1 %8, label %9, label %12
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %21
12: ; preds = %6
%13 = call i32 @nRF24L01P_getRegister(i32 1)
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = sub nsw i32 %14, 0
%16 = shl i32 1, %15
%17 = load i32, i32* %3
%18 = or i32 %17, %16
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = call i32 @nRF24L01P_setRegister(i32 1, i32 %19)
br label %21
21: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"nRF24L01P: Invalid Enable AutoAcknowledge pipe number %d\0D\0A\00"
define void @nRF24L01P_enableAutoAcknowledge(i32 %0) {
%2 = icmp ugt i32 %0, 5
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
5: ; preds = %1
%6 = tail call i32 @nRF24L01P_getRegister(i32 1)
%7 = shl nuw nsw i32 1, %0
%8 = or i32 %6, %7
%9 = tail call i32 @nRF24L01P_setRegister(i32 1, i32 %8)
br label %10
10: ; preds = %5, %3
ret void
}