#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 print_each_ace_mask(uint32_t mask) {
  if ((mask & 0x80020089) &&
      ((mask & 0x001200a9) != 0x001200a9 && (mask & 0xa01200a1) != 0xa01200a1 &&
       (mask & 0x00120089) != 0x00120089)) {
    printf("0x%x", mask);
    return;
  }
  if ((mask & 0x40000116) && (mask & 0x00000116) != 0x00000116) {
    printf("0x%x", mask);
    return;
  }
  if ((mask & 0x001200a9) == 0x001200a9 || (mask & 0xa01200a1) == 0xa01200a1 ||
      (mask & 0x00120089) == 0x00120089)
    printf("R");
  if ((mask & 0x00000116) == 0x00000116)
    printf("W");
  if ((mask & 0x00000020) == 0x00000020)
    printf("X");
  if ((mask & 0x00010000) == 0x00010000)
    printf("D");
  if ((mask & 0x00040000) == 0x00040000)
    printf("P");
  if ((mask & 0x00080000) == 0x00080000)
    printf("O");
}


x86 assembly (clang, -O0):
<print_each_ace_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80020089,%eax
cmp    $0x0,%eax
je     117b <print_each_ace_mask+0x6b>
mov    -0x4(%rbp),%eax
and    $0x1200a9,%eax
cmp    $0x1200a9,%eax
je     117b <print_each_ace_mask+0x6b>
mov    -0x4(%rbp),%eax
and    $0xa01200a1,%eax
cmp    $0xa01200a1,%eax
je     117b <print_each_ace_mask+0x6b>
mov    -0x4(%rbp),%eax
and    $0x120089,%eax
cmp    $0x120089,%eax
je     117b <print_each_ace_mask+0x6b>
mov    -0x4(%rbp),%esi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129d <print_each_ace_mask+0x18d>
mov    -0x4(%rbp),%eax
and    $0x40000116,%eax
cmp    $0x0,%eax
je     11b5 <print_each_ace_mask+0xa5>
mov    -0x4(%rbp),%eax
and    $0x116,%eax
cmp    $0x116,%eax
je     11b5 <print_each_ace_mask+0xa5>
mov    -0x4(%rbp),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129d <print_each_ace_mask+0x18d>
mov    -0x4(%rbp),%eax
and    $0x1200a9,%eax
cmp    $0x1200a9,%eax
je     11ee <print_each_ace_mask+0xde>
mov    -0x4(%rbp),%eax
and    $0xa01200a1,%eax
cmp    $0xa01200a1,%eax
je     11ee <print_each_ace_mask+0xde>
mov    -0x4(%rbp),%eax
and    $0x120089,%eax
cmp    $0x120089,%eax
jne    11fc <print_each_ace_mask+0xec>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x116,%eax
cmp    $0x116,%eax
jne    121d <print_each_ace_mask+0x10d>
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x20,%eax
cmp    $0x20,%eax
jne    123a <print_each_ace_mask+0x12a>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x10000,%eax
cmp    $0x10000,%eax
jne    125b <print_each_ace_mask+0x14b>
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x40000,%eax
cmp    $0x40000,%eax
jne    127c <print_each_ace_mask+0x16c>
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
and    $0x80000,%eax
cmp    $0x80000,%eax
jne    129d <print_each_ace_mask+0x18d>
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_each_ace_mask>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%eax
and    $0xa01200a1,%eax
mov    %edi,%ecx
and    $0x120089,%ecx
cmp    $0x120089,%ecx
je     115d <print_each_ace_mask+0x3d>
cmp    $0xa01200a1,%eax
je     115d <print_each_ace_mask+0x3d>
mov    %ebx,%edx
and    $0x80020089,%edx
je     115d <print_each_ace_mask+0x3d>
mov    %ebx,%edx
and    $0x1200a9,%edx
cmp    $0x1200a9,%edx
jne    1175 <print_each_ace_mask+0x55>
mov    %ebx,%ebp
and    $0x116,%ebp
test   $0x40000116,%ebx
je     118b <print_each_ace_mask+0x6b>
cmp    $0x116,%ebp
je     118b <print_each_ace_mask+0x6b>
lea    0xe84(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>
cmp    $0x120089,%ecx
je     11c6 <print_each_ace_mask+0xa6>
cmp    $0xa01200a1,%eax
je     11c6 <print_each_ace_mask+0xa6>
cmp    $0x116,%ebp
je     11d8 <print_each_ace_mask+0xb8>
test   $0x20,%bl
jne    11e7 <print_each_ace_mask+0xc7>
test   $0x10000,%ebx
jne    11f9 <print_each_ace_mask+0xd9>
test   $0x40000,%ebx
jne    120b <print_each_ace_mask+0xeb>
test   $0x80000,%ebx
jne    121d <print_each_ace_mask+0xfd>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x52,%edi
call   1030 <putchar@plt>
cmp    $0x116,%ebp
jne    11a2 <print_each_ace_mask+0x82>
mov    $0x57,%edi
call   1030 <putchar@plt>
test   $0x20,%bl
je     11a7 <print_each_ace_mask+0x87>
mov    $0x58,%edi
call   1030 <putchar@plt>
test   $0x10000,%ebx
je     11af <print_each_ace_mask+0x8f>
mov    $0x44,%edi
call   1030 <putchar@plt>
test   $0x40000,%ebx
je     11b7 <print_each_ace_mask+0x97>
mov    $0x50,%edi
call   1030 <putchar@plt>
test   $0x80000,%ebx
je     11bf <print_each_ace_mask+0x9f>
mov    $0x4f,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"0x%x\00"
@.str.1 = [2 x i8] c"R\00"
@.str.2 = [2 x i8] c"W\00"
@.str.3 = [2 x i8] c"X\00"
@.str.4 = [2 x i8] c"D\00"
@.str.5 = [2 x i8] c"P\00"
@.str.6 = [2 x i8] c"O\00"
define void @print_each_ace_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -2147352439
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %21
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 1179817
%9 = icmp ne i32 %8, 1179817
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %2
%12 = and i32 %11, -1609432927
%13 = icmp ne i32 %12, -1609432927
br i1 %13, label %14, label %21
14: ; preds = %10
%15 = load i32, i32* %2
%16 = and i32 %15, 1179785
%17 = icmp ne i32 %16, 1179785
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %2
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %76
21: ; preds = %14, %10, %6, %1
%22 = load i32, i32* %2
%23 = and i32 %22, 1073742102
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %21
%26 = load i32, i32* %2
%27 = and i32 %26, 278
%28 = icmp ne i32 %27, 278
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i32, i32* %2
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %30)
br label %76
32: ; preds = %25, %21
%33 = load i32, i32* %2
%34 = and i32 %33, 1179817
%35 = icmp eq i32 %34, 1179817
br i1 %35, label %44, label %36
36: ; preds = %32
%37 = load i32, i32* %2
%38 = and i32 %37, -1609432927
%39 = icmp eq i32 %38, -1609432927
br i1 %39, label %44, label %40
40: ; preds = %36
%41 = load i32, i32* %2
%42 = and i32 %41, 1179785
%43 = icmp eq i32 %42, 1179785
br i1 %43, label %44, label %46
44: ; preds = %40, %36, %32
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %46
46: ; preds = %44, %40
%47 = load i32, i32* %2
%48 = and i32 %47, 278
%49 = icmp eq i32 %48, 278
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %52
52: ; preds = %50, %46
%53 = load i32, i32* %2
%54 = and i32 %53, 32
%55 = icmp eq i32 %54, 32
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %58
58: ; preds = %56, %52
%59 = load i32, i32* %2
%60 = and i32 %59, 65536
%61 = icmp eq i32 %60, 65536
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %64
64: ; preds = %62, %58
%65 = load i32, i32* %2
%66 = and i32 %65, 262144
%67 = icmp eq i32 %66, 262144
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %70
70: ; preds = %68, %64
%71 = load i32, i32* %2
%72 = and i32 %71, 524288
%73 = icmp eq i32 %72, 524288
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %76
76: ; preds = %18, %29, %74, %70
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"0x%x\00"
define void @print_each_ace_mask(i32 %0) {
%2 = and i32 %0, -2147352439
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 1179817
%5 = icmp eq i32 %4, 1179817
%6 = or i1 %3, %5
%7 = and i32 %0, -1609432927
%8 = icmp eq i32 %7, -1609432927
%9 = or i1 %8, %6
%10 = and i32 %0, 1179785
%11 = icmp eq i32 %10, 1179785
%12 = or i1 %11, %9
br i1 %12, label %15, label %13
13: ; preds = %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %50
15: ; preds = %1
%16 = and i32 %0, 1073742102
%17 = icmp eq i32 %16, 0
%18 = and i32 %0, 278
%19 = icmp eq i32 %18, 278
%20 = or i1 %17, %19
br i1 %20, label %23, label %21
21: ; preds = %15
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %50
23: ; preds = %15
%24 = or i1 %11, %8
br i1 %24, label %25, label %27
25: ; preds = %23
%26 = tail call i32 @putchar(i32 82)
br label %27
27: ; preds = %23, %25
br i1 %19, label %28, label %30
28: ; preds = %27
%29 = tail call i32 @putchar(i32 87)
br label %30
30: ; preds = %28, %27
%31 = and i32 %0, 32
%32 = icmp eq i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = tail call i32 @putchar(i32 88)
br label %35
35: ; preds = %33, %30
%36 = and i32 %0, 65536
%37 = icmp eq i32 %36, 0
br i1 %37, label %40, label %38
38: ; preds = %35
%39 = tail call i32 @putchar(i32 68)
br label %40
40: ; preds = %38, %35
%41 = and i32 %0, 262144
%42 = icmp eq i32 %41, 0
br i1 %42, label %45, label %43
43: ; preds = %40
%44 = tail call i32 @putchar(i32 80)
br label %45
45: ; preds = %43, %40
%46 = and i32 %0, 524288
%47 = icmp eq i32 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = tail call i32 @putchar(i32 79)
br label %50
50: ; preds = %13, %21, %48, %45
ret void
}