#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 EPIConfigHB16Set(uint32_t ui32Base, uint32_t ui32Config,
                      uint32_t ui32MaxWait) {
  ASSERT(ui32Base == 0x400D0000);
  ASSERT(ui32MaxWait < 256);
  (*((volatile uint32_t *)(ui32Base + 0x00000014))) =
      ((ui32Config & 0x00000800) ? 0x04000000 : 0) |
      ((ui32Config & 0x00001600) << 15);
  ui32Config &= ~0x0000FF00;
  ui32Config |= ui32MaxWait << 8;
  (*((volatile uint32_t *)(ui32Base + 0x00000010))) = ui32Config;
}


x86 assembly (clang, -O0):
<EPIConfigHB16Set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x100,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%edx
and    $0x800,%edx
xor    %ecx,%ecx
mov    $0x4000000,%eax
cmp    $0x0,%edx
cmovne %eax,%ecx
mov    -0x8(%rbp),%eax
and    $0x1600,%eax
shl    $0xf,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x14,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0xffff00ff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigHB16Set>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
xor    %edi,%edi
cmp    $0x400d0000,%r14d
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x100,%ebx
setl   %dil
call   1030 <ASSERT@plt>
mov    %ebp,%eax
shl    $0xf,%eax
and    $0xf000000,%eax
movslq %r14d,%rcx
mov    %eax,0x14(%rcx)
and    $0xffff00ff,%ebp
shl    $0x8,%ebx
or     %ebp,%ebx
mov    %ebx,0x10(%rcx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @EPIConfigHB16Set(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1074593792
%9 = zext i1 %8 to i32
%10 = call i32 @ASSERT(i32 %9)
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 256
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
%15 = load i32, i32* %5
%16 = and i32 %15, 2048
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 67108864, i32 0
%20 = load i32, i32* %5
%21 = and i32 %20, 5632
%22 = shl i32 %21, 15
%23 = or i32 %19, %22
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 20
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
store volatile i32 %23, i32* %27
%28 = load i32, i32* %5
%29 = and i32 %28, -65281
store i32 %29, i32* %5
%30 = load i32, i32* %6
%31 = shl i32 %30, 8
%32 = load i32, i32* %5
%33 = or i32 %32, %31
store i32 %33, i32* %5
%34 = load i32, i32* %5
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 16
%37 = sext i32 %36 to i64
%38 = inttoptr i64 %37 to i32*
store volatile i32 %34, i32* %38
ret void
}

LLVM IR (-O2):
define void @EPIConfigHB16Set(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 1074593792
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp slt i32 %2, 256
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = shl i32 %1, 15
%11 = and i32 %10, 251658240
%12 = add nsw i32 %0, 20
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %11, i32* %14
%15 = and i32 %1, -65281
%16 = shl i32 %2, 8
%17 = or i32 %16, %15
%18 = add nsw i32 %0, 16
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %17, i32* %20
ret void
}