#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_dumpportstat(int idx, uint32_t reg) {
  printf("Port %d: %08X  ", idx, reg);
  if (reg & (((uint32_t)(1)) << ((uint32_t)(0))))
    printf("Connected ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(1))))
    printf("PortEnabled ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(2))))
    printf("PortSuspended ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(3))))
    printf("PortOverCurrent ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(4))))
    printf("PortReset ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(8))))
    printf("PortPowered ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(9))))
    printf("LowSpeed ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(16))))
    printf("ConnectStatusChange ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(17))))
    printf("PortEnableStatusChange ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(18))))
    printf("PortSuspendStatusChange ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(19))))
    printf("OverCurrentIndicatorChange ");
  if (reg & (((uint32_t)(1)) << ((uint32_t)(20))))
    printf("PortResetStatusChange ");
  printf("\n");
}


x86 assembly (clang, -O0):
<ohci_dumpportstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <ohci_dumpportstat+0x3f>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     116c <ohci_dumpportstat+0x5c>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1189 <ohci_dumpportstat+0x79>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11a6 <ohci_dumpportstat+0x96>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     11c3 <ohci_dumpportstat+0xb3>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     11e2 <ohci_dumpportstat+0xd2>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     1201 <ohci_dumpportstat+0xf1>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     1220 <ohci_dumpportstat+0x110>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x20000,%eax
cmp    $0x0,%eax
je     123f <ohci_dumpportstat+0x12f>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x40000,%eax
cmp    $0x0,%eax
je     125e <ohci_dumpportstat+0x14e>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x80000,%eax
cmp    $0x0,%eax
je     127d <ohci_dumpportstat+0x16d>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x100000,%eax
cmp    $0x0,%eax
je     129c <ohci_dumpportstat+0x18c>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ohci_dumpportstat>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1,%bl
jne    11cb <ohci_dumpportstat+0xab>
test   $0x2,%bl
jne    11e2 <ohci_dumpportstat+0xc2>
test   $0x4,%bl
jne    11f9 <ohci_dumpportstat+0xd9>
test   $0x8,%bl
jne    1210 <ohci_dumpportstat+0xf0>
test   $0x10,%bl
jne    1227 <ohci_dumpportstat+0x107>
test   $0x100,%ebx
jne    1241 <ohci_dumpportstat+0x121>
test   $0x200,%ebx
jne    125b <ohci_dumpportstat+0x13b>
test   $0x10000,%ebx
jne    1275 <ohci_dumpportstat+0x155>
test   $0x20000,%ebx
jne    128f <ohci_dumpportstat+0x16f>
test   $0x40000,%ebx
jne    12a9 <ohci_dumpportstat+0x189>
test   $0x80000,%ebx
jne    12c3 <ohci_dumpportstat+0x1a3>
test   $0x100000,%ebx
je     11c0 <ohci_dumpportstat+0xa0>
lea    0xf13(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>
lea    0xe3e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x2,%bl
je     1147 <ohci_dumpportstat+0x27>
lea    0xe32(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x4,%bl
je     1150 <ohci_dumpportstat+0x30>
lea    0xe28(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x8,%bl
je     1159 <ohci_dumpportstat+0x39>
lea    0xe20(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x10,%bl
je     1162 <ohci_dumpportstat+0x42>
lea    0xe1a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x100,%ebx
je     116e <ohci_dumpportstat+0x4e>
lea    0xe0b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x200,%ebx
je     117a <ohci_dumpportstat+0x5a>
lea    0xdfe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x10000,%ebx
je     1186 <ohci_dumpportstat+0x66>
lea    0xdee(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x20000,%ebx
je     1192 <ohci_dumpportstat+0x72>
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x40000,%ebx
je     119e <ohci_dumpportstat+0x7e>
lea    0xde7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x80000,%ebx
je     11aa <ohci_dumpportstat+0x8a>
lea    0xde6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x100000,%ebx
jne    11b2 <ohci_dumpportstat+0x92>
jmp    11c0 <ohci_dumpportstat+0xa0>

LLVM IR (-O0):
@.str = [16 x i8] c"Port %d: %08X \00"
@.str.1 = [11 x i8] c"Connected \00"
@.str.2 = [13 x i8] c"PortEnabled \00"
@.str.3 = [15 x i8] c"PortSuspended \00"
@.str.4 = [17 x i8] c"PortOverCurrent \00"
@.str.5 = [11 x i8] c"PortReset \00"
@.str.6 = [13 x i8] c"PortPowered \00"
@.str.7 = [10 x i8] c"LowSpeed \00"
@.str.8 = [21 x i8] c"ConnectStatusChange \00"
@.str.9 = [24 x i8] c"PortEnableStatusChange \00"
@.str.10 = [25 x i8] c"PortSuspendStatusChange \00"
@.str.11 = [28 x i8] c"OverCurrentIndicatorChange \00"
@.str.12 = [23 x i8] c"PortResetStatusChange \00"
@.str.13 = [2 x i8] c"\0A\00"
define void @ohci_dumpportstat(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 = load i32, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %4
%15 = and i32 %14, 2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
%20 = load i32, i32* %4
%21 = and i32 %20, 4
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %19
%26 = load i32, i32* %4
%27 = and i32 %26, 8
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %31
31: ; preds = %29, %25
%32 = load i32, i32* %4
%33 = and i32 %32, 16
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %37
37: ; preds = %35, %31
%38 = load i32, i32* %4
%39 = and i32 %38, 256
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %43
43: ; preds = %41, %37
%44 = load i32, i32* %4
%45 = and i32 %44, 512
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %49
49: ; preds = %47, %43
%50 = load i32, i32* %4
%51 = and i32 %50, 65536
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %49
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %55
55: ; preds = %53, %49
%56 = load i32, i32* %4
%57 = and i32 %56, 131072
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %55
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
br label %61
61: ; preds = %59, %55
%62 = load i32, i32* %4
%63 = and i32 %62, 262144
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
br label %67
67: ; preds = %65, %61
%68 = load i32, i32* %4
%69 = and i32 %68, 524288
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
br label %73
73: ; preds = %71, %67
%74 = load i32, i32* %4
%75 = and i32 %74, 1048576
%76 = icmp ne i32 %75, 0
br i1 %76, label %77, label %79
77: ; preds = %73
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
br label %79
79: ; preds = %77, %73
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Port %d: %08X \00"
@.str.1 = [11 x i8] c"Connected \00"
@.str.2 = [13 x i8] c"PortEnabled \00"
@.str.3 = [15 x i8] c"PortSuspended \00"
@.str.4 = [17 x i8] c"PortOverCurrent \00"
@.str.5 = [11 x i8] c"PortReset \00"
@.str.6 = [13 x i8] c"PortPowered \00"
@.str.7 = [10 x i8] c"LowSpeed \00"
@.str.8 = [21 x i8] c"ConnectStatusChange \00"
@.str.9 = [24 x i8] c"PortEnableStatusChange \00"
@.str.10 = [25 x i8] c"PortSuspendStatusChange \00"
@.str.11 = [28 x i8] c"OverCurrentIndicatorChange \00"
@.str.12 = [23 x i8] c"PortResetStatusChange \00"
define void @ohci_dumpportstat(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = and i32 %1, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = and i32 %1, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = and i32 %1, 4
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
%19 = and i32 %1, 8
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = and i32 %1, 16
%25 = icmp eq i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
%29 = and i32 %1, 256
%30 = icmp eq i32 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %28
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
br label %33
33: ; preds = %31, %28
%34 = and i32 %1, 512
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %38
38: ; preds = %36, %33
%39 = and i32 %1, 65536
%40 = icmp eq i32 %39, 0
br i1 %40, label %43, label %41
41: ; preds = %38
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0))
br label %43
43: ; preds = %41, %38
%44 = and i32 %1, 131072
%45 = icmp eq i32 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %43
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
br label %48
48: ; preds = %46, %43
%49 = and i32 %1, 262144
%50 = icmp eq i32 %49, 0
br i1 %50, label %53, label %51
51: ; preds = %48
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
br label %53
53: ; preds = %51, %48
%54 = and i32 %1, 524288
%55 = icmp eq i32 %54, 0
br i1 %55, label %58, label %56
56: ; preds = %53
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0))
br label %58
58: ; preds = %56, %53
%59 = and i32 %1, 1048576
%60 = icmp eq i32 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %58
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0))
br label %63
63: ; preds = %61, %58
%64 = tail call i32 @putchar(i32 10)
ret void
}