#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 EPINonBlockingReadConfigure(unsigned long ulBase, unsigned long ulChannel,
                                 unsigned long ulDataSize,
                                 unsigned long ulAddress) {
  unsigned long ulOffset;
  DEBUG_ASSERT(ulBase == 0x400D0000);
  DEBUG_ASSERT(ulChannel < 2);
  DEBUG_ASSERT(ulDataSize < 4);
  DEBUG_ASSERT(ulAddress < 0x20000000);
  ulOffset = ulChannel * (0x00000030 - 0x00000020);
  (*((volatile unsigned long *)(ulBase + 0x00000020 + ulOffset))) = ulDataSize;
  (*((volatile unsigned long *)(ulBase + 0x00000024 + ulOffset))) = ulAddress;
}


x86 assembly (clang, -O0):
<EPINonBlockingReadConfigure>:
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   $0x400d0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x2,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x4,-0x18(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x20000000,-0x20(%rbp)
20
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x20,%rax
add    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x24,%rax
add    -0x28(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadConfigure>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
xor    %edi,%edi
cmp    $0x400d0000,%r12
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x2,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%r15
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x20000000,%r14
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
shl    $0x4,%rbx
mov    %r15,0x20(%rbx,%r12,1)
mov    %r14,0x24(%rbx,%r12,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @EPINonBlockingReadConfigure(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, 1074593792
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %6
%15 = icmp ult i64 %14, 2
%16 = zext i1 %15 to i32
%17 = call i32 @DEBUG_ASSERT(i32 %16)
%18 = load i64, i64* %7
%19 = icmp ult i64 %18, 4
%20 = zext i1 %19 to i32
%21 = call i32 @DEBUG_ASSERT(i32 %20)
%22 = load i64, i64* %8
%23 = icmp ult i64 %22, 536870912
%24 = zext i1 %23 to i32
%25 = call i32 @DEBUG_ASSERT(i32 %24)
%26 = load i64, i64* %6
%27 = mul i64 %26, 16
store i64 %27, i64* %9
%28 = load i64, i64* %7
%29 = load i64, i64* %5
%30 = add i64 %29, 32
%31 = load i64, i64* %9
%32 = add i64 %30, %31
%33 = inttoptr i64 %32 to i64*
store volatile i64 %28, i64* %33
%34 = load i64, i64* %8
%35 = load i64, i64* %5
%36 = add i64 %35, 36
%37 = load i64, i64* %9
%38 = add i64 %36, %37
%39 = inttoptr i64 %38 to i64*
store volatile i64 %34, i64* %39
ret void
}

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