#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 EPIModeSet(unsigned long ulBase, unsigned long ulMode) {
  DEBUG_ASSERT(ulBase == 0x400D0000);
  DEBUG_ASSERT((ulMode == 0x00000010) || (ulMode == 0x00000011) ||
               (ulMode == 0x00000012) || (ulMode == 0x00000013) ||
               (ulMode == 0x00000000));
  (*((volatile unsigned long *)(ulBase + 0x00000000))) = ulMode;
}


x86 assembly (clang, -O0):
<EPIModeSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x400d0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%al
cmpq   $0x10,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1180 <EPIModeSet+0x70>
mov    $0x1,%al
cmpq   $0x11,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1180 <EPIModeSet+0x70>
mov    $0x1,%al
cmpq   $0x12,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1180 <EPIModeSet+0x70>
mov    $0x1,%al
cmpq   $0x13,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1180 <EPIModeSet+0x70>
cmpq   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIModeSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x400d0000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,%rax
and    $0xfffffffffffffffc,%rax
cmp    $0x10,%rax
sete   %al
test   %rbx,%rbx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @EPIModeSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074593792
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = icmp eq i64 %9, 16
br i1 %10, label %23, label %11
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp eq i64 %12, 17
br i1 %13, label %23, label %14
14: ; preds = %11
%15 = load i64, i64* %4
%16 = icmp eq i64 %15, 18
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = load i64, i64* %4
%19 = icmp eq i64 %18, 19
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i64, i64* %4
%22 = icmp eq i64 %21, 0
br label %23
23: ; preds = %20, %17, %14, %11, %2
%24 = phi i1 [ true, %17 ], [ true, %14 ], [ true, %11 ], [ true, %2 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
%26 = call i32 @DEBUG_ASSERT(i32 %25)
%27 = load i64, i64* %4
%28 = load i64, i64* %3
%29 = add i64 %28, 0
%30 = inttoptr i64 %29 to i64*
store volatile i64 %27, i64* %30
ret void
}

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