#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 LPCChannelValid(unsigned long);
void LPCChannelStatusSet(unsigned long ulBase, unsigned long ulChannel,
                         unsigned long ulStatus) {
  unsigned long ulTemp;
  DEBUG_ASSERT(ulBase == 0x40080000);
  DEBUG_ASSERT(LPCChannelValid(ulChannel));
  DEBUG_ASSERT((ulStatus & (~0x00001F00)) == 0);
  ulTemp =
      (*((volatile unsigned long *)(ulBase + 0x00000014 + (ulChannel * 0x10))));
  ulTemp |= ulStatus;
  (*((volatile unsigned long *)(ulBase + 0x00000014 + (ulChannel * 0x10)))) =
      ulTemp;
}


x86 assembly (clang, -O0):
<LPCChannelStatusSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <LPCChannelValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x18(%rbp),%rax
and    $0xffffffffffffe0ff,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    -0x10(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    -0x10(%rbp),%rdx
shl    $0x4,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCChannelStatusSet>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
cmp    $0x40080000,%r15
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1040 <LPCChannelValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xffffffffffffe0ff,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
shl    $0x4,%rbx
or     %r14,0x14(%r15,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @LPCChannelStatusSet(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, 1074266112
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %5
%13 = call i32 @LPCChannelValid(i64 %12)
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %6
%16 = and i64 %15, -7937
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @DEBUG_ASSERT(i32 %18)
%20 = load i64, i64* %4
%21 = add i64 %20, 20
%22 = load i64, i64* %5
%23 = mul i64 %22, 16
%24 = add i64 %21, %23
%25 = inttoptr i64 %24 to i64*
%26 = load volatile i64, i64* %25
store i64 %26, i64* %7
%27 = load i64, i64* %6
%28 = load i64, i64* %7
%29 = or i64 %28, %27
store i64 %29, i64* %7
%30 = load i64, i64* %7
%31 = load i64, i64* %4
%32 = add i64 %31, 20
%33 = load i64, i64* %5
%34 = mul i64 %33, 16
%35 = add i64 %32, %34
%36 = inttoptr i64 %35 to i64*
store volatile i64 %30, i64* %36
ret void
}

LLVM IR (-O2):
define void @LPCChannelStatusSet(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %0, 1074266112
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = tail call i32 @LPCChannelValid(i64 %1)
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = and i64 %2, -7937
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @DEBUG_ASSERT(i32 %11)
%13 = add i64 %0, 20
%14 = shl i64 %1, 4
%15 = add i64 %13, %14
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
%18 = or i64 %17, %2
store volatile i64 %18, i64* %16
ret void
}