#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 PECIDomainValid(unsigned long);
void PECIDomainConfigGet(unsigned long ulBase, unsigned long ulDomain,
                         unsigned long *pulHigh, unsigned long *pulLow) {
  unsigned long ulTemp;
  DEBUG_ASSERT(ulBase == 0x400B0000);
  DEBUG_ASSERT(PECIDomainValid(ulDomain));
  DEBUG_ASSERT(pulHigh != 0);
  DEBUG_ASSERT(pulLow != 0);
  ulTemp =
      (*((volatile unsigned long *)(ulBase + 0x00000010 + (ulDomain * 4))));
  *pulHigh = ((ulTemp && 0xFFFF0000) >> 16);
  *pulLow = ((ulTemp && 0x0000FFFF) >> 0);
}


x86 assembly (clang, -O0):
<PECIDomainConfigGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x400b0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x28(%rbp)
mov    %al,-0x29(%rbp)
je     11b5 <PECIDomainConfigGet+0x95>
mov    $0x1,%al
mov    %al,-0x29(%rbp)
jmp    11b5 <PECIDomainConfigGet+0x95>
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
cmpq   $0x0,-0x28(%rbp)
mov    %al,-0x2a(%rbp)
je     11e4 <PECIDomainConfigGet+0xc4>
mov    $0x1,%al
mov    %al,-0x2a(%rbp)
jmp    11e4 <PECIDomainConfigGet+0xc4>
mov    -0x2a(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
sar    $0x0,%eax
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIDomainConfigGet>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400b0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r12,%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %eax,%eax
cmpq   $0x0,0x10(%rbx,%r12,4)
setne  %al
movq   $0x0,(%r15)
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @PECIDomainConfigGet(i64 %0, i64 %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64*
%8 = alloca i64*
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%10 = load i64, i64* %5
%11 = icmp eq i64 %10, 1074462720
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %6
%15 = call i32 @PECIDomainValid(i64 %14)
%16 = call i32 @DEBUG_ASSERT(i32 %15)
%17 = load i64*, i64** %7
%18 = icmp ne i64* %17, null
%19 = zext i1 %18 to i32
%20 = call i32 @DEBUG_ASSERT(i32 %19)
%21 = load i64*, i64** %8
%22 = icmp ne i64* %21, null
%23 = zext i1 %22 to i32
%24 = call i32 @DEBUG_ASSERT(i32 %23)
%25 = load i64, i64* %5
%26 = add i64 %25, 16
%27 = load i64, i64* %6
%28 = mul i64 %27, 4
%29 = add i64 %26, %28
%30 = inttoptr i64 %29 to i64*
%31 = load volatile i64, i64* %30
store i64 %31, i64* %9
%32 = load i64, i64* %9
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %4
br label %35
35: ; preds = %34, %4
%36 = phi i1 [ false, %4 ], [ true, %34 ]
%37 = zext i1 %36 to i32
%38 = ashr i32 %37, 16
%39 = sext i32 %38 to i64
%40 = load i64*, i64** %7
store i64 %39, i64* %40
%41 = load i64, i64* %9
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %35
br label %44
44: ; preds = %43, %35
%45 = phi i1 [ false, %35 ], [ true, %43 ]
%46 = zext i1 %45 to i32
%47 = ashr i32 %46, 0
%48 = sext i32 %47 to i64
%49 = load i64*, i64** %8
store i64 %48, i64* %49
ret void
}

LLVM IR (-O2):
define void @PECIDomainConfigGet(i64 %0, i64 %1, i64* writeonly %2, i64* writeonly %3) {
%5 = icmp eq i64 %0, 1074462720
%6 = zext i1 %5 to i32
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = tail call i32 @PECIDomainValid(i64 %1)
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = icmp ne i64* %2, null
%11 = zext i1 %10 to i32
%12 = tail call i32 @DEBUG_ASSERT(i32 %11)
%13 = icmp ne i64* %3, null
%14 = zext i1 %13 to i32
%15 = tail call i32 @DEBUG_ASSERT(i32 %14)
%16 = add i64 %0, 16
%17 = shl i64 %1, 2
%18 = add i64 %16, %17
%19 = inttoptr i64 %18 to i64*
%20 = load volatile i64, i64* %19
%21 = icmp ne i64 %20, 0
store i64 0, i64* %2
%22 = zext i1 %21 to i64
store i64 %22, i64* %3
ret void
}