#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*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void ADCIntUnregister(unsigned long ulBase, unsigned long ulSequenceNum) {
  unsigned long ulInt;
  DEBUG_ASSERT((ulBase == 0x40038000) || (ulBase == 0x40039000));
  DEBUG_ASSERT(ulSequenceNum < 4);
  ulInt =
      ((ulBase == 0x40038000) ? (30 + ulSequenceNum) : (64 + ulSequenceNum));
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<ADCIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x40038000,-0x8(%rbp)
40
mov    %al,-0x19(%rbp)
je     1161 <ADCIntUnregister+0x31>
cmpq   $0x40039000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
cmpq   $0x4,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
cmpq   $0x40038000,-0x8(%rbp)
40
jne    119f <ADCIntUnregister+0x6f>
mov    -0x10(%rbp),%rax
add    $0x1e,%rax
mov    %rax,-0x28(%rbp)
jmp    11ab <ADCIntUnregister+0x7b>
mov    -0x10(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x18(%rbp),%rdi
call   1050 <IntUnregister@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntUnregister>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40038000,%rax
sete   %dil
call   1040 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%rbx
setb   %dil
call   1040 <DEBUG_ASSERT@plt>
lea    0x40(%rbx),%rax
add    $0x1e,%rbx
cmp    $0x40038000,%r14
cmovne %rax,%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @ADCIntUnregister(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 1073971200
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i64, i64* %3
%10 = icmp eq i64 %9, 1073975296
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ true, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %4
%16 = icmp ult i64 %15, 4
%17 = zext i1 %16 to i32
%18 = call i32 @DEBUG_ASSERT(i32 %17)
%19 = load i64, i64* %3
%20 = icmp eq i64 %19, 1073971200
br i1 %20, label %21, label %24
21: ; preds = %11
%22 = load i64, i64* %4
%23 = add i64 30, %22
br label %27
24: ; preds = %11
%25 = load i64, i64* %4
%26 = add i64 64, %25
br label %27
27: ; preds = %24, %21
%28 = phi i64 [ %23, %21 ], [ %26, %24 ]
store i64 %28, i64* %5
%29 = load i64, i64* %5
%30 = call i32 @IntDisable(i64 %29)
%31 = load i64, i64* %5
%32 = call i32 @IntUnregister(i64 %31)
ret void
}

LLVM IR (-O2):
define void @ADCIntUnregister(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1073971200
%4 = and i64 %0, -4097
%5 = icmp eq i64 %4, 1073971200
%6 = zext i1 %5 to i32
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = icmp ult i64 %1, 4
%9 = zext i1 %8 to i32
%10 = tail call i32 @DEBUG_ASSERT(i32 %9)
%11 = select i1 %3, i64 30, i64 64
%12 = add i64 %11, %1
%13 = tail call i32 @IntDisable(i64 %12)
%14 = tail call i32 @IntUnregister(i64 %12)
ret void
}