#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*/ AssertFailure(char *, int);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTFlowControlSet(unsigned long ulBase, unsigned long ulMode) {
  {
    if (!(!((((*((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)))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          940);
    }
  };
  {
    if (!(UARTBaseValid(ulBase))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          941);
    }
  };
  {
    if (!((ulMode & ~(0x00008000 | 0x00004000)) == 0)) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/"
          "uartlib.c",
          942);
    }
  };
  (*((volatile unsigned long *)(ulBase + 0x00000030))) =
      (((*((volatile unsigned long *)(ulBase + 0x00000030))) &
        ~(0x00008000 | 0x00004000)) |
       ulMode);
}


x86 assembly (clang, -O0):
<UARTFlowControlSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70000000,%rax
cmp    $0x0,%rax
je     1196 <UARTFlowControlSet+0x76>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10000000,%rax
je     1196 <UARTFlowControlSet+0x76>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10010000,%rax
je     1196 <UARTFlowControlSet+0x76>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10030000,%rax
jne    11a7 <UARTFlowControlSet+0x87>
lea    0xe63(%rip),%rdi
mov    $0x3ac,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    11ca <UARTFlowControlSet+0xaa>
lea    0xe40(%rip),%rdi
mov    $0x3ad,%esi
call   1030 <AssertFailure@plt>
mov    -0x10(%rbp),%rax
and    $0xffffffffffff3fff,%rax
cmp    $0x0,%rax
je     11ef <UARTFlowControlSet+0xcf>
lea    0xe1b(%rip),%rdi
mov    $0x3ae,%esi
call   1030 <AssertFailure@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    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFlowControlSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
testq  $0x70000000,0x400fe000
je     1174 <UARTFlowControlSet+0x54>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10000000,%eax
je     1174 <UARTFlowControlSet+0x54>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10010000,%eax
je     1174 <UARTFlowControlSet+0x54>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10030000,%eax
jne    1185 <UARTFlowControlSet+0x65>
lea    0xe85(%rip),%rdi
mov    $0x3ac,%esi
call   1030 <AssertFailure@plt>
mov    %rbx,%rdi
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    11a2 <UARTFlowControlSet+0x82>
lea    0xe68(%rip),%rdi
mov    $0x3ad,%esi
call   1030 <AssertFailure@plt>
test   $0xffffffffffff3fff,%r14
je     11bc <UARTFlowControlSet+0x9c>
lea    0xe4e(%rip),%rdi
mov    $0x3ae,%esi
call   1030 <AssertFailure@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):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
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 %20, 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 %20, 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 %20, 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
br i1 %19, label %20, label %22
20: ; preds = %16, %12, %8, %2
%21 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 940)
br label %22
22: ; preds = %20, %16
%23 = load i64, i64* %3
%24 = call i32 @UARTBaseValid(i64 %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 941)
br label %28
28: ; preds = %26, %22
%29 = load i64, i64* %4
%30 = and i64 %29, -49153
%31 = icmp eq i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %28
%33 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 942)
br label %34
34: ; preds = %32, %28
%35 = load i64, i64* %3
%36 = add i64 %35, 48
%37 = inttoptr i64 %36 to i64*
%38 = load volatile i64, i64* %37
%39 = and i64 %38, -49153
%40 = load i64, i64* %4
%41 = or i64 %39, %40
%42 = load i64, i64* %3
%43 = add i64 %42, 48
%44 = inttoptr i64 %43 to i64*
store volatile i64 %41, i64* %44
ret void
}

LLVM IR (-O2):
@.str = [201 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/uartlib.c\00"
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 %18, 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 %18, 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 %18, 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
br i1 %17, label %18, label %20
18: ; preds = %14, %10, %6, %2
%19 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 940)
br label %20
20: ; preds = %18, %14
%21 = tail call i32 @UARTBaseValid(i64 %0)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 941)
br label %25
25: ; preds = %23, %20
%26 = and i64 %1, -49153
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 942)
br label %30
30: ; preds = %28, %25
%31 = add i64 %0, 48
%32 = inttoptr i64 %31 to i64*
%33 = load volatile i64, i64* %32
%34 = and i64 %33, -49153
%35 = or i64 %34, %1
store volatile i64 %35, i64* %32
ret void
}