#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 USBHostEndpointPing(uint32_t ui32Base, uint32_t ui32Endpoint,
                         bool bEnable) {
  ASSERT(ui32Base == 0x40050000);
  ASSERT((ui32Endpoint == 0x00000000));
  if (bEnable) {
    (*((volatile uint8_t *)(0x40050000 + 0x00000103))) &= ~0x00000008;
  } else {
    (*((volatile uint8_t *)(0x40050000 + 0x00000103))) |= 0x00000008;
  }
}


x86 assembly (clang, -O0):
<USBHostEndpointPing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0xc(%rbp)
je     1166 <USBHostEndpointPing+0x56>
mov    $0x40050103,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40050103,%eax
mov    %ecx,(%rax)
jmp    1177 <USBHostEndpointPing+0x67>
mov    $0x40050103,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x40050103,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostEndpointPing>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
xor    %eax,%eax
cmp    $0x40050000,%edi
sete   %al
mov    %eax,%edi
call   1030 <ASSERT@plt>
xor    %edi,%edi
test   %ebp,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %eax,%eax
test   %ebx,%ebx
sete   %al
mov    0x40050103,%ecx
and    $0xfffffff7,%ecx
lea    (%rcx,%rax,8),%eax
mov    %eax,0x40050103
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @USBHostEndpointPing(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1074069504
%9 = zext i1 %8 to i32
%10 = call i32 @ASSERT(i32 %9)
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load volatile i32, i32* inttoptr (i64 1074069763 to i32*)
%19 = and i32 %18, -9
store volatile i32 %19, i32* inttoptr (i64 1074069763 to i32*)
br label %23
20: ; preds = %3
%21 = load volatile i32, i32* inttoptr (i64 1074069763 to i32*)
%22 = or i32 %21, 8
store volatile i32 %22, i32* inttoptr (i64 1074069763 to i32*)
br label %23
23: ; preds = %20, %17
ret void
}

LLVM IR (-O2):
define void @USBHostEndpointPing(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 1074069504
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp eq i32 %1, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = icmp eq i32 %2, 0
%11 = load volatile i32, i32* inttoptr (i64 1074069763 to i32*)
%12 = and i32 %11, -9
%13 = select i1 %10, i32 8, i32 0
%14 = or i32 %12, %13
store volatile i32 %14, i32* inttoptr (i64 1074069763 to i32*)
ret void
}