#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*/ IntEnable(unsigned long);
int /*<<< orphan*/ IntRegister(unsigned long, void (*)());
int /*<<< orphan*/ UARTBaseValid(unsigned long);
unsigned long UARTIntNumberGet(unsigned long);
void UARTIntRegister(unsigned long ulBase, void (*pfnHandler)(void)) {
  unsigned long ulInt;
  {
    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",
          1374);
    }
  };
  ulInt = UARTIntNumberGet(ulBase);
  IntRegister(ulInt, pfnHandler);
  IntEnable(ulInt);
}


x86 assembly (clang, -O0):
<UARTIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <UARTBaseValid@plt>
cmp    $0x0,%eax
jne    1183 <UARTIntRegister+0x33>
lea    0xe87(%rip),%rdi
mov    $0x55e,%esi
call   1050 <AssertFailure@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UARTIntNumberGet@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <IntRegister@plt>
mov    -0x18(%rbp),%rdi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntRegister>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1070 <UARTBaseValid@plt>
test   %eax,%eax
jne    1174 <UARTIntRegister+0x24>
lea    0xe96(%rip),%rdi
mov    $0x55e,%esi
call   1050 <AssertFailure@plt>
mov    %rbx,%rdi
call   1040 <UARTIntNumberGet@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <IntRegister@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <IntEnable@plt>

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 @UARTIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
%5 = alloca i64
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%6 = load i64, i64* %3
%7 = call i32 @UARTBaseValid(i64 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @AssertFailure(i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 1374)
br label %11
11: ; preds = %9, %2
%12 = load i64, i64* %3
%13 = call i64 @UARTIntNumberGet(i64 %12)
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = load void ()*, void ()** %4
%16 = bitcast void ()* %15 to void (...)*
%17 = call i32 @IntRegister(i64 %14, void (...)* %16)
%18 = load i64, i64* %5
%19 = call i32 @IntEnable(i64 %18)
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 @UARTIntRegister(i64 %0, void ()* %1) {
%3 = tail call i32 @UARTBaseValid(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 ([201 x i8], [201 x i8]* @.str, i64 0, i64 0), i32 1374)
br label %7
7: ; preds = %5, %2
%8 = tail call i64 @UARTIntNumberGet(i64 %0)
%9 = bitcast void ()* %1 to void (...)*
%10 = tail call i32 @IntRegister(i64 %8, void (...)* %9)
%11 = tail call i32 @IntEnable(i64 %8)
ret void
}