#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 LPCConfigSet(unsigned long ulBase, unsigned long ulConfig) {
  unsigned long ulTemp;
  DEBUG_ASSERT(ulBase == 0x40080000);
  DEBUG_ASSERT((ulConfig & ~(0x00000100)) == 0);
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000000)));
  ulTemp &= ~0x00000100;
  ulTemp |= (ulConfig & 0x00000100);
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ulTemp;
}


x86 assembly (clang, -O0):
<LPCConfigSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffeff,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xfffffffffffffeff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x100,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCConfigSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40080000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xfffffffffffffeff,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0xfffffffffffffeff,%rax
and    (%r14),%rax
and    $0x100,%ebx
or     %rax,%rbx
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LPCConfigSet(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, 1074266112
%8 = zext i1 %7 to i32
%9 = call i32 @DEBUG_ASSERT(i32 %8)
%10 = load i64, i64* %4
%11 = and i64 %10, -257
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %3
%16 = add i64 %15, 0
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
store i64 %18, i64* %5
%19 = load i64, i64* %5
%20 = and i64 %19, -257
store i64 %20, i64* %5
%21 = load i64, i64* %4
%22 = and i64 %21, 256
%23 = load i64, i64* %5
%24 = or i64 %23, %22
store i64 %24, i64* %5
%25 = load i64, i64* %5
%26 = load i64, i64* %3
%27 = add i64 %26, 0
%28 = inttoptr i64 %27 to i64*
store volatile i64 %25, i64* %28
ret void
}

LLVM IR (-O2):
define void @LPCConfigSet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074266112
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = and i64 %1, -257
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = inttoptr i64 %0 to i64*
%11 = load volatile i64, i64* %10
%12 = and i64 %11, -257
%13 = and i64 %1, 256
%14 = or i64 %12, %13
store volatile i64 %14, i64* %10
ret void
}