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


x86 assembly (clang, -O0):
<USBIntDisableControl>:
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     1175 <USBIntDisableControl+0x65>
mov    -0x8(%rbp),%edx
and    $0xff,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0xb,%eax
cltq
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     1196 <USBIntDisableControl+0x86>
mov    -0x4(%rbp),%eax
add    $0x408,%eax
cltq
movl   $0x0,(%rax)
mov    -0x8(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     11b2 <USBIntDisableControl+0xa2>
mov    $0x40050448,%eax
movl   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntDisableControl>:
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>
mov    %ebx,%ecx
movslq %ebp,%rax
and    $0xff,%ecx
je     114b <USBIntDisableControl+0x3b>
not    %ecx
and    %ecx,0xb(%rax)
test   $0x100,%ebx
je     115d <USBIntDisableControl+0x4d>
movl   $0x0,0x408(%rax)
test   $0x200,%ebx
je     1170 <USBIntDisableControl+0x60>
movl   $0x0,0x40050448
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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