#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 USBIntEnableControl(uint32_t ui32Base, uint32_t ui32Flags) {
  ASSERT(ui32Base == 0x40050000);
  ASSERT((ui32Flags & (~0x000003FF)) == 0);
  if (ui32Flags & 0x000000FF) {
    (*((volatile uint8_t *)(ui32Base + 0x0000000B))) |= ui32Flags;
  }
  if (ui32Flags & 0x00000100) {
    (*((volatile uint32_t *)(ui32Base + 0x00000408))) = 0x00000001;
  }
  if (ui32Flags & 0x00000200) {
    (*((volatile uint32_t *)(0x40050000 + 0x00000448))) = 0x00000001;
  }
}


x86 assembly (clang, -O0):
<USBIntEnableControl>:
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    -0x8(%rbp),%eax
and    $0xfffffc00,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
je     116c <USBIntEnableControl+0x5c>
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
add    $0xb,%eax
cltq
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     118d <USBIntEnableControl+0x7d>
mov    -0x4(%rbp),%eax
add    $0x408,%eax
cltq
movl   $0x1,(%rax)
mov    -0x8(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     11a9 <USBIntEnableControl+0x99>
mov    $0x40050448,%eax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntEnableControl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x40050000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x400,%ebx
setb   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
test   %bl,%bl
je     1143 <USBIntEnableControl+0x33>
or     %ebx,0xb(%rax)
test   $0x100,%ebx
je     1155 <USBIntEnableControl+0x45>
movl   $0x1,0x408(%rax)
test   $0x200,%ebx
je     1168 <USBIntEnableControl+0x58>
movl   $0x1,0x40050448
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @USBIntEnableControl(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 = and i32 %9, -1024
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = and i32 %14, 255
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %25
17: ; preds = %2
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 11
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = or i32 %23, %18
store volatile i32 %24, i32* %22
br label %25
25: ; preds = %17, %2
%26 = load i32, i32* %4
%27 = and i32 %26, 256
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1032
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
store volatile i32 1, i32* %33
br label %34
34: ; preds = %29, %25
%35 = load i32, i32* %4
%36 = and i32 %35, 512
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %34
store volatile i32 1, i32* inttoptr (i64 1074070600 to i32*)
br label %39
39: ; preds = %38, %34
ret void
}

LLVM IR (-O2):
define void @USBIntEnableControl(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 ult i32 %1, 1024
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = and i32 %1, 255
%10 = icmp eq i32 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = add nsw i32 %0, 11
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = or i32 %15, %1
store volatile i32 %16, i32* %14
br label %17
17: ; preds = %11, %2
%18 = and i32 %1, 256
%19 = icmp eq i32 %18, 0
br i1 %19, label %24, label %20
20: ; preds = %17
%21 = add nsw i32 %0, 1032
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
store volatile i32 1, i32* %23
br label %24
24: ; preds = %20, %17
%25 = and i32 %1, 512
%26 = icmp eq i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %24
store volatile i32 1, i32* inttoptr (i64 1074070600 to i32*)
br label %28
28: ; preds = %27, %24
ret void
}