#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*/ nRF24L01P_setRegister(int, int);
int /*<<< orphan*/ printf(char *, int);
void nRF24L01P_setTransferSize(int size, int pipe) {
  int rxPwPxRegister;
  if ((pipe < 0) || (pipe > 5)) {
    printf("nRF24L01P: Invalid Transfer Size pipe number %d\r\n", pipe);
    return;
  }
  if ((size < 0) || (size > 32)) {
    printf("nRF24L01P: Invalid Transfer Size setting %d\r\n", size);
    return;
  }
  rxPwPxRegister = 0x11 + (pipe - 0);
  nRF24L01P_setRegister(rxPwPxRegister, (size & 0x3F));
}


x86 assembly (clang, -O0):
<nRF24L01P_setTransferSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1142 <nRF24L01P_setTransferSize+0x22>
cmpl   $0x5,-0x8(%rbp)
jle    1156 <nRF24L01P_setTransferSize+0x36>
mov    -0x8(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
jmp    1198 <nRF24L01P_setTransferSize+0x78>
cmpl   $0x0,-0x4(%rbp)
jl     116a <nRF24L01P_setTransferSize+0x4a>
cmpl   $0x20,-0x4(%rbp)
jle    117e <nRF24L01P_setTransferSize+0x5e>
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
jmp    1198 <nRF24L01P_setTransferSize+0x78>
mov    -0x8(%rbp),%eax
sub    $0x0,%eax
add    $0x11,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
and    $0x3f,%esi
call   1040 <nRF24L01P_setRegister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nRF24L01P_setTransferSize>:
cmp    $0x6,%esi
jb     1131 <nRF24L01P_setTransferSize+0x11>
lea    0xed4(%rip),%rdi
jmp    1030 <printf@plt>
mov    %edi,%eax
cmp    $0x21,%edi
jb     1146 <nRF24L01P_setTransferSize+0x26>
lea    0xef3(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>
add    $0x11,%esi
mov    %esi,%edi
mov    %eax,%esi
jmp    1040 <nRF24L01P_setRegister@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"nRF24L01P: Invalid Transfer Size pipe number %d\0D\0A\00"
@.str.1 = [46 x i8] c"nRF24L01P: Invalid Transfer Size setting %d\0D\0A\00"
define void @nRF24L01P_setTransferSize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 5
br i1 %10, label %11, label %14
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %31
14: ; preds = %8
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 32
br i1 %19, label %20, label %23
20: ; preds = %17, %14
%21 = load i32, i32* %3
%22 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %31
23: ; preds = %17
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 0
%26 = add nsw i32 17, %25
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = load i32, i32* %3
%29 = and i32 %28, 63
%30 = call i32 @nRF24L01P_setRegister(i32 %27, i32 %29)
br label %31
31: ; preds = %23, %20, %11
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"nRF24L01P: Invalid Transfer Size pipe number %d\0D\0A\00"
@.str.1 = [46 x i8] c"nRF24L01P: Invalid Transfer Size setting %d\0D\0A\00"
define void @nRF24L01P_setTransferSize(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 5
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %13
6: ; preds = %2
%7 = icmp ugt i32 %0, 32
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %13
10: ; preds = %6
%11 = add nuw nsw i32 %1, 17
%12 = tail call i32 @nRF24L01P_setRegister(i32 %11, i32 %0)
br label %13
13: ; preds = %10, %8, %4
ret void
}