#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 */
int /*<<< orphan*/ printf(char *, ...);
void ohci_dumprhstat(uint32_t reg) {
  printf("HubStatus: %08X  ", reg);
  if (reg & (((uint32_t)(1)) << ((uint32_t)(0))))
    printf("LocalPowerStatus ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(1))))
    printf("OverCurrent ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(15))))
    printf("DeviceRemoteWakeupEnable ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(16))))
    printf("LocalPowerStatusChange ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(17))))
    printf("OverCurrentIndicatorChange ");
  printf("\n");
}


x86 assembly (clang, -O0):
<ohci_dumprhstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1149 <ohci_dumprhstat+0x39>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1166 <ohci_dumprhstat+0x56>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1185 <ohci_dumprhstat+0x75>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     11a4 <ohci_dumprhstat+0x94>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x20000,%eax
cmp    $0x0,%eax
je     11c3 <ohci_dumprhstat+0xb3>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ohci_dumprhstat>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1,%bl
jne    116e <ohci_dumprhstat+0x4e>
test   $0x2,%bl
jne    1181 <ohci_dumprhstat+0x61>
test   $0x8000,%ebx
jne    1197 <ohci_dumprhstat+0x77>
test   $0x10000,%ebx
jne    11ad <ohci_dumprhstat+0x8d>
test   $0x20000,%ebx
je     1163 <ohci_dumprhstat+0x43>
lea    0xf07(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x2,%bl
je     113d <ohci_dumprhstat+0x1d>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x8000,%ebx
je     1145 <ohci_dumprhstat+0x25>
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x10000,%ebx
je     114d <ohci_dumprhstat+0x2d>
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x20000,%ebx
jne    1155 <ohci_dumprhstat+0x35>
jmp    1163 <ohci_dumprhstat+0x43>

LLVM IR (-O0):
@.str = [18 x i8] c"HubStatus: %08X \00"
@.str.1 = [18 x i8] c"LocalPowerStatus \00"
@.str.2 = [13 x i8] c"OverCurrent \00"
@.str.3 = [26 x i8] c"DeviceRemoteWakeupEnable \00"
@.str.4 = [24 x i8] c"LocalPowerStatusChange \00"
@.str.5 = [28 x i8] c"OverCurrentIndicatorChange \00"
@.str.6 = [2 x i8] c"\0A\00"
define void @ohci_dumprhstat(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %2
%12 = and i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %2
%18 = and i32 %17, 32768
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %2
%24 = and i32 %23, 65536
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = load i32, i32* %2
%30 = and i32 %29, 131072
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
br label %34
34: ; preds = %32, %28
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"HubStatus: %08X \00"
@.str.1 = [18 x i8] c"LocalPowerStatus \00"
@.str.2 = [13 x i8] c"OverCurrent \00"
@.str.3 = [26 x i8] c"DeviceRemoteWakeupEnable \00"
@.str.4 = [24 x i8] c"LocalPowerStatusChange \00"
@.str.5 = [28 x i8] c"OverCurrentIndicatorChange \00"
define void @ohci_dumprhstat(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = and i32 %0, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = and i32 %0, 32768
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = and i32 %0, 65536
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = and i32 %0, 131072
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = tail call i32 @putchar(i32 10)
ret void
}