#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 LPCChannelDMAConfigSet(unsigned long ulBase, unsigned long ulConfig,
                            unsigned long ulMask) {
  unsigned long ulTemp;
  DEBUG_ASSERT(ulBase == 0x40080000);
  DEBUG_ASSERT((ulConfig & ~0x000000FF) == 0);
  DEBUG_ASSERT((ulConfig & 0x00000003) != 0x00000003);
  DEBUG_ASSERT((ulConfig & 0x0000000C) != 0x0000000C);
  DEBUG_ASSERT((ulConfig & 0x00000030) != 0x00000030);
  DEBUG_ASSERT((ulConfig & 0x000000C0) != 0x000000C0);
  DEBUG_ASSERT((ulMask & ~0x000000FF) == 0);
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000120)));
  ulTemp &= ~ulMask;
  ulTemp |= (ulConfig & ulMask);
  (*((volatile unsigned long *)(ulBase + 0x00000120))) = ulTemp;
}


x86 assembly (clang, -O0):
<LPCChannelDMAConfigSet>:
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),%rax
and    $0xffffffffffffff00,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0x3,%rax
cmp    $0x3,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xc,%rax
cmp    $0xc,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0x30,%rax
cmp    $0x30,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xc0,%rax
cmp    $0xc0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x18(%rbp),%rax
and    $0xffffffffffffff00,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x120(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
and    -0x18(%rbp),%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x120(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCChannelDMAConfigSet>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40080000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x100,%r12
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r12d,%ebx
not    %ebx
xor    %edi,%edi
test   $0x3,%bl
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xc,%bl
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0x30,%bl
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xc0,%bl
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x100,%r15
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x120(%r14),%rax
xor    %rax,%r12
and    %r15,%r12
xor    %rax,%r12
mov    %r12,0x120(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @LPCChannelDMAConfigSet(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 = and i64 %12, -256
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @DEBUG_ASSERT(i32 %15)
%17 = load i64, i64* %5
%18 = and i64 %17, 3
%19 = icmp ne i64 %18, 3
%20 = zext i1 %19 to i32
%21 = call i32 @DEBUG_ASSERT(i32 %20)
%22 = load i64, i64* %5
%23 = and i64 %22, 12
%24 = icmp ne i64 %23, 12
%25 = zext i1 %24 to i32
%26 = call i32 @DEBUG_ASSERT(i32 %25)
%27 = load i64, i64* %5
%28 = and i64 %27, 48
%29 = icmp ne i64 %28, 48
%30 = zext i1 %29 to i32
%31 = call i32 @DEBUG_ASSERT(i32 %30)
%32 = load i64, i64* %5
%33 = and i64 %32, 192
%34 = icmp ne i64 %33, 192
%35 = zext i1 %34 to i32
%36 = call i32 @DEBUG_ASSERT(i32 %35)
%37 = load i64, i64* %6
%38 = and i64 %37, -256
%39 = icmp eq i64 %38, 0
%40 = zext i1 %39 to i32
%41 = call i32 @DEBUG_ASSERT(i32 %40)
%42 = load i64, i64* %4
%43 = add i64 %42, 288
%44 = inttoptr i64 %43 to i64*
%45 = load volatile i64, i64* %44
store i64 %45, i64* %7
%46 = load i64, i64* %6
%47 = xor i64 %46, -1
%48 = load i64, i64* %7
%49 = and i64 %48, %47
store i64 %49, i64* %7
%50 = load i64, i64* %5
%51 = load i64, i64* %6
%52 = and i64 %50, %51
%53 = load i64, i64* %7
%54 = or i64 %53, %52
store i64 %54, i64* %7
%55 = load i64, i64* %7
%56 = load i64, i64* %4
%57 = add i64 %56, 288
%58 = inttoptr i64 %57 to i64*
store volatile i64 %55, i64* %58
ret void
}

LLVM IR (-O2):
define void @LPCChannelDMAConfigSet(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 = icmp ult i64 %1, 256
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = and i64 %1, 3
%11 = icmp ne i64 %10, 3
%12 = zext i1 %11 to i32
%13 = tail call i32 @DEBUG_ASSERT(i32 %12)
%14 = and i64 %1, 12
%15 = icmp ne i64 %14, 12
%16 = zext i1 %15 to i32
%17 = tail call i32 @DEBUG_ASSERT(i32 %16)
%18 = and i64 %1, 48
%19 = icmp ne i64 %18, 48
%20 = zext i1 %19 to i32
%21 = tail call i32 @DEBUG_ASSERT(i32 %20)
%22 = and i64 %1, 192
%23 = icmp ne i64 %22, 192
%24 = zext i1 %23 to i32
%25 = tail call i32 @DEBUG_ASSERT(i32 %24)
%26 = icmp ult i64 %2, 256
%27 = zext i1 %26 to i32
%28 = tail call i32 @DEBUG_ASSERT(i32 %27)
%29 = add i64 %0, 288
%30 = inttoptr i64 %29 to i64*
%31 = load volatile i64, i64* %30
%32 = xor i64 %2, -1
%33 = and i64 %31, %32
%34 = and i64 %2, %1
%35 = or i64 %33, %34
store volatile i64 %35, i64* %30
ret void
}