#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 USBHostEndpointStatusClear(uint32_t ui32Base, uint32_t ui32Endpoint,
                                uint32_t ui32Flags) {
  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))) &= ~ui32Flags;
  } else {
    (*((volatile uint8_t *)(ui32Base + 0x00000112 + (ui32Endpoint - 0x10)))) &=
        ~ui32Flags;
    (*((volatile uint8_t *)(ui32Base + 0x00000116 + (ui32Endpoint - 0x10)))) &=
        ~(ui32Flags >> 16);
  }
}


x86 assembly (clang, -O0):
<USBHostEndpointStatusClear>:
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>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     11a8 <USBHostEndpointStatusClear+0x98>
mov    $0x1,%al
cmpl   $0x10,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     11a8 <USBHostEndpointStatusClear+0x98>
mov    $0x1,%al
cmpl   $0x20,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     11a8 <USBHostEndpointStatusClear+0x98>
mov    $0x1,%al
cmpl   $0x30,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     11a8 <USBHostEndpointStatusClear+0x98>
mov    $0x1,%al
cmpl   $0x40,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     11a8 <USBHostEndpointStatusClear+0x98>
mov    $0x1,%al
cmpl   $0x50,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     11a8 <USBHostEndpointStatusClear+0x98>
mov    $0x1,%al
cmpl   $0x60,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     11a8 <USBHostEndpointStatusClear+0x98>
cmpl   $0x70,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0x8(%rbp)
jne    11da <USBHostEndpointStatusClear+0xca>
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x102,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
jmp    1219 <USBHostEndpointStatusClear+0x109>
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x112,%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
sar    $0x10,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x116,%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostEndpointStatusClear>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
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>
mov    %ebp,%eax
not    %eax
test   %ebx,%ebx
je     1172 <USBHostEndpointStatusClear+0x62>
lea    (%rbx,%r14,1),%ecx
add    $0x102,%ecx
movslq %ecx,%rcx
and    %eax,(%rcx)
sar    $0x10,%ebp
not    %ebp
add    %ebx,%r14d
add    $0x106,%r14d
mov    %ebp,%eax
jmp    1179 <USBHostEndpointStatusClear+0x69>
add    $0x102,%r14d
movslq %r14d,%rcx
and    %eax,(%rcx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @USBHostEndpointStatusClear(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
br i1 %12, label %34, label %13
13: ; preds = %3
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 16
br i1 %15, label %34, label %16
16: ; preds = %13
%17 = load i32, i32* %5
%18 = icmp eq i32 %17, 32
br i1 %18, label %34, label %19
19: ; preds = %16
%20 = load i32, i32* %5
%21 = icmp eq i32 %20, 48
br i1 %21, label %34, label %22
22: ; preds = %19
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 64
br i1 %24, label %34, label %25
25: ; preds = %22
%26 = load i32, i32* %5
%27 = icmp eq i32 %26, 80
br i1 %27, label %34, label %28
28: ; preds = %25
%29 = load i32, i32* %5
%30 = icmp eq i32 %29, 96
br i1 %30, label %34, label %31
31: ; preds = %28
%32 = load i32, i32* %5
%33 = icmp eq i32 %32, 112
br label %34
34: ; preds = %31, %28, %25, %22, %19, %16, %13, %3
%35 = phi i1 [ true, %28 ], [ true, %25 ], [ true, %22 ], [ true, %19 ], [ true, %16 ], [ true, %13 ], [ true, %3 ], [ %33, %31 ]
%36 = zext i1 %35 to i32
%37 = call i32 @ASSERT(i32 %36)
%38 = load i32, i32* %5
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %49
40: ; preds = %34
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 258
%45 = sext i32 %44 to i64
%46 = inttoptr i64 %45 to i32*
%47 = load volatile i32, i32* %46
%48 = and i32 %47, %42
store volatile i32 %48, i32* %46
br label %73
49: ; preds = %34
%50 = load i32, i32* %6
%51 = xor i32 %50, -1
%52 = load i32, i32* %4
%53 = add nsw i32 %52, 274
%54 = load i32, i32* %5
%55 = sub nsw i32 %54, 16
%56 = add nsw i32 %53, %55
%57 = sext i32 %56 to i64
%58 = inttoptr i64 %57 to i32*
%59 = load volatile i32, i32* %58
%60 = and i32 %59, %51
store volatile i32 %60, i32* %58
%61 = load i32, i32* %6
%62 = ashr i32 %61, 16
%63 = xor i32 %62, -1
%64 = load i32, i32* %4
%65 = add nsw i32 %64, 278
%66 = load i32, i32* %5
%67 = sub nsw i32 %66, 16
%68 = add nsw i32 %65, %67
%69 = sext i32 %68 to i64
%70 = inttoptr i64 %69 to i32*
%71 = load volatile i32, i32* %70
%72 = and i32 %71, %63
store volatile i32 %72, i32* %70
br label %73
73: ; preds = %49, %40
ret void
}

LLVM IR (-O2):
define void @USBHostEndpointStatusClear(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 = tail call i32 @llvm.fshl.i32(i32 %1, i32 %1, i32 28)
%9 = icmp ult i32 %8, 7
%10 = icmp eq i32 %1, 112
%11 = or i1 %10, %9
%12 = zext i1 %11 to i32
%13 = tail call i32 @ASSERT(i32 %12)
%14 = xor i32 %2, -1
br i1 %7, label %15, label %17
15: ; preds = %3
%16 = add nsw i32 %0, 258
br label %28
17: ; preds = %3
%18 = add nsw i32 %1, -16
%19 = add i32 %18, %0
%20 = add i32 %19, 274
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = and i32 %23, %14
store volatile i32 %24, i32* %22
%25 = ashr i32 %2, 16
%26 = xor i32 %25, -1
%27 = add i32 %19, 278
br label %28
28: ; preds = %17, %15
%29 = phi i32 [ %27, %17 ], [ %16, %15 ]
%30 = phi i32 [ %26, %17 ], [ %14, %15 ]
%31 = sext i32 %29 to i64
%32 = inttoptr i64 %31 to i32*
%33 = load volatile i32, i32* %32
%34 = and i32 %33, %30
store volatile i32 %34, i32* %32
ret void
}