#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 _TimerBaseValid(int);
int _TimerIntNumberGet(int, int);
void TimerIntUnregister(uint32_t ui32Base, uint32_t ui32Timer) {
  uint32_t ui32Int;
  ASSERT(_TimerBaseValid(ui32Base));
  ASSERT((ui32Timer == 0x000000ff) || (ui32Timer == 0x0000ff00) ||
         (ui32Timer == 0x0000ffff));
  ui32Int = _TimerIntNumberGet(ui32Base, ui32Timer);
  IntDisable(ui32Int);
  IntUnregister(ui32Int);
}


x86 assembly (clang, -O0):
<TimerIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1070 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1050 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0xff,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     119e <TimerIntUnregister+0x4e>
mov    $0x1,%al
cmpl   $0xff00,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     119e <TimerIntUnregister+0x4e>
cmpl   $0xffff,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <ASSERT@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_TimerIntNumberGet@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <IntDisable@plt>
mov    -0xc(%rbp),%edi
call   1060 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntUnregister>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1070 <_TimerBaseValid@plt>
mov    %eax,%edi
call   1050 <ASSERT@plt>
mov    $0x1,%edi
cmp    $0xff,%ebx
je     1184 <TimerIntUnregister+0x34>
cmp    $0xff00,%ebx
je     1184 <TimerIntUnregister+0x34>
xor    %edi,%edi
cmp    $0xffff,%ebx
sete   %dil
call   1050 <ASSERT@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <_TimerIntNumberGet@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <IntDisable@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <IntUnregister@plt>

LLVM IR (-O0):
define void @TimerIntUnregister(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 = call i32 @_TimerBaseValid(i32 %6)
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 255
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 65280
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 65535
br label %17
17: ; preds = %14, %11, %2
%18 = phi i1 [ true, %11 ], [ true, %2 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
%20 = call i32 @ASSERT(i32 %19)
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = call i32 @_TimerIntNumberGet(i32 %21, i32 %22)
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = call i32 @IntDisable(i32 %24)
%26 = load i32, i32* %5
%27 = call i32 @IntUnregister(i32 %26)
ret void
}

LLVM IR (-O2):
define void @TimerIntUnregister(i32 %0, i32 %1) {
%3 = tail call i32 @_TimerBaseValid(i32 %0)
%4 = tail call i32 @ASSERT(i32 %3)
switch i32 %1, label %5 [
i32 65280, label %8
i32 255, label %8
]
5: ; preds = %2
%6 = icmp eq i32 %1, 65535
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %2, %5
%9 = phi i32 [ 1, %2 ], [ %7, %5 ], [ 1, %2 ]
%10 = tail call i32 @ASSERT(i32 %9)
%11 = tail call i32 @_TimerIntNumberGet(i32 %0, i32 %1)
%12 = tail call i32 @IntDisable(i32 %11)
%13 = tail call i32 @IntUnregister(i32 %11)
ret void
}