#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*/ CANBaseValid(unsigned long);
unsigned long CANRegRead(unsigned long);
int /*<<< orphan*/ CANRegWrite(unsigned long, unsigned long);
void CANIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  {
    if (!(CANBaseValid(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_LM3S8962_Crossworks/Boot/lib/driverlib/canlib.c",
          1061);
    }
  };
  {
    if (!((ulIntFlags & ~(0x00000008 | 0x00000004 | 0x00000002)) == 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_LM3S8962_Crossworks/Boot/lib/driverlib/canlib.c",
          1062);
    }
  };
  CANRegWrite(ulBase + 0x00000000,
              CANRegRead(ulBase + 0x00000000) | ulIntFlags);
}


x86 assembly (clang, -O0):
<CANIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <CANBaseValid@plt>
cmp    $0x0,%eax
jne    1173 <CANIntEnable+0x33>
lea    0xe97(%rip),%rdi
mov    $0x425,%esi
call   1040 <AssertFailure@plt>
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffff1,%rax
cmp    $0x0,%rax
je     1196 <CANIntEnable+0x56>
lea    0xe74(%rip),%rdi
mov    $0x426,%esi
call   1040 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
add    $0x0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x0,%rdi
call   1050 <CANRegRead@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
or     -0x10(%rbp),%rsi
call   1030 <CANRegWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1060 <CANBaseValid@plt>
test   %eax,%eax
je     118a <CANIntEnable+0x4a>
test   $0xfffffffffffffff1,%rbx
je     116d <CANIntEnable+0x2d>
lea    0xe9d(%rip),%rdi
mov    $0x426,%esi
call   1040 <AssertFailure@plt>
mov    %r14,%rdi
call   1050 <CANRegRead@plt>
or     %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <CANRegWrite@plt>
lea    0xe6f(%rip),%rdi
mov    $0x425,%esi
call   1040 <AssertFailure@plt>
test   $0xfffffffffffffff1,%rbx
jne    115c <CANIntEnable+0x1c>
jmp    116d <CANIntEnable+0x2d>

LLVM IR (-O0):
@.str = [200 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_LM3S8962_Crossworks/Boot/lib/driverlib/canlib.c\00"
define void @CANIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @CANBaseValid(i64 %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1061)
br label %10
10: ; preds = %8, %2
%11 = load i64, i64* %4
%12 = and i64 %11, -15
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1062)
br label %16
16: ; preds = %14, %10
%17 = load i64, i64* %3
%18 = add i64 %17, 0
%19 = load i64, i64* %3
%20 = add i64 %19, 0
%21 = call i64 @CANRegRead(i64 %20)
%22 = load i64, i64* %4
%23 = or i64 %21, %22
%24 = call i32 @CANRegWrite(i64 %18, i64 %23)
ret void
}

LLVM IR (-O2):
@.str = [200 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_LM3S8962_Crossworks/Boot/lib/driverlib/canlib.c\00"
define void @CANIntEnable(i64 %0, i64 %1) {
%3 = tail call i32 @CANBaseValid(i64 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1061)
br label %7
7: ; preds = %5, %2
%8 = and i64 %1, -15
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1062)
br label %12
12: ; preds = %10, %7
%13 = tail call i64 @CANRegRead(i64 %0)
%14 = or i64 %13, %1
%15 = tail call i32 @CANRegWrite(i64 %0, i64 %14)
ret void
}