#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
int _PWMFaultIntNumberGet(int);
void PWMFaultIntRegister(uint32_t ui32Base, void (*pfnIntHandler)(void)) {
  uint32_t ui32Int;
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ui32Int = _PWMFaultIntNumberGet(ui32Base);
  ASSERT(ui32Int != 0);
  IntRegister(ui32Int, pfnIntHandler);
  IntEnable(ui32Int);
}


x86 assembly (clang, -O0):
<PWMFaultIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x40028000,-0x4(%rbp)
mov    %al,-0x15(%rbp)
je     116e <PWMFaultIntRegister+0x2e>
cmpl   $0x40029000,-0x4(%rbp)
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <ASSERT@plt>
mov    -0x4(%rbp),%edi
call   1050 <_PWMFaultIntNumberGet@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <ASSERT@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x14(%rbp),%edi
call   1030 <IntEnable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMFaultIntRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40028000,%eax
sete   %dil
call   1060 <ASSERT@plt>
mov    %ebp,%edi
call   1050 <_PWMFaultIntNumberGet@plt>
mov    %eax,%ebp
xor    %edi,%edi
test   %eax,%eax
setne  %dil
call   1060 <ASSERT@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <IntRegister@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @PWMFaultIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
%5 = alloca i32
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1073905664
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1073909760
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ true, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
%15 = load i32, i32* %3
%16 = call i32 @_PWMFaultIntNumberGet(i32 %15)
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @ASSERT(i32 %19)
%21 = load i32, i32* %5
%22 = load void ()*, void ()** %4
%23 = bitcast void ()* %22 to void (...)*
%24 = call i32 @IntRegister(i32 %21, void (...)* %23)
%25 = load i32, i32* %5
%26 = call i32 @IntEnable(i32 %25)
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntRegister(i32 %0, void ()* %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073905664
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = tail call i32 @_PWMFaultIntNumberGet(i32 %0)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @ASSERT(i32 %9)
%11 = bitcast void ()* %1 to void (...)*
%12 = tail call i32 @IntRegister(i32 %7, void (...)* %11)
%13 = tail call i32 @IntEnable(i32 %7)
ret void
}