#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*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
int _PWMGenIntNumberGet(int, int);
int _PWMGenValid(int);
void PWMGenIntUnregister(uint32_t ui32Base, uint32_t ui32Gen) {
  uint32_t ui32Int;
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ASSERT(_PWMGenValid(ui32Gen));
  ui32Int = _PWMGenIntNumberGet(ui32Base, ui32Gen);
  ASSERT(ui32Int != 0);
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<PWMGenIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40028000,-0x4(%rbp)
mov    %al,-0xd(%rbp)
je     117d <PWMGenIntUnregister+0x2d>
cmpl   $0x40029000,-0x4(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <ASSERT@plt>
mov    -0x8(%rbp),%edi
call   1030 <_PWMGenValid@plt>
mov    %eax,%edi
call   1060 <ASSERT@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_PWMGenIntNumberGet@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <ASSERT@plt>
mov    -0xc(%rbp),%edi
call   1050 <IntDisable@plt>
mov    -0xc(%rbp),%edi
call   1070 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenIntUnregister>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40028000,%eax
sete   %dil
call   1060 <ASSERT@plt>
mov    %ebx,%edi
call   1030 <_PWMGenValid@plt>
mov    %eax,%edi
call   1060 <ASSERT@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <_PWMGenIntNumberGet@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setne  %dil
call   1060 <ASSERT@plt>
mov    %ebx,%edi
call   1050 <IntDisable@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <IntUnregister@plt>

LLVM IR (-O0):
define void @PWMGenIntUnregister(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %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* %4
%16 = call i32 @_PWMGenValid(i32 %15)
%17 = call i32 @ASSERT(i32 %16)
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = call i32 @_PWMGenIntNumberGet(i32 %18, i32 %19)
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @ASSERT(i32 %23)
%25 = load i32, i32* %5
%26 = call i32 @IntDisable(i32 %25)
%27 = load i32, i32* %5
%28 = call i32 @IntUnregister(i32 %27)
ret void
}

LLVM IR (-O2):
define void @PWMGenIntUnregister(i32 %0, i32 %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 @_PWMGenValid(i32 %1)
%8 = tail call i32 @ASSERT(i32 %7)
%9 = tail call i32 @_PWMGenIntNumberGet(i32 %0, i32 %1)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @ASSERT(i32 %11)
%13 = tail call i32 @IntDisable(i32 %9)
%14 = tail call i32 @IntUnregister(i32 %9)
ret void
}