#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 EPINonBlockingReadStart(uint32_t ui32Base, uint32_t ui32Channel,
                             uint32_t ui32Count) {
  uint32_t ui32Offset;
  ASSERT(ui32Base == 0x400D0000);
  ASSERT(ui32Channel < 2);
  ASSERT(ui32Count < 4096);
  ui32Offset = ui32Channel * (0x00000038 - 0x00000028);
  (*((volatile uint32_t *)(ui32Base + 0x00000028 + ui32Offset))) = ui32Count;
}


x86 assembly (clang, -O0):
<EPINonBlockingReadStart>:
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   $0x2,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x1000,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x28,%eax
add    -0x10(%rbp),%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadStart>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
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    $0x1000,%r14d
setl   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
shl    $0x4,%rax
movslq %ebp,%rcx
mov    %r14d,0x28(%rcx,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @EPINonBlockingReadStart(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 %1, 2
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = icmp slt i32 %2, 4096
%11 = zext i1 %10 to i32
%12 = tail call i32 @ASSERT(i32 %11)
%13 = shl nsw i32 %1, 4
%14 = add nsw i32 %0, 40
%15 = add nsw i32 %14, %13
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %2, i32* %17
ret void
}