#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*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void TimerIntUnregister(unsigned long ulBase, unsigned long ulTimer) {
  ;

  ;
  ulBase =
      ((ulBase == 0x40030000)
           ? 35
           : ((ulBase == 0x40031000) ? 37
                                     : ((ulBase == 0x40032000) ? 39 : 51)));
  if (ulTimer & 0x000000ff) {
    IntDisable(ulBase);
    IntUnregister(ulBase);
  }
  if (ulTimer & 0x0000ff00) {
    IntDisable(ulBase + 1);
    IntUnregister(ulBase + 1);
  }
}


x86 assembly (clang, -O0):
<TimerIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40030000,-0x8(%rbp)
40
jne    114b <TimerIntUnregister+0x2b>
mov    $0x23,%eax
mov    %eax,-0x14(%rbp)
jmp    1187 <TimerIntUnregister+0x67>
cmpq   $0x40031000,-0x8(%rbp)
40
jne    1166 <TimerIntUnregister+0x46>
mov    $0x25,%eax
mov    %eax,-0x18(%rbp)
jmp    1181 <TimerIntUnregister+0x61>
mov    -0x8(%rbp),%rdx
mov    $0x33,%eax
mov    $0x27,%ecx
cmp    $0x40032000,%rdx
cmove  %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
cmp    $0x0,%rax
je     11b6 <TimerIntUnregister+0x96>
mov    -0x8(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%rdi
call   1040 <IntUnregister@plt>
mov    -0x10(%rbp),%rax
and    $0xff00,%rax
cmp    $0x0,%rax
je     11e4 <TimerIntUnregister+0xc4>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <IntDisable@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <IntUnregister@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntUnregister>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
cmp    $0x40030000,%rdi
je     1145 <TimerIntUnregister+0x25>
cmp    $0x40031000,%rdi
jne    1151 <TimerIntUnregister+0x31>
mov    $0x25,%ebx
test   %r14b,%r14b
jne    116b <TimerIntUnregister+0x4b>
jmp    117b <TimerIntUnregister+0x5b>
mov    $0x23,%ebx
test   %r14b,%r14b
jne    116b <TimerIntUnregister+0x4b>
jmp    117b <TimerIntUnregister+0x5b>
cmp    $0x40032000,%rdi
mov    $0x27,%eax
mov    $0x33,%ebx
cmove  %rax,%rbx
test   %r14b,%r14b
je     117b <TimerIntUnregister+0x5b>
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
call   1040 <IntUnregister@plt>
test   $0xff00,%r14d
je     119f <TimerIntUnregister+0x7f>
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <IntUnregister@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @TimerIntUnregister(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073938432
br i1 %6, label %7, label %8
7: ; preds = %2
br label %19
8: ; preds = %2
%9 = load i64, i64* %3
%10 = icmp eq i64 %9, 1073942528
br i1 %10, label %11, label %12
11: ; preds = %8
br label %17
12: ; preds = %8
%13 = load i64, i64* %3
%14 = icmp eq i64 %13, 1073946624
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 39, i32 51
br label %17
17: ; preds = %12, %11
%18 = phi i32 [ 37, %11 ], [ %16, %12 ]
br label %19
19: ; preds = %17, %7
%20 = phi i32 [ 35, %7 ], [ %18, %17 ]
%21 = sext i32 %20 to i64
store i64 %21, i64* %3
%22 = load i64, i64* %4
%23 = and i64 %22, 255
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %19
%26 = load i64, i64* %3
%27 = call i32 @IntDisable(i64 %26)
%28 = load i64, i64* %3
%29 = call i32 @IntUnregister(i64 %28)
br label %30
30: ; preds = %25, %19
%31 = load i64, i64* %4
%32 = and i64 %31, 65280
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %41
34: ; preds = %30
%35 = load i64, i64* %3
%36 = add i64 %35, 1
%37 = call i32 @IntDisable(i64 %36)
%38 = load i64, i64* %3
%39 = add i64 %38, 1
%40 = call i32 @IntUnregister(i64 %39)
br label %41
41: ; preds = %34, %30
ret void
}

LLVM IR (-O2):
define void @TimerIntUnregister(i64 %0, i64 %1) {
switch i64 %0, label %3 [
i64 1073938432, label %7
i64 1073942528, label %6
]
3: ; preds = %2
%4 = icmp eq i64 %0, 1073946624
%5 = select i1 %4, i64 39, i64 51
br label %7
6: ; preds = %2
br label %7
7: ; preds = %2, %6, %3
%8 = phi i64 [ 35, %2 ], [ %5, %3 ], [ 37, %6 ]
%9 = and i64 %1, 255
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = tail call i32 @IntDisable(i64 %8)
%13 = tail call i32 @IntUnregister(i64 %8)
br label %14
14: ; preds = %11, %7
%15 = and i64 %1, 65280
%16 = icmp eq i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = add nuw nsw i64 %8, 1
%19 = tail call i32 @IntDisable(i64 %18)
%20 = tail call i32 @IntUnregister(i64 %18)
br label %21
21: ; preds = %17, %14
ret void
}