#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);
int UARTBaseValid(unsigned long);
void UARTFlowControlSet(unsigned long ulBase, unsigned long ulMode) {
  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(UARTBaseValid(ulBase));
  DEBUG_ASSERT((ulMode & ~(0x00008000 | 0x00004000)) == 0);
  (*((volatile unsigned long *)(ulBase + 0x00000030))) =
      (((*((volatile unsigned long *)(ulBase + 0x00000030))) &
        ~(0x00008000 | 0x00004000)) |
       ulMode);
}


x86 assembly (clang, -O0):
<UARTFlowControlSet>:
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,-0x11(%rbp)
je     11ac <UARTFlowControlSet+0x8c>
mov    $0x400fe000,%eax
mov    (%rax),%rcx
and    $0x70ff0000,%rcx
xor    %eax,%eax
cmp    $0x10000000,%rcx
mov    %al,-0x11(%rbp)
je     11ac <UARTFlowControlSet+0x8c>
mov    $0x400fe000,%eax
mov    (%rax),%rcx
and    $0x70ff0000,%rcx
xor    %eax,%eax
cmp    $0x10010000,%rcx
mov    %al,-0x11(%rbp)
je     11ac <UARTFlowControlSet+0x8c>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10030000,%rax
sete   %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xffffffffffff3fff,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
and    $0xffffffffffff3fff,%rcx
or     -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x30(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFlowControlSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
testq  $0x70000000,0x400fe000
je     117a <UARTFlowControlSet+0x5a>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10000000,%eax
je     117a <UARTFlowControlSet+0x5a>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10010000,%eax
je     117a <UARTFlowControlSet+0x5a>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
xor    %edi,%edi
cmp    $0x10030000,%eax
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xffffffffffff3fff,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0xffffffffffff3fff,%rax
and    0x30(%rbx),%rax
or     %r14,%rax
mov    %rax,0x30(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @UARTFlowControlSet(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 = tail call i32 @UARTBaseValid(i64 %0)
%23 = tail call i32 @DEBUG_ASSERT(i32 %22)
%24 = and i64 %1, -49153
%25 = icmp eq i64 %24, 0
%26 = zext i1 %25 to i32
%27 = tail call i32 @DEBUG_ASSERT(i32 %26)
%28 = add i64 %0, 48
%29 = inttoptr i64 %28 to i64*
%30 = load volatile i64, i64* %29
%31 = and i64 %30, -49153
%32 = or i64 %31, %1
store volatile i64 %32, i64* %29
ret void
}