#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*/ DEBUG_ASSERT(int);
unsigned long UARTModemStatusGet(unsigned long ulBase) {
  DEBUG_ASSERT(!((((*((volatile unsigned long *)(0x400FE000))) & 0x70000000) ==
                  0x00000000) ||
                 (((*((volatile unsigned long *)(0x400FE000))) &
                   (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00000000))) &&
               !(((*((volatile unsigned long *)(0x400FE000))) &
                  (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00010000)) &&
               !(((*((volatile unsigned long *)(0x400FE000))) &
                  (0x70000000 | 0x00FF0000)) == (0x10000000 | 0x00030000)));
  DEBUG_ASSERT(ulBase == 0x4000D000);
  return ((*((volatile unsigned long *)(ulBase + 0x00000018))) &
          (0x00000100 | 0x00000004 | 0x00000001 | 0x00000002));
}


x86 assembly (clang, -O0):
<UARTModemStatusGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%rcx
and    $0x70000000,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1198 <UARTModemStatusGet+0x88>
mov    $0x400fe000,%eax
mov    (%rax),%rcx
and    $0x70ff0000,%rcx
xor    %eax,%eax
cmp    $0x10000000,%rcx
mov    %al,-0x9(%rbp)
je     1198 <UARTModemStatusGet+0x88>
mov    $0x400fe000,%eax
mov    (%rax),%rcx
and    $0x70ff0000,%rcx
xor    %eax,%eax
cmp    $0x10010000,%rcx
mov    %al,-0x9(%rbp)
je     1198 <UARTModemStatusGet+0x88>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10030000,%rax
sete   %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x4000d000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x107,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemStatusGet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
testq  $0x70000000,0x400fe000
je     1164 <UARTModemStatusGet+0x54>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10000000,%eax
je     1164 <UARTModemStatusGet+0x54>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10010000,%eax
je     1164 <UARTModemStatusGet+0x54>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
xor    %edi,%edi
cmp    $0x10030000,%eax
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x4000d000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x18(%rbx),%rax
and    $0x107,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @UARTModemStatusGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%4 = and i64 %3, 1879048192
%5 = icmp eq i64 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %1
%7 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%8 = and i64 %7, 1895759872
%9 = icmp eq i64 %8, 268435456
br i1 %9, label %19, label %10
10: ; preds = %6
%11 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%12 = and i64 %11, 1895759872
%13 = icmp eq i64 %12, 268500992
br i1 %13, label %19, label %14
14: ; preds = %10
%15 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%16 = and i64 %15, 1895759872
%17 = icmp eq i64 %16, 268632064
%18 = xor i1 %17, true
br label %19
19: ; preds = %14, %10, %6, %1
%20 = phi i1 [ false, %10 ], [ false, %6 ], [ false, %1 ], [ %18, %14 ]
%21 = zext i1 %20 to i32
%22 = call i32 @DEBUG_ASSERT(i32 %21)
%23 = load i64, i64* %2
%24 = icmp eq i64 %23, 1073795072
%25 = zext i1 %24 to i32
%26 = call i32 @DEBUG_ASSERT(i32 %25)
%27 = load i64, i64* %2
%28 = add i64 %27, 24
%29 = inttoptr i64 %28 to i64*
%30 = load volatile i64, i64* %29
%31 = and i64 %30, 263
ret i64 %31
}

LLVM IR (-O2):
define i64 @UARTModemStatusGet(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 %18, 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 %18, 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 %18, label %13
13: ; preds = %9
%14 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%15 = and i64 %14, 1895759872
%16 = icmp ne i64 %15, 268632064
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %13, %9, %5, %1
%19 = phi i32 [ 0, %9 ], [ 0, %5 ], [ 0, %1 ], [ %17, %13 ]
%20 = tail call i32 @DEBUG_ASSERT(i32 %19)
%21 = icmp eq i64 %0, 1073795072
%22 = zext i1 %21 to i32
%23 = tail call i32 @DEBUG_ASSERT(i32 %22)
%24 = add i64 %0, 24
%25 = inttoptr i64 %24 to i64*
%26 = load volatile i64, i64* %25
%27 = and i64 %26, 263
ret i64 %27
}