#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 */
scalar_t__ PN5180A_loadRFConfig(int, int);
scalar_t__ PN5180A_setRF_on();
int /*<<< orphan*/ PN5180A_writeRegisterWithAndMask(int, int);
int /*<<< orphan*/ PN5180A_writeRegisterWithOrMask(int, int);
bool PN5180A_setupRF() {
  if (PN5180A_loadRFConfig(0x0d, 0x8d)) {
    ;
  } else
    return false;
  if (PN5180A_setRF_on()) {
    ;
  } else
    return false;
  PN5180A_writeRegisterWithAndMask((0x00), 0xfffffff8);
  PN5180A_writeRegisterWithOrMask((0x00), 0x00000003);
  return true;
}


x86 assembly (clang, -O0):
<PN5180A_setupRF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xd,%edi
mov    $0x8d,%esi
call   1040 <PN5180A_loadRFConfig@plt>
cmp    $0x0,%rax
je     1166 <PN5180A_setupRF+0x26>
jmp    1172 <PN5180A_setupRF+0x32>
movl   $0x0,-0x4(%rbp)
jmp    11b3 <PN5180A_setupRF+0x73>
mov    $0x0,%al
call   1030 <PN5180A_setRF_on@plt>
cmp    $0x0,%rax
je     1188 <PN5180A_setupRF+0x48>
jmp    1194 <PN5180A_setupRF+0x54>
movl   $0x0,-0x4(%rbp)
jmp    11b3 <PN5180A_setupRF+0x73>
xor    %edi,%edi
mov    $0xfffffff8,%esi
call   1060 <PN5180A_writeRegisterWithAndMask@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1050 <PN5180A_writeRegisterWithOrMask@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PN5180A_setupRF>:
push   %rbx
mov    $0xd,%edi
mov    $0x8d,%esi
call   1040 <PN5180A_loadRFConfig@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1180 <PN5180A_setupRF+0x40>
xor    %eax,%eax
call   1030 <PN5180A_setRF_on@plt>
test   %rax,%rax
je     1180 <PN5180A_setupRF+0x40>
xor    %edi,%edi
mov    $0xfffffff8,%esi
call   1060 <PN5180A_writeRegisterWithAndMask@plt>
xor    %edi,%edi
mov    $0x3,%esi
call   1050 <PN5180A_writeRegisterWithOrMask@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @PN5180A_setupRF() {
%1 = alloca i32
%2 = call i64 @PN5180A_loadRFConfig(i32 13, i32 141)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %14
6: ; preds = %4
%7 = call i64 (...) @PN5180A_setRF_on()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %11
10: ; preds = %6
store i32 0, i32* %1
br label %14
11: ; preds = %9
%12 = call i32 @PN5180A_writeRegisterWithAndMask(i32 0, i32 -8)
%13 = call i32 @PN5180A_writeRegisterWithOrMask(i32 0, i32 3)
store i32 1, i32* %1
br label %14
14: ; preds = %11, %10, %5
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @PN5180A_setupRF() {
%1 = tail call i64 @PN5180A_loadRFConfig(i32 13, i32 141)
%2 = icmp eq i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i64 (...) @PN5180A_setRF_on()
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @PN5180A_writeRegisterWithAndMask(i32 0, i32 -8)
%8 = tail call i32 @PN5180A_writeRegisterWithOrMask(i32 0, i32 3)
br label %9
9: ; preds = %3, %0, %6
%10 = phi i32 [ 1, %6 ], [ 0, %0 ], [ 0, %3 ]
ret i32 %10
}