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

/* Variables and functions */
void USBHostLPMSend(uint32_t ui32Base, uint32_t ui32Address,
                    uint32_t ui32Endpoint) {
  uint32_t ui32Reg;
  ;
  ;
  (*((volatile uint8_t *)(ui32Base + 0x00000365))) = ui32Address;
  ui32Reg = (*((volatile uint16_t *)(ui32Base + 0x00000360))) & ~0x0000F000;
  ui32Reg |= (((ui32Endpoint) >> 4) << 12);
  (*((volatile uint16_t *)(ui32Base + 0x00000360))) = ui32Reg;
  (*((volatile uint8_t *)(ui32Base + 0x00000362))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<USBHostLPMSend>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x365,%eax
cltq
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x360,%eax
cltq
mov    (%rax),%eax
and    $0xffff0fff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x4,%eax
shl    $0xc,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x360,%eax
cltq
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x362,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostLPMSend>:
movslq %edi,%rax
mov    %esi,0x365(%rax)
mov    $0xffff0fff,%ecx
and    0x360(%rax),%ecx
and    $0xfffffff0,%edx
shl    $0x8,%edx
or     %ecx,%edx
mov    %edx,0x360(%rax)
orl    $0x1,0x362(%rax)
ret

LLVM IR (-O0):
define void @USBHostLPMSend(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 869
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %8, i32* %12
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 864
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = and i32 %17, -61441
store i32 %18, i32* %7
%19 = load i32, i32* %6
%20 = ashr i32 %19, 4
%21 = shl i32 %20, 12
%22 = load i32, i32* %7
%23 = or i32 %22, %21
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 864
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i32*
store volatile i32 %24, i32* %28
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 866
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to i32*
%33 = load volatile i32, i32* %32
%34 = or i32 %33, 1
store volatile i32 %34, i32* %32
ret void
}

LLVM IR (-O2):
define void @USBHostLPMSend(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 869
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %1, i32* %6
%7 = add nsw i32 %0, 864
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, -61441
%12 = shl i32 %2, 8
%13 = and i32 %12, -4096
%14 = or i32 %11, %13
store volatile i32 %14, i32* %9
%15 = add nsw i32 %0, 866
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
%19 = or i32 %18, 1
store volatile i32 %19, i32* %17
ret void
}