#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 */
unsigned int const TA_ASN1;
unsigned int const TA_BINARY;
unsigned int const TA_CASE;
unsigned int const TA_CRYPT;
unsigned int const TA_SEARCHABLE;
unsigned int const TA_XDR;
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_flags(const unsigned int flags) {
  fputs("(", stdout);
  if (flags & TA_SEARCHABLE)
    fputs("SEARCHABLE, ", stdout);
  if (flags & TA_BINARY) {
    fputs("BINARY DATA", stdout);
    if (flags & TA_XDR)
      fputs(", XDR ENCODED", stdout);
    if (flags & TA_ASN1)
      fputs(", ASN.1 ENCODED", stdout);
    if (flags & TA_CRYPT)
      fputs(", ENCRYPTED", stdout);
  } else {
    fputs("TEXTUAL DATA", stdout);
    if (flags & TA_SEARCHABLE) {
      if (flags & TA_CASE)
        fputs(", CASE INSENSITIVE", stdout);
      else
        fputs(", CASE SENSITIVE", stdout);
    }
  }
  fputs(")\n", stdout);
}


x86 assembly (clang, -O0):
<print_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
lea    0xed5(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%eax
mov    0x2e8e(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     115a <print_flags+0x4a>
mov    0x2e6c(%rip),%rax
mov    (%rax),%esi
lea    0xead(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%eax
mov    0x2e84(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1207 <print_flags+0xf7>
mov    0x2e42(%rip),%rax
mov    (%rax),%esi
lea    0xe90(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%eax
mov    0x2e32(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11ae <print_flags+0x9e>
mov    0x2e18(%rip),%rax
mov    (%rax),%esi
lea    0xe72(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%eax
mov    0x2e20(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11d8 <print_flags+0xc8>
mov    0x2dee(%rip),%rax
mov    (%rax),%esi
lea    0xe56(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%eax
mov    0x2dc6(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1202 <print_flags+0xf2>
mov    0x2dc4(%rip),%rax
mov    (%rax),%esi
lea    0xe3c(%rip),%rdi
call   1030 <fputs@plt>
jmp    127f <print_flags+0x16f>
mov    0x2daa(%rip),%rax
mov    (%rax),%esi
lea    0xe2e(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x4(%rbp),%eax
mov    0x2da2(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     127a <print_flags+0x16a>
mov    -0x4(%rbp),%eax
mov    0x2dbd(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1260 <print_flags+0x150>
mov    0x2d6b(%rip),%rax
mov    (%rax),%esi
lea    0xdfc(%rip),%rdi
call   1030 <fputs@plt>
jmp    1275 <print_flags+0x165>
mov    0x2d51(%rip),%rax
mov    (%rax),%esi
lea    0xdf5(%rip),%rdi
call   1030 <fputs@plt>
jmp    127a <print_flags+0x16a>
jmp    127f <print_flags+0x16f>
mov    0x2d32(%rip),%rax
mov    (%rax),%esi
lea    0xde7(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_flags>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xed3(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xed2(%rip),%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"(\00"
@stdout = global i32 0
@TA_SEARCHABLE = constant i32 0
@.str.1 = [13 x i8] c"SEARCHABLE, \00"
@TA_BINARY = constant i32 0
@.str.2 = [12 x i8] c"BINARY DATA\00"
@TA_XDR = constant i32 0
@.str.3 = [14 x i8] c", XDR ENCODED\00"
@TA_ASN1 = constant i32 0
@.str.4 = [16 x i8] c", ASN.1 ENCODED\00"
@TA_CRYPT = constant i32 0
@.str.5 = [12 x i8] c", ENCRYPTED\00"
@.str.6 = [13 x i8] c"TEXTUAL DATA\00"
@TA_CASE = constant i32 0
@.str.7 = [19 x i8] c", CASE INSENSITIVE\00"
@.str.8 = [17 x i8] c", CASE SENSITIVE\00"
@.str.9 = [3 x i8] c")\0A\00"
define void @print_flags(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* @TA_SEARCHABLE
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @stdout
%11 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %2
%14 = load i32, i32* @TA_BINARY
%15 = and i32 %13, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %44
17: ; preds = %12
%18 = load i32, i32* @stdout
%19 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %2
%21 = load i32, i32* @TA_XDR
%22 = and i32 %20, %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %17
%25 = load i32, i32* @stdout
%26 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %24, %17
%28 = load i32, i32* %2
%29 = load i32, i32* @TA_ASN1
%30 = and i32 %28, %29
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %27
%33 = load i32, i32* @stdout
%34 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32, %27
%36 = load i32, i32* %2
%37 = load i32, i32* @TA_CRYPT
%38 = and i32 %36, %37
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %35
%41 = load i32, i32* @stdout
%42 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %40, %35
br label %64
44: ; preds = %12
%45 = load i32, i32* @stdout
%46 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %2
%48 = load i32, i32* @TA_SEARCHABLE
%49 = and i32 %47, %48
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %63
51: ; preds = %44
%52 = load i32, i32* %2
%53 = load i32, i32* @TA_CASE
%54 = and i32 %52, %53
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = load i32, i32* @stdout
%58 = call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i32 %57)
br label %62
59: ; preds = %51
%60 = load i32, i32* @stdout
%61 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), i32 %60)
br label %62
62: ; preds = %59, %56
br label %63
63: ; preds = %62, %44
br label %64
64: ; preds = %63, %43
%65 = load i32, i32* @stdout
%66 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 %65)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"(\00"
@stdout = global i32 0
@TA_SEARCHABLE = constant i32 0
@TA_BINARY = constant i32 0
@TA_XDR = constant i32 0
@TA_ASN1 = constant i32 0
@TA_CRYPT = constant i32 0
@.str.6 = [13 x i8] c"TEXTUAL DATA\00"
@TA_CASE = constant i32 0
@.str.9 = [3 x i8] c")\0A\00"
define void @print_flags(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 %6)
ret void
}