#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 EPINonBlockingReadStart(unsigned long ulBase, unsigned long ulChannel,
                             unsigned long ulCount) {
  unsigned long ulOffset;
  DEBUG_ASSERT(ulBase == 0x400D0000);
  DEBUG_ASSERT(ulChannel < 2);
  DEBUG_ASSERT(ulCount < 4096);
  ulOffset = ulChannel * (0x00000038 - 0x00000028);
  (*((volatile unsigned long *)(ulBase + 0x00000028 + ulOffset))) = ulCount;
}


x86 assembly (clang, -O0):
<EPINonBlockingReadStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%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   $0x1000,-0x18(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x28,%rax
add    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadStart>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
cmp    $0x400d0000,%r15
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x2,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x1000,%r14
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
shl    $0x4,%rbx
mov    %r14,0x28(%r15,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @EPINonBlockingReadStart(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 1074593792
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %5
%13 = icmp ult i64 %12, 2
%14 = zext i1 %13 to i32
%15 = call i32 @DEBUG_ASSERT(i32 %14)
%16 = load i64, i64* %6
%17 = icmp ult i64 %16, 4096
%18 = zext i1 %17 to i32
%19 = call i32 @DEBUG_ASSERT(i32 %18)
%20 = load i64, i64* %5
%21 = mul i64 %20, 16
store i64 %21, i64* %7
%22 = load i64, i64* %6
%23 = load i64, i64* %4
%24 = add i64 %23, 40
%25 = load i64, i64* %7
%26 = add i64 %24, %25
%27 = inttoptr i64 %26 to i64*
store volatile i64 %22, i64* %27
ret void
}

LLVM IR (-O2):
define void @EPINonBlockingReadStart(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %0, 1074593792
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = icmp ult i64 %1, 2
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = icmp ult i64 %2, 4096
%11 = zext i1 %10 to i32
%12 = tail call i32 @DEBUG_ASSERT(i32 %11)
%13 = shl i64 %1, 4
%14 = add i64 %0, 40
%15 = add i64 %14, %13
%16 = inttoptr i64 %15 to i64*
store volatile i64 %2, i64* %16
ret void
}