#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*/ BBBIO_sys_pinmux_check(int, int, int);
int BBBIO_McSPI_EP_check(unsigned int McSPI_ID) {
  unsigned int ret = 1;
  if (McSPI_ID == 1) {
    if (!BBBIO_sys_pinmux_check(9, 19, ((0x7) | (0x4) << 8)) &&
        !BBBIO_sys_pinmux_check(9, 20, ((0x7) | (0x4) << 8)) &&
        !BBBIO_sys_pinmux_check(9, 28, ((0x7) | (0x3) << 8)) &&
        !BBBIO_sys_pinmux_check(9, 42, ((0x7) | (0x2) << 8))) {
      ret = 0;
    }
    if (!BBBIO_sys_pinmux_check(9, 29, ((0x7) | (0x3) << 8)) &&
        !BBBIO_sys_pinmux_check(9, 30, ((0x7) | (0x3) << 8)) &&
        !BBBIO_sys_pinmux_check(9, 31, ((0x7) | (0x3) << 8)) &&
        !BBBIO_sys_pinmux_check(9, 42, ((0x7) | (0x4) << 8))) {
      ret = 0;
    }
  } else {
    if (!BBBIO_sys_pinmux_check(9, 17, ((0x7) | (0x0) << 8))) {
      ret = 0;
    }
    if (!BBBIO_sys_pinmux_check(9, 18, ((0x7) | (0x0) << 8)) &&
        !BBBIO_sys_pinmux_check(9, 21, ((0x7) | (0x0) << 8)) &&
        !BBBIO_sys_pinmux_check(9, 22, ((0x7) | (0x0) << 8))) {
      ret = 0;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<BBBIO_McSPI_EP_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1227 <BBBIO_McSPI_EP_check+0x117>
mov    $0x9,%edi
mov    $0x13,%esi
mov    $0x407,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    11a7 <BBBIO_McSPI_EP_check+0x97>
mov    $0x9,%edi
mov    $0x14,%esi
mov    $0x407,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    11a7 <BBBIO_McSPI_EP_check+0x97>
mov    $0x9,%edi
mov    $0x1c,%esi
mov    $0x307,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    11a7 <BBBIO_McSPI_EP_check+0x97>
mov    $0x9,%edi
mov    $0x2a,%esi
mov    $0x207,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    11a7 <BBBIO_McSPI_EP_check+0x97>
movl   $0x0,-0x8(%rbp)
mov    $0x9,%edi
mov    $0x1d,%esi
mov    $0x307,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    1222 <BBBIO_McSPI_EP_check+0x112>
mov    $0x9,%edi
mov    $0x1e,%esi
mov    $0x307,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    1222 <BBBIO_McSPI_EP_check+0x112>
mov    $0x9,%edi
mov    $0x1f,%esi
mov    $0x307,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    1222 <BBBIO_McSPI_EP_check+0x112>
mov    $0x9,%edi
mov    $0x2a,%esi
mov    $0x407,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    1222 <BBBIO_McSPI_EP_check+0x112>
movl   $0x0,-0x8(%rbp)
jmp    12ae <BBBIO_McSPI_EP_check+0x19e>
mov    $0x9,%edi
mov    $0x11,%esi
mov    $0x7,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    124b <BBBIO_McSPI_EP_check+0x13b>
movl   $0x0,-0x8(%rbp)
mov    $0x9,%edi
mov    $0x12,%esi
mov    $0x7,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    12a9 <BBBIO_McSPI_EP_check+0x199>
mov    $0x9,%edi
mov    $0x15,%esi
mov    $0x7,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    12a9 <BBBIO_McSPI_EP_check+0x199>
mov    $0x9,%edi
mov    $0x16,%esi
mov    $0x7,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
cmp    $0x0,%eax
jne    12a9 <BBBIO_McSPI_EP_check+0x199>
movl   $0x0,-0x8(%rbp)
jmp    12ae <BBBIO_McSPI_EP_check+0x19e>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BBBIO_McSPI_EP_check>:
push   %rbx
cmp    $0x1,%edi
jne    11e3 <BBBIO_McSPI_EP_check+0xd3>
mov    $0x9,%edi
mov    $0x13,%esi
mov    $0x407,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
mov    $0x1,%ebx
test   %eax,%eax
jne    1182 <BBBIO_McSPI_EP_check+0x72>
mov    $0x9,%edi
mov    $0x14,%esi
mov    $0x407,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
test   %eax,%eax
jne    1182 <BBBIO_McSPI_EP_check+0x72>
mov    $0x9,%edi
mov    $0x1c,%esi
mov    $0x307,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
test   %eax,%eax
jne    1182 <BBBIO_McSPI_EP_check+0x72>
mov    $0x9,%edi
mov    $0x2a,%esi
mov    $0x207,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    $0x9,%edi
mov    $0x1d,%esi
mov    $0x307,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
test   %eax,%eax
jne    1247 <BBBIO_McSPI_EP_check+0x137>
mov    $0x9,%edi
mov    $0x1e,%esi
mov    $0x307,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
test   %eax,%eax
jne    1247 <BBBIO_McSPI_EP_check+0x137>
mov    $0x9,%edi
mov    $0x1f,%esi
mov    $0x307,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
test   %eax,%eax
jne    1247 <BBBIO_McSPI_EP_check+0x137>
mov    $0x9,%edi
mov    $0x2a,%esi
mov    $0x407,%edx
jmp    123d <BBBIO_McSPI_EP_check+0x12d>
mov    $0x9,%edi
mov    $0x11,%esi
mov    $0x7,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    $0x9,%edi
mov    $0x12,%esi
mov    $0x7,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
test   %eax,%eax
jne    1247 <BBBIO_McSPI_EP_check+0x137>
mov    $0x9,%edi
mov    $0x15,%esi
mov    $0x7,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
test   %eax,%eax
jne    1247 <BBBIO_McSPI_EP_check+0x137>
mov    $0x9,%edi
mov    $0x16,%esi
mov    $0x7,%edx
call   1030 <BBBIO_sys_pinmux_check@plt>
test   %eax,%eax
cmove  %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @BBBIO_McSPI_EP_check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %33
6: ; preds = %1
%7 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 19, i32 1031)
%8 = icmp ne i32 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %6
%10 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 20, i32 1031)
%11 = icmp ne i32 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %9
%13 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 28, i32 775)
%14 = icmp ne i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 42, i32 519)
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %15
store i32 0, i32* %3
br label %19
19: ; preds = %18, %15, %12, %9, %6
%20 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 29, i32 775)
%21 = icmp ne i32 %20, 0
br i1 %21, label %32, label %22
22: ; preds = %19
%23 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 30, i32 775)
%24 = icmp ne i32 %23, 0
br i1 %24, label %32, label %25
25: ; preds = %22
%26 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 31, i32 775)
%27 = icmp ne i32 %26, 0
br i1 %27, label %32, label %28
28: ; preds = %25
%29 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 42, i32 1031)
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %28
store i32 0, i32* %3
br label %32
32: ; preds = %31, %28, %25, %22, %19
br label %48
33: ; preds = %1
%34 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 17, i32 7)
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %33
store i32 0, i32* %3
br label %37
37: ; preds = %36, %33
%38 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 18, i32 7)
%39 = icmp ne i32 %38, 0
br i1 %39, label %47, label %40
40: ; preds = %37
%41 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 21, i32 7)
%42 = icmp ne i32 %41, 0
br i1 %42, label %47, label %43
43: ; preds = %40
%44 = call i32 @BBBIO_sys_pinmux_check(i32 9, i32 22, i32 7)
%45 = icmp ne i32 %44, 0
br i1 %45, label %47, label %46
46: ; preds = %43
store i32 0, i32* %3
br label %47
47: ; preds = %46, %43, %40, %37
br label %48
48: ; preds = %47, %32
%49 = load i32, i32* %3
ret i32 %49
}

