#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 EPINonBlockingReadConfigure(uint32_t ui32Base, uint32_t ui32Channel,
                                 uint32_t ui32DataSize, uint32_t ui32Address) {
  uint32_t ui32Offset;
  ASSERT(ui32Base == 0x400D0000);
  ASSERT(ui32Channel < 2);
  ASSERT(ui32DataSize < 4);
  ASSERT(ui32Address < 0x20000000);
  ui32Offset = ui32Channel * (0x00000030 - 0x00000020);
  (*((volatile uint32_t *)(ui32Base + 0x00000020 + ui32Offset))) = ui32DataSize;
  (*((volatile uint32_t *)(ui32Base + 0x00000024 + ui32Offset))) = ui32Address;
}


x86 assembly (clang, -O0):
<EPINonBlockingReadConfigure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x400d0000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x2,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x4,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x20000000,-0x10(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x20,%eax
add    -0x14(%rbp),%eax
cltq
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x24,%eax
add    -0x14(%rbp),%eax
cltq
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadConfigure>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400d0000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x2,%ebx
setl   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%r15d
setl   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x20000000,%r14d
setl   %dil
call   1030 <ASSERT@plt>
shl    $0x4,%ebx
lea    (%rbx,%rbp,1),%eax
add    $0x20,%eax
cltq
mov    %r15d,(%rax)
lea    (%rbx,%rbp,1),%eax
add    $0x24,%eax
cltq
mov    %r14d,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @EPINonBlockingReadConfigure(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, 1074593792
%6 = zext i1 %5 to i32
%7 = tail call i32 @ASSERT(i32 %6)
%8 = icmp slt i32 %1, 2
%9 = zext i1 %8 to i32
%10 = tail call i32 @ASSERT(i32 %9)
%11 = icmp slt i32 %2, 4
%12 = zext i1 %11 to i32
%13 = tail call i32 @ASSERT(i32 %12)
%14 = icmp slt i32 %3, 536870912
%15 = zext i1 %14 to i32
%16 = tail call i32 @ASSERT(i32 %15)
%17 = shl nsw i32 %1, 4
%18 = add i32 %17, %0
%19 = add i32 %18, 32
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %2, i32* %21
%22 = add i32 %18, 36
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
store volatile i32 %3, i32* %24
ret void
}