#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);
void UARTModemControlSet(unsigned long ulBase, unsigned long ulControl) {
  unsigned long ulTemp;
  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);
  DEBUG_ASSERT((ulControl & ~(0x00000800 | 0x00000400)) == 0);
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000030)));
  ulTemp |= (ulControl & (0x00000800 | 0x00000400));
  (*((volatile unsigned long *)(ulBase + 0x00000030))) = ulTemp;
}


x86 assembly (clang, -O0):
<UARTModemControlSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%rcx
and    $0x70000000,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     119c <UARTModemControlSet+0x8c>
mov    $0x400fe000,%eax
mov    (%rax),%rcx
and    $0x70ff0000,%rcx
xor    %eax,%eax
cmp    $0x10000000,%rcx
mov    %al,-0x19(%rbp)
je     119c <UARTModemControlSet+0x8c>
mov    $0x400fe000,%eax
mov    (%rax),%rcx
and    $0x70ff0000,%rcx
xor    %eax,%eax
cmp    $0x10010000,%rcx
mov    %al,-0x19(%rbp)
je     119c <UARTModemControlSet+0x8c>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10030000,%rax
sete   %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%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    -0x10(%rbp),%rax
and    $0xfffffffffffff3ff,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0xc00,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
testq  $0x70000000,0x400fe000
je     116a <UARTModemControlSet+0x5a>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10000000,%eax
je     116a <UARTModemControlSet+0x5a>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10010000,%eax
je     116a <UARTModemControlSet+0x5a>
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,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xfffffffffffff3ff,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
and    $0xc00,%ebx
or     %rbx,0x30(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @UARTModemControlSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%7 = and i64 %6, 1879048192
%8 = icmp eq i64 %7, 0
br i1 %8, label %22, label %9
9: ; preds = %2
%10 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%11 = and i64 %10, 1895759872
%12 = icmp eq i64 %11, 268435456
br i1 %12, label %22, 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, 268500992
br i1 %16, label %22, 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, 268632064
%21 = xor i1 %20, true
br label %22
22: ; preds = %17, %13, %9, %2
%23 = phi i1 [ false, %13 ], [ false, %9 ], [ false, %2 ], [ %21, %17 ]
%24 = zext i1 %23 to i32
%25 = call i32 @DEBUG_ASSERT(i32 %24)
%26 = load i64, i64* %3
%27 = icmp eq i64 %26, 1073795072
%28 = zext i1 %27 to i32
%29 = call i32 @DEBUG_ASSERT(i32 %28)
%30 = load i64, i64* %4
%31 = and i64 %30, -3073
%32 = icmp eq i64 %31, 0
%33 = zext i1 %32 to i32
%34 = call i32 @DEBUG_ASSERT(i32 %33)
%35 = load i64, i64* %3
%36 = add i64 %35, 48
%37 = inttoptr i64 %36 to i64*
%38 = load volatile i64, i64* %37
store i64 %38, i64* %5
%39 = load i64, i64* %4
%40 = and i64 %39, 3072
%41 = load i64, i64* %5
%42 = or i64 %41, %40
store i64 %42, i64* %5
%43 = load i64, i64* %5
%44 = load i64, i64* %3
%45 = add i64 %44, 48
%46 = inttoptr i64 %45 to i64*
store volatile i64 %43, i64* %46
ret void
}

LLVM IR (-O2):
define void @UARTModemControlSet(i64 %0, i64 %1) {
%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 = %2
%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 ne i64 %16, 268632064
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %14, %10, %6, %2
%20 = phi i32 [ 0, %10 ], [ 0, %6 ], [ 0, %2 ], [ %18, %14 ]
%21 = tail call i32 @DEBUG_ASSERT(i32 %20)
%22 = icmp eq i64 %0, 1073795072
%23 = zext i1 %22 to i32
%24 = tail call i32 @DEBUG_ASSERT(i32 %23)
%25 = and i64 %1, -3073
%26 = icmp eq i64 %25, 0
%27 = zext i1 %26 to i32
%28 = tail call i32 @DEBUG_ASSERT(i32 %27)
%29 = add i64 %0, 48
%30 = inttoptr i64 %29 to i64*
%31 = load volatile i64, i64* %30
%32 = and i64 %1, 3072
%33 = or i64 %31, %32
store volatile i64 %33, i64* %30
ret void
}