#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 ADCIntUnregister(unsigned long ulBase, unsigned long ulChannel) {
  unsigned long ulIntNo;
  ulIntNo = (ulChannel == 0x00000000)   ? 30
            : (ulChannel == 0x00000008) ? 31
            : (ulChannel == 0x00000010) ? 32
                                        : 33;
  IntDisable(ulIntNo);
  IntUnregister(ulIntNo);
}


x86 assembly (clang, -O0):
<ADCIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1148 <ADCIntUnregister+0x28>
mov    $0x1e,%eax
mov    %eax,-0x1c(%rbp)
jmp    117e <ADCIntUnregister+0x5e>
cmpq   $0x8,-0x10(%rbp)
jne    1160 <ADCIntUnregister+0x40>
mov    $0x1f,%eax
mov    %eax,-0x20(%rbp)
jmp    1178 <ADCIntUnregister+0x58>
mov    -0x10(%rbp),%rdx
mov    $0x21,%eax
mov    $0x20,%ecx
cmp    $0x10,%rdx
cmove  %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x18(%rbp),%rdi
call   1040 <IntUnregister@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntUnregister>:
push   %rbx
test   %rsi,%rsi
je     1133 <ADCIntUnregister+0x13>
cmp    $0x8,%rsi
jne    113a <ADCIntUnregister+0x1a>
mov    $0x1f,%ebx
jmp    1147 <ADCIntUnregister+0x27>
mov    $0x1e,%ebx
jmp    1147 <ADCIntUnregister+0x27>
xor    %ebx,%ebx
cmp    $0x10,%rsi
sete   %bl
xor    $0x21,%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <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* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %20
9: ; preds = %2
%10 = load i64, i64* %4
%11 = icmp eq i64 %10, 8
br i1 %11, label %12, label %13
12: ; preds = %9
br label %18
13: ; preds = %9
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 16
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 32, i32 33
br label %18
18: ; preds = %13, %12
%19 = phi i32 [ 31, %12 ], [ %17, %13 ]
br label %20
20: ; preds = %18, %8
%21 = phi i32 [ 30, %8 ], [ %19, %18 ]
%22 = sext i32 %21 to i64
store i64 %22, i64* %5
%23 = load i64, i64* %5
%24 = call i32 @IntDisable(i64 %23)
%25 = load i64, i64* %5
%26 = call i32 @IntUnregister(i64 %25)
ret void
}

LLVM IR (-O2):
define void @ADCIntUnregister(i64 %0, i64 %1) {
switch i64 %1, label %3 [
i64 0, label %7
i64 8, label %6
]
3: ; preds = %2
%4 = icmp eq i64 %1, 16
%5 = select i1 %4, i64 32, i64 33
br label %7
6: ; preds = %2
br label %7
7: ; preds = %2, %6, %3
%8 = phi i64 [ 30, %2 ], [ %5, %3 ], [ 31, %6 ]
%9 = tail call i32 @IntDisable(i64 %8)
%10 = tail call i32 @IntUnregister(i64 %8)
ret void
}