#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);
int CANRegRead(unsigned long);
int /*<<< orphan*/ CANRegWrite(unsigned long, int);
void CANDisable(unsigned long ulBase) {
  {
    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",
          600);
    }
  };
  CANRegWrite(ulBase + 0x00000000,
              CANRegRead(ulBase + 0x00000000) | 0x00000001);
}


x86 assembly (clang, -O0):
<CANDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <CANBaseValid@plt>
cmp    $0x0,%eax
jne    116f <CANDisable+0x2f>
lea    0xe9b(%rip),%rdi
mov    $0x258,%esi
call   1040 <AssertFailure@plt>
mov    -0x8(%rbp),%rax
add    $0x0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x0,%rdi
call   1050 <CANRegRead@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
or     $0x1,%esi
call   1030 <CANRegWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANDisable>:
push   %rbx
mov    %rdi,%rbx
call   1060 <CANBaseValid@plt>
test   %eax,%eax
jne    115e <CANDisable+0x1e>
lea    0xeac(%rip),%rdi
mov    $0x258,%esi
call   1040 <AssertFailure@plt>
mov    %rbx,%rdi
call   1050 <CANRegRead@plt>
or     $0x1,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <CANRegWrite@plt>

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 @CANDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @CANBaseValid(i64 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 600)
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = add i64 %9, 0
%11 = load i64, i64* %2
%12 = add i64 %11, 0
%13 = call i32 @CANRegRead(i64 %12)
%14 = or i32 %13, 1
%15 = call i32 @CANRegWrite(i64 %10, i32 %14)
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 @CANDisable(i64 %0) {
%2 = tail call i32 @CANBaseValid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 600)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @CANRegRead(i64 %0)
%8 = or i32 %7, 1
%9 = tail call i32 @CANRegWrite(i64 %0, i32 %8)
ret void
}