#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void vdma_status_dump(int status) {
  if (status & 0x00000001)
    printf(" halted");
  else
    printf("running");
  if (status & 0x00000010)
    printf(" vdma-internal-error");
  if (status & 0x00000020)
    printf(" vdma-slave-error");
  if (status & 0x00000040)
    printf(" vdma-decode-error");
  if (status & 0x00000080)
    printf(" start-of-frame-early-error");
  if (status & 0x00000100)
    printf(" end-of-line-early-error");
  if (status & 0x00000800)
    printf(" start-of-frame-late-error");
  if (status & 0x00001000)
    printf(" frame-count-interrupt");
  if (status & 0x00002000)
    printf(" delay-count-interrupt");
  if (status & 0x00004000)
    printf(" error-interrupt");
  if (status & 0x00008000)
    printf(" end-of-line-late-error");
  printf(" frame-count:%d", (status & 0x00ff0000) >> 16);
  printf(" delay-count:%d", (status & 0xff000000) >> 24);
  printf("\n");
}


x86 assembly (clang, -O0):
<vdma_status_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113d <vdma_status_dump+0x2d>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114b <vdma_status_dump+0x3b>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1168 <vdma_status_dump+0x58>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1185 <vdma_status_dump+0x75>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     11a2 <vdma_status_dump+0x92>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11c1 <vdma_status_dump+0xb1>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     11e0 <vdma_status_dump+0xd0>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x800,%eax
cmp    $0x0,%eax
je     11ff <vdma_status_dump+0xef>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x1000,%eax
cmp    $0x0,%eax
je     121e <vdma_status_dump+0x10e>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     123d <vdma_status_dump+0x12d>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
je     125c <vdma_status_dump+0x14c>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     127b <vdma_status_dump+0x16b>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
and    $0xff0000,%esi
sar    $0x10,%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
and    $0xff000000,%esi
shr    $0x18,%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdma_status_dump>:
push   %rbx
mov    %edi,%ebx
test   $0x1,%bl
lea    0xedb(%rip),%rax
lea    0xecc(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x10,%bl
jne    11e9 <vdma_status_dump+0xc9>
test   $0x20,%bl
jne    1200 <vdma_status_dump+0xe0>
test   $0x40,%bl
jne    1217 <vdma_status_dump+0xf7>
test   $0x80,%bl
jne    122e <vdma_status_dump+0x10e>
test   $0x100,%ebx
jne    1248 <vdma_status_dump+0x128>
test   $0x800,%ebx
jne    1262 <vdma_status_dump+0x142>
test   $0x1000,%ebx
jne    127c <vdma_status_dump+0x15c>
test   $0x2000,%ebx
jne    1296 <vdma_status_dump+0x176>
test   $0x4000,%ebx
jne    12b0 <vdma_status_dump+0x190>
test   $0x8000,%ebx
je     11b5 <vdma_status_dump+0x95>
lea    0xf2b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%esi
lea    0xf2d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
shr    $0x18,%ebx
lea    0xf2c(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>
lea    0xe20(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x20,%bl
je     1151 <vdma_status_dump+0x31>
lea    0xe1e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x40,%bl
je     115a <vdma_status_dump+0x3a>
lea    0xe19(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x80,%bl
je     1163 <vdma_status_dump+0x43>
lea    0xe15(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x100,%ebx
je     116f <vdma_status_dump+0x4f>
lea    0xe17(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x800,%ebx
je     117b <vdma_status_dump+0x5b>
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1000,%ebx
je     1187 <vdma_status_dump+0x67>
lea    0xe17(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x2000,%ebx
je     1193 <vdma_status_dump+0x73>
lea    0xe14(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x4000,%ebx
je     119f <vdma_status_dump+0x7f>
lea    0xe11(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x8000,%ebx
jne    11a7 <vdma_status_dump+0x87>
jmp    11b5 <vdma_status_dump+0x95>

LLVM IR (-O0):
@.str = [8 x i8] c" halted\00"
@.str.1 = [8 x i8] c"running\00"
@.str.2 = [21 x i8] c" vdma-internal-error\00"
@.str.3 = [18 x i8] c" vdma-slave-error\00"
@.str.4 = [19 x i8] c" vdma-decode-error\00"
@.str.5 = [28 x i8] c" start-of-frame-early-error\00"
@.str.6 = [25 x i8] c" end-of-line-early-error\00"
@.str.7 = [27 x i8] c" start-of-frame-late-error\00"
@.str.8 = [23 x i8] c" frame-count-interrupt\00"
@.str.9 = [23 x i8] c" delay-count-interrupt\00"
@.str.10 = [17 x i8] c" error-interrupt\00"
@.str.11 = [24 x i8] c" end-of-line-late-error\00"
@.str.12 = [16 x i8] c" frame-count:%d\00"
@.str.13 = [16 x i8] c" delay-count:%d\00"
@.str.14 = [2 x i8] c"\0A\00"
define void @vdma_status_dump(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
%12 = and i32 %11, 16
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %2
%18 = and i32 %17, 32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %2
%24 = and i32 %23, 64
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = load i32, i32* %2
%30 = and i32 %29, 128
%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 = load i32, i32* %2
%36 = and i32 %35, 256
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %40
40: ; preds = %38, %34
%41 = load i32, i32* %2
%42 = and i32 %41, 2048
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
br label %46
46: ; preds = %44, %40
%47 = load i32, i32* %2
%48 = and i32 %47, 4096
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %52
52: ; preds = %50, %46
%53 = load i32, i32* %2
%54 = and i32 %53, 8192
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %58
58: ; preds = %56, %52
%59 = load i32, i32* %2
%60 = and i32 %59, 16384
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %64
64: ; preds = %62, %58
%65 = load i32, i32* %2
%66 = and i32 %65, 32768
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
br label %70
70: ; preds = %68, %64
%71 = load i32, i32* %2
%72 = and i32 %71, 16711680
%73 = ashr i32 %72, 16
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i32 %73)
%75 = load i32, i32* %2
%76 = and i32 %75, -16777216
%77 = lshr i32 %76, 24
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i32 %77)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" halted\00"
@.str.1 = [8 x i8] c"running\00"
@.str.2 = [21 x i8] c" vdma-internal-error\00"
@.str.3 = [18 x i8] c" vdma-slave-error\00"
@.str.4 = [19 x i8] c" vdma-decode-error\00"
@.str.5 = [28 x i8] c" start-of-frame-early-error\00"
@.str.6 = [25 x i8] c" end-of-line-early-error\00"
@.str.7 = [27 x i8] c" start-of-frame-late-error\00"
@.str.8 = [23 x i8] c" frame-count-interrupt\00"
@.str.9 = [23 x i8] c" delay-count-interrupt\00"
@.str.10 = [17 x i8] c" error-interrupt\00"
@.str.11 = [24 x i8] c" end-of-line-late-error\00"
@.str.12 = [16 x i8] c" frame-count:%d\00"
@.str.13 = [16 x i8] c" delay-count:%d\00"
define void @vdma_status_dump(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %4)
%6 = and i32 %0, 16
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = and i32 %0, 32
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = and i32 %0, 64
%17 = icmp eq i32 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = and i32 %0, 128
%22 = icmp eq i32 %21, 0
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
%26 = and i32 %0, 256
%27 = icmp eq i32 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %30
30: ; preds = %28, %25
%31 = and i32 %0, 2048
%32 = icmp eq i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
br label %35
35: ; preds = %33, %30
%36 = and i32 %0, 4096
%37 = icmp eq i32 %36, 0
br i1 %37, label %40, label %38
38: ; preds = %35
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %40
40: ; preds = %38, %35
%41 = and i32 %0, 8192
%42 = icmp eq i32 %41, 0
br i1 %42, label %45, label %43
43: ; preds = %40
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %45
45: ; preds = %43, %40
%46 = and i32 %0, 16384
%47 = icmp eq i32 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %50
50: ; preds = %48, %45
%51 = and i32 %0, 32768
%52 = icmp eq i32 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %50
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0))
br label %55
55: ; preds = %53, %50
%56 = lshr i32 %0, 16
%57 = and i32 %56, 255
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i32 %57)
%59 = lshr i32 %0, 24
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i32 %59)
%61 = tail call i32 @putchar(i32 10)
ret void
}