#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EPIModeSet(uint32_t ui32Base, uint32_t ui32Mode) {
  ASSERT(ui32Base == 0x400D0000);
  ASSERT((ui32Mode == 0x00000010) || (ui32Mode == 0x00000011) ||
         (ui32Mode == 0x00000012) || (ui32Mode == 0x00000013) ||
         (ui32Mode == 0x00000000));
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ui32Mode;
}


x86 assembly (clang, -O0):
<EPIModeSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0x10,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1178 <EPIModeSet+0x68>
mov    $0x1,%al
cmpl   $0x11,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1178 <EPIModeSet+0x68>
mov    $0x1,%al
cmpl   $0x12,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1178 <EPIModeSet+0x68>
mov    $0x1,%al
cmpl   $0x13,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1178 <EPIModeSet+0x68>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIModeSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400d0000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
mov    %ebx,%eax
and    $0xfffffffc,%eax
cmp    $0x10,%eax
sete   %al
test   %ebx,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    %ebx,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @EPIModeSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1074593792
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 16
br i1 %10, label %23, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 17
br i1 %13, label %23, label %14
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 18
br i1 %16, label %23, label %17
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 19
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %4
%22 = icmp eq i32 %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 @ASSERT(i32 %25)
%27 = load i32, i32* %4
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 0
%30 = sext i32 %29 to i64
%31 = inttoptr i64 %30 to i32*
store volatile i32 %27, i32* %31
ret void
}

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