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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void USBHostPwrConfig(uint32_t ui32Base, uint32_t ui32Flags) {
  ASSERT(ui32Base == 0x40050000);
  ASSERT((ui32Flags & ~(0x00010000 | 0x00000300 | 0x00000040 | 0x00000020 |
                        0x00000003)) == 0);
  (*((volatile uint32_t *)(ui32Base + 0x00000430))) = ui32Flags >> 16;
  (*((volatile uint16_t *)(ui32Base + 0x00000400))) =
      (ui32Flags | ((*((volatile uint16_t *)(ui32Base + 0x00000400))) &
                    ~(0x00000300 | 0x00000040 | 0x00000020 | 0x00000003)));
}


x86 assembly (clang, -O0):
<USBHostPwrConfig>:
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    $0xfffefc9c,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x4(%rbp),%eax
add    $0x430,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x400,%eax
cltq
mov    (%rax),%eax
and    $0xfffffc9c,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x400,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrConfig>:
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
test   $0xfffefc9c,%ebx
sete   %dil
call   1030 <ASSERT@plt>
mov    %ebx,%eax
sar    $0x10,%eax
movslq %ebp,%rcx
mov    %eax,0x430(%rcx)
mov    $0xfffffc9c,%eax
and    0x400(%rcx),%eax
or     %ebx,%eax
mov    %eax,0x400(%rcx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @USBHostPwrConfig(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, -66404
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1072
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 %15, i32* %19
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1024
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = load volatile i32, i32* %24
%26 = and i32 %25, -868
%27 = or i32 %20, %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1024
%30 = sext i32 %29 to i64
%31 = inttoptr i64 %30 to i32*
store volatile i32 %27, i32* %31
ret void
}

LLVM IR (-O2):
define void @USBHostPwrConfig(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1074069504
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = and i32 %1, -66404
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @ASSERT(i32 %8)
%10 = ashr i32 %1, 16
%11 = add nsw i32 %0, 1072
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %10, i32* %13
%14 = add nsw i32 %0, 1024
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = and i32 %17, -868
%19 = or i32 %18, %1
store volatile i32 %19, i32* %16
ret void
}