#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 uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBHostEndpointDataAck(uint32_t ui32Base, uint32_t ui32Endpoint) {
  ASSERT(ui32Base == 0x40050000);
  ASSERT((ui32Endpoint == 0x00000000) || (ui32Endpoint == 0x00000010) ||
         (ui32Endpoint == 0x00000020) || (ui32Endpoint == 0x00000030) ||
         (ui32Endpoint == 0x00000040) || (ui32Endpoint == 0x00000050) ||
         (ui32Endpoint == 0x00000060) || (ui32Endpoint == 0x00000070));
  if (ui32Endpoint == 0x00000000) {
    (*((volatile uint8_t *)(ui32Base + 0x00000102))) &= ~0x00000001;
  } else {
    (*((volatile uint8_t *)(ui32Base + 0x00000116 + (ui32Endpoint - 0x10)))) &=
        ~(0x00000001);
  }
}


x86 assembly (clang, -O0):
<USBHostEndpointDataAck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     11a5 <USBHostEndpointDataAck+0x95>
mov    $0x1,%al
cmpl   $0x10,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     11a5 <USBHostEndpointDataAck+0x95>
mov    $0x1,%al
cmpl   $0x20,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     11a5 <USBHostEndpointDataAck+0x95>
mov    $0x1,%al
cmpl   $0x30,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     11a5 <USBHostEndpointDataAck+0x95>
mov    $0x1,%al
cmpl   $0x40,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     11a5 <USBHostEndpointDataAck+0x95>
mov    $0x1,%al
cmpl   $0x50,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     11a5 <USBHostEndpointDataAck+0x95>
mov    $0x1,%al
cmpl   $0x60,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     11a5 <USBHostEndpointDataAck+0x95>
cmpl   $0x70,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0x8(%rbp)
jne    11d2 <USBHostEndpointDataAck+0xc2>
mov    -0x4(%rbp),%eax
add    $0x102,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
jmp    11eb <USBHostEndpointDataAck+0xdb>
mov    -0x4(%rbp),%eax
add    $0x116,%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostEndpointDataAck>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
xor    %edi,%edi
cmp    $0x40050000,%r14d
sete   %dil
call   1030 <ASSERT@plt>
mov    %ebx,%eax
rol    $0x1c,%eax
cmp    $0x7,%eax
setb   %al
cmp    $0x70,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <ASSERT@plt>
lea    0x102(%r14),%eax
test   %ebx,%ebx
lea    0x106(%r14,%rbx,1),%ecx
cmove  %eax,%ecx
movslq %ecx,%rax
andl   $0xfffffffe,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @USBHostEndpointDataAck(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1074069504
%7 = zext i1 %6 to i32
%8 = call i32 @ASSERT(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 0
br i1 %10, label %32, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 16
br i1 %13, label %32, label %14
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 32
br i1 %16, label %32, label %17
17: ; preds = %14
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 48
br i1 %19, label %32, label %20
20: ; preds = %17
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 64
br i1 %22, label %32, label %23
23: ; preds = %20
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 80
br i1 %25, label %32, label %26
26: ; preds = %23
%27 = load i32, i32* %4
%28 = icmp eq i32 %27, 96
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load i32, i32* %4
%31 = icmp eq i32 %30, 112
br label %32
32: ; preds = %29, %26, %23, %20, %17, %14, %11, %2
%33 = phi i1 [ true, %26 ], [ true, %23 ], [ true, %20 ], [ true, %17 ], [ true, %14 ], [ true, %11 ], [ true, %2 ], [ %31, %29 ]
%34 = zext i1 %33 to i32
%35 = call i32 @ASSERT(i32 %34)
%36 = load i32, i32* %4
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %45
38: ; preds = %32
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 258
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i32*
%43 = load volatile i32, i32* %42
%44 = and i32 %43, -2
store volatile i32 %44, i32* %42
br label %55
45: ; preds = %32
%46 = load i32, i32* %3
%47 = add nsw i32 %46, 278
%48 = load i32, i32* %4
%49 = sub nsw i32 %48, 16
%50 = add nsw i32 %47, %49
%51 = sext i32 %50 to i64
%52 = inttoptr i64 %51 to i32*
%53 = load volatile i32, i32* %52
%54 = and i32 %53, -2
store volatile i32 %54, i32* %52
br label %55
55: ; preds = %45, %38
ret void
}

LLVM IR (-O2):
define void @USBHostEndpointDataAck(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074069504
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = icmp eq i32 %1, 0
%7 = tail call i32 @llvm.fshl.i32(i32 %1, i32 %1, i32 28)
%8 = icmp ult i32 %7, 7
%9 = icmp eq i32 %1, 112
%10 = or i1 %9, %8
%11 = zext i1 %10 to i32
%12 = tail call i32 @ASSERT(i32 %11)
%13 = add i32 %0, 262
%14 = add i32 %13, %1
%15 = add nsw i32 %0, 258
%16 = select i1 %6, i32 %15, i32 %14
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = and i32 %19, -2
store volatile i32 %20, i32* %18
ret void
}