#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);
void PECIIntEnable(unsigned long ulBase, unsigned long ulIntFlags,
                   unsigned long ulIntMode) {
  unsigned long ulTemp;
  DEBUG_ASSERT(ulBase == 0x400B0000);
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000080)));
  ulTemp &= ~ulIntFlags;
  ulTemp |= (0x0000FFFF & ulIntFlags);
  ulTemp |= (0xFFFF0000 & ulIntMode);
  (*((volatile unsigned long *)(ulBase + 0x00000080))) = ulTemp;
}


x86 assembly (clang, -O0):
<PECIIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x400b0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x80(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffff,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
movabs $0xffff0000,%rax
and    -0x18(%rbp),%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x80(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIIntEnable>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
cmp    $0x400b0000,%r15
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,%rax
not    %rax
and    0x80(%r15),%rax
movzwl %r14w,%ecx
and    $0xffff0000,%ebx
or     %rcx,%rbx
or     %rax,%rbx
mov    %rbx,0x80(%r15)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @PECIIntEnable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 1074462720
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %4
%13 = add i64 %12, 128
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
store i64 %15, i64* %7
%16 = load i64, i64* %5
%17 = xor i64 %16, -1
%18 = load i64, i64* %7
%19 = and i64 %18, %17
store i64 %19, i64* %7
%20 = load i64, i64* %5
%21 = and i64 65535, %20
%22 = load i64, i64* %7
%23 = or i64 %22, %21
store i64 %23, i64* %7
%24 = load i64, i64* %6
%25 = and i64 4294901760, %24
%26 = load i64, i64* %7
%27 = or i64 %26, %25
store i64 %27, i64* %7
%28 = load i64, i64* %7
%29 = load i64, i64* %4
%30 = add i64 %29, 128
%31 = inttoptr i64 %30 to i64*
store volatile i64 %28, i64* %31
ret void
}

LLVM IR (-O2):
define void @PECIIntEnable(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %0, 1074462720
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = add i64 %0, 128
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = xor i64 %1, -1
%11 = and i64 %9, %10
%12 = and i64 %1, 65535
%13 = and i64 %2, 4294901760
%14 = or i64 %13, %12
%15 = or i64 %14, %11
store volatile i64 %15, i64* %8
ret void
}