LLVM IR (-O2):
define i32 @BBBIO_McSPI_EP_check(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %30
3: ; preds = %1
%4 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 19, i32 1031)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 20, i32 1031)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 28, i32 775)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 42, i32 519)
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %12, %9, %6, %3
%17 = phi i32 [ 1, %3 ], [ 1, %6 ], [ 1, %9 ], [ %15, %12 ]
%18 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 29, i32 775)
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %43
20: ; preds = %16
%21 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 30, i32 775)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %43
23: ; preds = %20
%24 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 31, i32 775)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %43
26: ; preds = %23
%27 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 42, i32 1031)
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32 0, i32 %17
br label %43
30: ; preds = %1
%31 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 17, i32 7)
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i32
%34 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 18, i32 7)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %43
36: ; preds = %30
%37 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 21, i32 7)
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = tail call i32 @BBBIO_sys_pinmux_check(i32 9, i32 22, i32 7)
%41 = icmp eq i32 %40, 0
%42 = select i1 %41, i32 0, i32 %33
br label %43
43: ; preds = %39, %26, %30, %36, %16, %20, %23
%44 = phi i32 [ %17, %16 ], [ %17, %20 ], [ %17, %23 ], [ %33, %30 ], [ %33, %36 ], [ %29, %26 ], [ %42, %39 ]
ret i32 %44
}