unsigned long USBNumEndpointsGet(unsigned long ulBase) {
  if (((((*((volatile unsigned long *)(0x400FE000))) & 0x70000000) ==
        0x00000000) ||
       (((*((volatile unsigned long *)(0x400FE000))) &
         (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00000000))) ||
      (((*((volatile unsigned long *)(0x400FE000))) &
        (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00010000))) {
    return (0);
  } else if ((((*((volatile unsigned long *)(0x400FE000))) &
               (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00030000))) {
    return (3);
  } else if ((((*((volatile unsigned long *)(0x400FE000))) &
               (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00040000)) ||
             (((*((volatile unsigned long *)(0x400FE000))) &
               (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00060000))) {
    return (15);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<USBNumEndpointsGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70000000,%rax
cmp    $0x0,%rax
je     1154 <USBNumEndpointsGet+0x54>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10000000,%rax
je     1154 <USBNumEndpointsGet+0x54>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10010000,%rax
jne    1161 <USBNumEndpointsGet+0x61>
movq   $0x0,-0x8(%rbp)
jmp    11d1 <USBNumEndpointsGet+0xd1>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10030000,%rax
jne    1188 <USBNumEndpointsGet+0x88>
movq   $0x3,-0x8(%rbp)
jmp    11d1 <USBNumEndpointsGet+0xd1>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10040000,%rax
je     11bc <USBNumEndpointsGet+0xbc>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10060000,%rax
jne    11c9 <USBNumEndpointsGet+0xc9>
movq   $0xf,-0x8(%rbp)
jmp    11d1 <USBNumEndpointsGet+0xd1>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBNumEndpointsGet>:
testq  $0x70000000,0x400fe000
je     1136 <USBNumEndpointsGet+0x36>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10000000,%eax
je     1136 <USBNumEndpointsGet+0x36>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10010000,%eax
jne    1139 <USBNumEndpointsGet+0x39>
xor    %eax,%eax
ret
mov    0x400fe000,%rcx
40
and    $0x70ff0000,%ecx
mov    $0x3,%eax
cmp    $0x10030000,%ecx
je     118c <USBNumEndpointsGet+0x8c>
mov    0x400fe000,%rcx
40
and    $0x70ff0000,%ecx
mov    $0xf,%eax
cmp    $0x10040000,%ecx
je     118c <USBNumEndpointsGet+0x8c>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
xor    %ecx,%ecx
cmp    $0x10060000,%eax
mov    $0xf,%eax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
define i64 @USBNumEndpointsGet(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%5 = and i64 %4, 1879048192
%6 = icmp eq i64 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%9 = and i64 %8, 1895759872
%10 = icmp eq i64 %9, 268435456
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%13 = and i64 %12, 1895759872
%14 = icmp eq i64 %13, 268500992
br i1 %14, label %15, label %16
15: ; preds = %11, %7, %1
store i64 0, i64* %2
br label %31
16: ; preds = %11
%17 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%18 = and i64 %17, 1895759872
%19 = icmp eq i64 %18, 268632064
br i1 %19, label %20, label %21
20: ; preds = %16
store i64 3, i64* %2
br label %31
21: ; preds = %16
%22 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%23 = and i64 %22, 1895759872
%24 = icmp eq i64 %23, 268697600
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%27 = and i64 %26, 1895759872
%28 = icmp eq i64 %27, 268828672
br i1 %28, label %29, label %30
29: ; preds = %25, %21
store i64 15, i64* %2
br label %31
30: ; preds = %25
store i64 0, i64* %2
br label %31
31: ; preds = %30, %29, %20, %15
%32 = load i64, i64* %2
ret i64 %32
}

LLVM IR (-O2):
define i64 @USBNumEndpointsGet(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%3 = and i64 %2, 1879048192
%4 = icmp eq i64 %3, 0
br i1 %4, label %26, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%7 = and i64 %6, 1895759872
%8 = icmp eq i64 %7, 268435456
br i1 %8, label %26, label %9
9: ; preds = %5
%10 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%11 = and i64 %10, 1895759872
%12 = icmp eq i64 %11, 268500992
br i1 %12, label %26, label %13
13: ; preds = %9
%14 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%15 = and i64 %14, 1895759872
%16 = icmp eq i64 %15, 268632064
br i1 %16, label %26, label %17
17: ; preds = %13
%18 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%19 = and i64 %18, 1895759872
%20 = icmp eq i64 %19, 268697600
br i1 %20, label %26, label %21
21: ; preds = %17
%22 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%23 = and i64 %22, 1895759872
%24 = icmp eq i64 %23, 268828672
%25 = select i1 %24, i64 15, i64 0
br label %26
26: ; preds = %21, %17, %13, %1, %5, %9
%27 = phi i64 [ 0, %9 ], [ 0, %5 ], [ 0, %1 ], [ 3, %13 ], [ 15, %17 ], [ %25, %21 ]
ret i64 %27
}