#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 */
uint32_t USBIntStatusControl(uint32_t ui32Base) {
  uint32_t ui32Status;
  ;
  ui32Status = (*((volatile uint8_t *)(ui32Base + 0x0000000A)));
  if ((*((volatile uint32_t *)(ui32Base + 0x0000040C))) & 0x00000001) {
    ui32Status |= 0x00000100;
    (*((volatile uint8_t *)(ui32Base + 0x0000040C))) |= 0x00000001;
  }
  if ((*((volatile uint32_t *)(0x40050000 + 0x0000044C))) & 0x00000001) {
    ui32Status |= 0x00000200;
    (*((volatile uint32_t *)(0x40050000 + 0x0000044C))) |= 0x00000001;
  }
  return (ui32Status);
}


x86 assembly (clang, -O0):
<USBIntStatusControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40c,%eax
cltq
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1148 <USBIntStatusControl+0x48>
mov    -0x8(%rbp),%eax
or     $0x100,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40c,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
mov    $0x4005044c,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1177 <USBIntStatusControl+0x77>
mov    -0x8(%rbp),%eax
or     $0x200,%eax
mov    %eax,-0x8(%rbp)
mov    $0x4005044c,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x4005044c,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntStatusControl>:
movslq %edi,%rcx
mov    0xa(%rcx),%eax
testl  $0x1,0x40c(%rcx)
jne    1120 <USBIntStatusControl+0x20>
testl  $0x1,0x4005044c
jne    1139 <USBIntStatusControl+0x39>
ret
or     $0x100,%eax
orl    $0x1,0x40c(%rcx)
testl  $0x1,0x4005044c
je     111f <USBIntStatusControl+0x1f>
or     $0x200,%eax
orl    $0x1,0x4005044c
01
ret

LLVM IR (-O0):
define i32 @USBIntStatusControl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 10
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1036
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %25
16: ; preds = %1
%17 = load i32, i32* %3
%18 = or i32 %17, 256
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1036
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = or i32 %23, 1
store volatile i32 %24, i32* %22
br label %25
25: ; preds = %16, %1
%26 = load volatile i32, i32* inttoptr (i64 1074070604 to i32*)
%27 = and i32 %26, 1
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %25
%30 = load i32, i32* %3
%31 = or i32 %30, 512
store i32 %31, i32* %3
%32 = load volatile i32, i32* inttoptr (i64 1074070604 to i32*)
%33 = or i32 %32, 1
store volatile i32 %33, i32* inttoptr (i64 1074070604 to i32*)
br label %34
34: ; preds = %29, %25
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @USBIntStatusControl(i32 %0) {
%2 = add nsw i32 %0, 10
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = add nsw i32 %0, 1036
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, 1
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %1
%13 = or i32 %5, 256
%14 = load volatile i32, i32* %8
%15 = or i32 %14, 1
store volatile i32 %15, i32* %8
br label %16
16: ; preds = %12, %1
%17 = phi i32 [ %13, %12 ], [ %5, %1 ]
%18 = load volatile i32, i32* inttoptr (i64 1074070604 to i32*)
%19 = and i32 %18, 1
%20 = icmp eq i32 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %16
%22 = or i32 %17, 512
%23 = load volatile i32, i32* inttoptr (i64 1074070604 to i32*)
%24 = or i32 %23, 1
store volatile i32 %24, i32* inttoptr (i64 1074070604 to i32*)
br label %25
25: ; preds = %21, %16
%26 = phi i32 [ %22, %21 ], [ %17, %16 ]
ret i32 %26
}