#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 Getc();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ skip(int);
extern void key_flags(int len) {
  int c = Getc();
  if (c & 0x01)
    printf("\t\tFlag - This key may be used to certify other keys\n");
  if (c & 0x02)
    printf("\t\tFlag - This key may be used to sign data\n");
  if (c & 0x04)
    printf("\t\tFlag - This key may be used to encrypt communications\n");
  if (c & 0x08)
    printf("\t\tFlag - This key may be used to encrypt storage\n");
  if (c & 0x10)
    printf("\t\tFlag - The private component of this key may have been split "
           "by a secret-sharing mechanism\n");
  if (c & 0x20)
    printf("\t\tFlag - This key may be used for authentication\n");
  if (c & 0x80)
    printf("\t\tFlag - The private component of this key may be in the "
           "possession of more than one person\n");
  skip(len - 1);
}


x86 assembly (clang, -O0):
<key_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <Getc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1160 <key_flags+0x30>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     117b <key_flags+0x4b>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1196 <key_flags+0x66>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11b1 <key_flags+0x81>
lea    0xeee(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     11cc <key_flags+0x9c>
lea    0xf05(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     11e7 <key_flags+0xb7>
lea    0xf48(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1204 <key_flags+0xd4>
lea    0xf5d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <skip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_flags>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <Getc@plt>
mov    %eax,%ebp
test   $0x1,%bpl
jne    1184 <key_flags+0x54>
test   $0x2,%bpl
jne    1196 <key_flags+0x66>
test   $0x4,%bpl
jne    11a8 <key_flags+0x78>
test   $0x8,%bpl
jne    11ba <key_flags+0x8a>
test   $0x10,%bpl
jne    11cc <key_flags+0x9c>
test   $0x20,%bpl
jne    11de <key_flags+0xae>
test   $0x80,%bpl
je     1174 <key_flags+0x44>
lea    0xe91(%rip),%rdi
call   1040 <puts@plt>
add    $0xffffffff,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <skip@plt>
lea    0xff3(%rip),%rdi
call   1040 <puts@plt>
test   $0x2,%bpl
je     114a <key_flags+0x1a>
lea    0xfb6(%rip),%rdi
call   1040 <puts@plt>
test   $0x4,%bpl
je     1150 <key_flags+0x20>
lea    0xf6c(%rip),%rdi
call   1040 <puts@plt>
test   $0x8,%bpl
je     1156 <key_flags+0x26>
lea    0xf29(%rip),%rdi
call   1040 <puts@plt>
test   $0x10,%bpl
je     115c <key_flags+0x2c>
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
test   $0x20,%bpl
je     1162 <key_flags+0x32>
lea    0xe77(%rip),%rdi
call   1040 <puts@plt>
test   $0x80,%bpl
jne    1168 <key_flags+0x38>
jmp    1174 <key_flags+0x44>

LLVM IR (-O0):
@.str = [53 x i8] c"\09\09Flag - This key may be used to certify other keys\0A\00"
@.str.1 = [44 x i8] c"\09\09Flag - This key may be used to sign data\0A\00"
@.str.2 = [57 x i8] c"\09\09Flag - This key may be used to encrypt communications\0A\00"
@.str.3 = [50 x i8] c"\09\09Flag - This key may be used to encrypt storage\0A\00"
@.str.4 = [94 x i8] c"\09\09Flag - The private component of this key may have been split by a secret-sharing mechanism\0A\00"
@.str.5 = [50 x i8] c"\09\09Flag - This key may be used for authentication\0A\00"
@.str.6 = [93 x i8] c"\09\09Flag - The private component of this key may be in the possession of more than one person\0A\00"
define void @key_flags(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @Getc()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
%12 = and i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %3
%18 = and i32 %17, 4
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
%23 = load i32, i32* %3
%24 = and i32 %23, 8
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = load i32, i32* %3
%30 = and i32 %29, 16
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.4, i64 0, i64 0))
br label %34
34: ; preds = %32, %28
%35 = load i32, i32* %3
%36 = and i32 %35, 32
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
br label %40
40: ; preds = %38, %34
%41 = load i32, i32* %3
%42 = and i32 %41, 128
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.6, i64 0, i64 0))
br label %46
46: ; preds = %44, %40
%47 = load i32, i32* %2
%48 = sub nsw i32 %47, 1
%49 = call i32 @skip(i32 %48)
ret void
}

LLVM IR (-O2):
@str = [92 x i8] c"\09\09Flag - The private component of this key may be in the possession of more than one person\00"
@str.7 = [49 x i8] c"\09\09Flag - This key may be used for authentication\00"
@str.8 = [93 x i8] c"\09\09Flag - The private component of this key may have been split by a secret-sharing mechanism\00"
@str.9 = [49 x i8] c"\09\09Flag - This key may be used to encrypt storage\00"
@str.10 = [56 x i8] c"\09\09Flag - This key may be used to encrypt communications\00"
@str.11 = [43 x i8] c"\09\09Flag - This key may be used to sign data\00"
@str.12 = [52 x i8] c"\09\09Flag - This key may be used to certify other keys\00"
define void @key_flags(i32 %0) {
%2 = tail call i32 (...) @Getc()
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.12, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = and i32 %2, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.11, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = and i32 %2, 4
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.10, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = and i32 %2, 8
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.9, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
%23 = and i32 %2, 16
%24 = icmp eq i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @str.8, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
%28 = and i32 %2, 32
%29 = icmp eq i32 %28, 0
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.7, i64 0, i64 0))
br label %32
32: ; preds = %30, %27
%33 = and i32 %2, 128
%34 = icmp eq i32 %33, 0
br i1 %34, label %37, label %35
35: ; preds = %32
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str, i64 0, i64 0))
br label %37
37: ; preds = %35, %32
%38 = add nsw i32 %0, -1
%39 = tail call i32 @skip(i32 %38)
ret void
}