#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;

/* Variables and functions */
uint32_t USBIntStatusControl(uint32_t ui32Base) {
  uint32_t ui32Status;
  ;
  ui32Status = (*((volatile unsigned char *)(ui32Base + 0x0000000A)));
  if ((*((volatile unsigned long *)(ui32Base + 0x0000040C))) & 0x00000001) {
    ui32Status |= 0x00000100;
    (*((volatile unsigned char *)(ui32Base + 0x0000040C))) |= 0x00000001;
  }
  if ((*((volatile unsigned long *)(0x40050000 + 0x0000044C))) & 0x00000001) {
    ui32Status |= 0x00000200;
    (*((volatile unsigned long *)(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),%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40c,%eax
cltq
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1151 <USBIntStatusControl+0x51>
mov    -0x8(%rbp),%eax
or     $0x100,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40c,%eax
cltq
mov    (%rax),%cl
movzbl %cl,%ecx
or     $0x1,%ecx
mov    %cl,(%rax)
mov    $0x4005044c,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1186 <USBIntStatusControl+0x86>
mov    -0x8(%rbp),%eax
or     $0x200,%eax
mov    %eax,-0x8(%rbp)
mov    $0x4005044c,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x4005044c,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntStatusControl>:
movslq %edi,%rcx
movzbl 0xa(%rcx),%eax
testq  $0x1,0x40c(%rcx)
jne    1123 <USBIntStatusControl+0x23>
testq  $0x1,0x4005044c
jne    113d <USBIntStatusControl+0x3d>
ret
or     $0x100,%eax
orb    $0x1,0x40c(%rcx)
testq  $0x1,0x4005044c
je     1122 <USBIntStatusControl+0x22>
or     $0x200,%eax
orq    $0x1,0x4005044c
40 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 i8*
%8 = load volatile i8, i8* %7
%9 = zext i8 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1036
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = and i64 %14, 1
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %28
17: ; preds = %1
%18 = load i32, i32* %3
%19 = or i32 %18, 256
store i32 %19, i32* %3
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1036
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i8*
%24 = load volatile i8, i8* %23
%25 = zext i8 %24 to i32
%26 = or i32 %25, 1
%27 = trunc i32 %26 to i8
store volatile i8 %27, i8* %23
br label %28
28: ; preds = %17, %1
%29 = load volatile i64, i64* inttoptr (i64 1074070604 to i64*)
%30 = and i64 %29, 1
%31 = icmp ne i64 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = load i32, i32* %3
%34 = or i32 %33, 512
store i32 %34, i32* %3
%35 = load volatile i64, i64* inttoptr (i64 1074070604 to i64*)
%36 = or i64 %35, 1
store volatile i64 %36, i64* inttoptr (i64 1074070604 to i64*)
br label %37
37: ; preds = %32, %28
%38 = load i32, i32* %3
ret i32 %38
}

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 i8*
%5 = load volatile i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add nsw i32 %0, 1036
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, 1
%12 = icmp eq i64 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %1
%14 = or i32 %6, 256
%15 = inttoptr i64 %8 to i8*
%16 = load volatile i8, i8* %15
%17 = or i8 %16, 1
store volatile i8 %17, i8* %15
br label %18
18: ; preds = %13, %1
%19 = phi i32 [ %14, %13 ], [ %6, %1 ]
%20 = load volatile i64, i64* inttoptr (i64 1074070604 to i64*)
%21 = and i64 %20, 1
%22 = icmp eq i64 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %18
%24 = or i32 %19, 512
%25 = load volatile i64, i64* inttoptr (i64 1074070604 to i64*)
%26 = or i64 %25, 1
store volatile i64 %26, i64* inttoptr (i64 1074070604 to i64*)
br label %27
27: ; preds = %23, %18
%28 = phi i32 [ %24, %23 ], [ %19, %18 ]
ret i32 %28
}