#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 UARTSmartCardEnable(unsigned long ulBase) {
  unsigned long ulVal;
  {
    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",
          709);
    }
  };
  {
    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",
          710);
    }
  };
  ulVal = (*((volatile unsigned long *)(ulBase + 0x0000002C)));
  ulVal &= ~(0x00000080 | 0x00000004 | 0x00000002 | 0x00000060);
  ulVal |= 0x00000060 | 0x00000002 | 0x00000004 | 0x00000008;
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) = ulVal;
  (*((volatile unsigned long *)(ulBase + 0x00000030))) |= 0x00000008;
}


x86 assembly (clang, -O0):
<UARTSmartCardEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70000000,%rax
cmp    $0x0,%rax
je     1192 <UARTSmartCardEnable+0x72>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10000000,%rax
je     1192 <UARTSmartCardEnable+0x72>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10010000,%rax
je     1192 <UARTSmartCardEnable+0x72>
mov    $0x400fe000,%eax
mov    (%rax),%rax
and    $0x70ff0000,%rax
cmp    $0x10030000,%rax
jne    11a3 <UARTSmartCardEnable+0x83>
lea    0xe67(%rip),%rdi
mov    $0x2c5,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    11c6 <UARTSmartCardEnable+0xa6>
lea    0xe44(%rip),%rdi
mov    $0x2c6,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffffffffffffff19,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
or     $0x6e,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
or     $0x8,%rcx
mov    %rcx,0x30(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTSmartCardEnable>:
push   %rbx
mov    %rdi,%rbx
testq  $0x70000000,0x400fe000
je     116e <UARTSmartCardEnable+0x4e>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10000000,%eax
je     116e <UARTSmartCardEnable+0x4e>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10010000,%eax
je     116e <UARTSmartCardEnable+0x4e>
mov    0x400fe000,%rax
40
and    $0x70ff0000,%eax
cmp    $0x10030000,%eax
jne    117f <UARTSmartCardEnable+0x5f>
lea    0xe8b(%rip),%rdi
mov    $0x2c5,%esi
call   1030 <AssertFailure@plt>
mov    %rbx,%rdi
call   1040 <UARTBaseValid@plt>
test   %eax,%eax
jne    119c <UARTSmartCardEnable+0x7c>
lea    0xe6e(%rip),%rdi
mov    $0x2c6,%esi
call   1030 <AssertFailure@plt>
mov    $0xffffffffffffff11,%rax
and    0x2c(%rbx),%rax
or     $0x6e,%rax
mov    %rax,0x2c(%rbx)
orq    $0x8,0x30(%rbx)
pop    %rbx
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 @UARTSmartCardEnable(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%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 %19, 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 %19, 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 %19, label %15
15: ; preds = %11
%16 = load volatile i64, i64* inttoptr (i64 1074782208 to i64*)
%17 = and i64 %16, 1895759872
%18 = icmp eq i64 %17, 268632064
br i1 %18, label %19, label %21
19: ; preds = %15, %11, %7, %1
%20 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 709)
br label %21
21: ; preds = %19, %15
%22 = load i64, i64* %2
%23 = call i32 @UARTBaseValid(i64 %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 710)
br label %27
27: ; preds = %25, %21
%28 = load i64, i64* %2
%29 = add i64 %28, 44
%30 = inttoptr i64 %29 to i64*
%31 = load volatile i64, i64* %30
store i64 %31, i64* %3
%32 = load i64, i64* %3
%33 = and i64 %32, -231
store i64 %33, i64* %3
%34 = load i64, i64* %3
%35 = or i64 %34, 110
store i64 %35, i64* %3
%36 = load i64, i64* %3
%37 = load i64, i64* %2
%38 = add i64 %37, 44
%39 = inttoptr i64 %38 to i64*
store volatile i64 %36, i64* %39
%40 = load i64, i64* %2
%41 = add i64 %40, 48
%42 = inttoptr i64 %41 to i64*
%43 = load volatile i64, i64* %42
%44 = or i64 %43, 8
store volatile i64 %44, i64* %42
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 @UARTSmartCardEnable(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 %17, 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 %17, 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 %17, 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 %17, label %19
17: ; preds = %13, %9, %5, %1
%18 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 709)
br label %19
19: ; preds = %17, %13
%20 = tail call i32 @UARTBaseValid(i64 %0)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 710)
br label %24
24: ; preds = %22, %19
%25 = add i64 %0, 44
%26 = inttoptr i64 %25 to i64*
%27 = load volatile i64, i64* %26
%28 = and i64 %27, -239
%29 = or i64 %28, 110
store volatile i64 %29, i64* %26
%30 = add i64 %0, 48
%31 = inttoptr i64 %30 to i64*
%32 = load volatile i64, i64* %31
%33 = or i64 %32, 8
store volatile i64 %33, i64* %31
ret void
}