#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 */
char *buf();
int /*<<< orphan*/ spAppend(char *, char *);
char *pFieldAccessFlags(int flags) {
  char *result = buf();
  if (flags & 0x0001) {
    spAppend(result, "public");
  }
  if (flags & 0x0002) {
    spAppend(result, "private");
  }
  if (flags & 0x0004) {
    spAppend(result, "protected");
  }
  if (flags & 0x0008) {
    spAppend(result, "static");
  }
  if (flags & 0x0010) {
    spAppend(result, "final");
  }
  if (flags & 0x0040) {
    spAppend(result, "volatile");
  }
  if (flags & 0x0080) {
    spAppend(result, "transient");
  }
  return result;
}


x86 assembly (clang, -O0):
<pFieldAccessFlags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <buf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1155 <pFieldAccessFlags+0x35>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <spAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1174 <pFieldAccessFlags+0x54>
mov    -0x10(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <spAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1193 <pFieldAccessFlags+0x73>
mov    -0x10(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1030 <spAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11b2 <pFieldAccessFlags+0x92>
mov    -0x10(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1030 <spAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     11d1 <pFieldAccessFlags+0xb1>
mov    -0x10(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1030 <spAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
je     11f0 <pFieldAccessFlags+0xd0>
mov    -0x10(%rbp),%rdi
lea    0xe3b(%rip),%rsi
call   1030 <spAppend@plt>
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1211 <pFieldAccessFlags+0xf1>
mov    -0x10(%rbp),%rdi
lea    0xe23(%rip),%rsi
call   1030 <spAppend@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pFieldAccessFlags>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <buf@plt>
mov    %rax,%rbx
test   $0x1,%bpl
jne    1176 <pFieldAccessFlags+0x56>
test   $0x2,%bpl
jne    118b <pFieldAccessFlags+0x6b>
test   $0x4,%bpl
jne    11a0 <pFieldAccessFlags+0x80>
test   $0x8,%bpl
jne    11b5 <pFieldAccessFlags+0x95>
test   $0x10,%bpl
jne    11ca <pFieldAccessFlags+0xaa>
test   $0x40,%bpl
jne    11e3 <pFieldAccessFlags+0xc3>
test   $0x80,%bpl
je     116c <pFieldAccessFlags+0x4c>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <spAppend@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
call   1030 <spAppend@plt>
test   $0x2,%bpl
je     113b <pFieldAccessFlags+0x1b>
lea    0xe75(%rip),%rsi
mov    %rbx,%rdi
call   1030 <spAppend@plt>
test   $0x4,%bpl
je     1141 <pFieldAccessFlags+0x21>
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
call   1030 <spAppend@plt>
test   $0x8,%bpl
je     1147 <pFieldAccessFlags+0x27>
lea    0xe5d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <spAppend@plt>
test   $0x10,%bpl
je     114d <pFieldAccessFlags+0x2d>
lea    0xe4f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <spAppend@plt>
test   $0x40,%bpl
je     1157 <pFieldAccessFlags+0x37>
lea    0xe3c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <spAppend@plt>
test   $0x80,%bpl
jne    115d <pFieldAccessFlags+0x3d>
jmp    116c <pFieldAccessFlags+0x4c>

LLVM IR (-O0):
@.str = [7 x i8] c"public\00"
@.str.1 = [8 x i8] c"private\00"
@.str.2 = [10 x i8] c"protected\00"
@.str.3 = [7 x i8] c"static\00"
@.str.4 = [6 x i8] c"final\00"
@.str.5 = [9 x i8] c"volatile\00"
@.str.6 = [10 x i8] c"transient\00"
define i8* @pFieldAccessFlags(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* (...) @buf()
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @spAppend(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %2
%13 = and i32 %12, 2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = call i32 @spAppend(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %11
%19 = load i32, i32* %2
%20 = and i32 %19, 4
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = load i8*, i8** %3
%24 = call i32 @spAppend(i8* %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %22, %18
%26 = load i32, i32* %2
%27 = and i32 %26, 8
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i8*, i8** %3
%31 = call i32 @spAppend(i8* %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %29, %25
%33 = load i32, i32* %2
%34 = and i32 %33, 16
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %32
%37 = load i8*, i8** %3
%38 = call i32 @spAppend(i8* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %39
39: ; preds = %36, %32
%40 = load i32, i32* %2
%41 = and i32 %40, 64
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %39
%44 = load i8*, i8** %3
%45 = call i32 @spAppend(i8* %44, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %46
46: ; preds = %43, %39
%47 = load i32, i32* %2
%48 = and i32 %47, 128
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = load i8*, i8** %3
%52 = call i32 @spAppend(i8* %51, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %53
53: ; preds = %50, %46
%54 = load i8*, i8** %3
ret i8* %54
}

LLVM IR (-O2):
@.str = [7 x i8] c"public\00"
@.str.1 = [8 x i8] c"private\00"
@.str.2 = [10 x i8] c"protected\00"
@.str.3 = [7 x i8] c"static\00"
@.str.4 = [6 x i8] c"final\00"
@.str.5 = [9 x i8] c"volatile\00"
@.str.6 = [10 x i8] c"transient\00"
define i8* @pFieldAccessFlags(i32 %0) {
%2 = tail call i8* (...) @buf()
%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 @spAppend(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, 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 @spAppend(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = and i32 %0, 4
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @spAppend(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = and i32 %0, 8
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 @spAppend(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = and i32 %0, 16
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @spAppend(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = and i32 %0, 64
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 @spAppend(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
%33 = and i32 %0, 128
%34 = icmp eq i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = tail call i32 @spAppend(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %37
37: ; preds = %35, %32
ret i8* %2
}