#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*/ print_each_ace_mask(int);
int /*<<< orphan*/ printf(char *, ...);
void print_ace_mask(uint32_t mask, int raw) {
  if (raw) {
    printf("0x%x\n", mask);
    return;
  }
  if (mask == 0x001f01ff)
    printf("FULL");
  else if (mask == 0x001301bf)
    printf("CHANGE");
  else if (mask == 0x00010000)
    printf("D");
  else if (mask == 0x001200a9)
    printf("READ");
  else if (mask & 0x00000040)
    printf("0x%x", mask);
  else
    print_each_ace_mask(mask);
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<print_ace_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <print_ace_mask+0x2e>
mov    -0x4(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    121d <print_ace_mask+0xfd>
cmpl   $0x1f01ff,-0x4(%rbp)
jne    116e <print_ace_mask+0x4e>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120f <print_ace_mask+0xef>
cmpl   $0x1301bf,-0x4(%rbp)
jne    118e <print_ace_mask+0x6e>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120a <print_ace_mask+0xea>
cmpl   $0x10000,-0x4(%rbp)
jne    11ae <print_ace_mask+0x8e>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1205 <print_ace_mask+0xe5>
cmpl   $0x1200a9,-0x4(%rbp)
jne    11ce <print_ace_mask+0xae>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1200 <print_ace_mask+0xe0>
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     11f3 <print_ace_mask+0xd3>
mov    -0x4(%rbp),%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11fb <print_ace_mask+0xdb>
mov    -0x4(%rbp),%edi
call   1030 <print_each_ace_mask@plt>
jmp    1200 <print_ace_mask+0xe0>
jmp    1205 <print_ace_mask+0xe5>
jmp    120a <print_ace_mask+0xea>
jmp    120f <print_ace_mask+0xef>
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ace_mask>:
mov    %edi,%eax
test   %esi,%esi
je     1146 <print_ace_mask+0x16>
lea    0xec3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
jmp    1050 <printf@plt>
push   %rax
cmp    $0x1301be,%eax
jg     1165 <print_ace_mask+0x35>
cmp    $0x10000,%eax
je     1189 <print_ace_mask+0x59>
cmp    $0x1200a9,%eax
jne    117c <print_ace_mask+0x4c>
lea    0xeaf(%rip),%rdi
jmp    119c <print_ace_mask+0x6c>
cmp    $0x1301bf,%eax
je     1195 <print_ace_mask+0x65>
cmp    $0x1f01ff,%eax
jne    117c <print_ace_mask+0x4c>
lea    0xe8c(%rip),%rdi
jmp    119c <print_ace_mask+0x6c>
test   $0x40,%al
jne    11ae <print_ace_mask+0x7e>
mov    %eax,%edi
call   1040 <print_each_ace_mask@plt>
jmp    11a3 <print_ace_mask+0x73>
mov    $0x44,%edi
call   1030 <putchar@plt>
jmp    11a3 <print_ace_mask+0x73>
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>
lea    0xe62(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11a3 <print_ace_mask+0x73>

LLVM IR (-O0):
@.str = [6 x i8] c"0x%x\0A\00"
@.str.1 = [5 x i8] c"FULL\00"
@.str.2 = [7 x i8] c"CHANGE\00"
@.str.3 = [2 x i8] c"D\00"
@.str.4 = [5 x i8] c"READ\00"
@.str.5 = [5 x i8] c"0x%x\00"
@.str.6 = [2 x i8] c"\0A\00"
define void @print_ace_mask(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %46
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 2032127
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %44
15: ; preds = %10
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 1245631
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %43
20: ; preds = %15
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 65536
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %42
25: ; preds = %20
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, 1179817
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %41
30: ; preds = %25
%31 = load i32, i32* %3
%32 = and i32 %31, 64
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = load i32, i32* %3
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %35)
br label %40
37: ; preds = %30
%38 = load i32, i32* %3
%39 = call i32 @print_each_ace_mask(i32 %38)
br label %40
40: ; preds = %37, %34
br label %41
41: ; preds = %40, %28
br label %42
42: ; preds = %41, %23
br label %43
43: ; preds = %42, %18
br label %44
44: ; preds = %43, %13
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %46
46: ; preds = %44, %7
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
@.str.1 = [5 x i8] c"FULL\00"
@.str.2 = [7 x i8] c"CHANGE\00"
@.str.4 = [5 x i8] c"READ\00"
@.str.5 = [5 x i8] c"0x%x\00"
define void @print_ace_mask(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %24
6: ; preds = %2
switch i32 %0, label %15 [
i32 2032127, label %7
i32 1245631, label %9
i32 65536, label %11
i32 1179817, label %13
]
7: ; preds = %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %22
9: ; preds = %6
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %22
11: ; preds = %6
%12 = tail call i32 @putchar(i32 68)
br label %22
13: ; preds = %6
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %22
15: ; preds = %6
%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 ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %0)
br label %22
20: ; preds = %15
%21 = tail call i32 @print_each_ace_mask(i32 %0)
br label %22
22: ; preds = %9, %13, %20, %18, %11, %7
%23 = tail call i32 @putchar(i32 10)
br label %24
24: ; preds = %22, %4
ret void
}