#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*/ fingerprint();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ pub_algs(int);
extern void revocation_key(int len) {
  int c = Getc();
  printf("\t\tClass - ");
  if (c & 0x80)
    switch (c) {
    case 0x80:
      printf("Normal");
      break;
    case 0xc0:
      printf("Sensitive");
      break;
    default:
      printf("Unknown class(%02x)", c);
      break;
    }
  else
    printf("Unknown class(%02x)", c);
  printf("\n");
  printf("\t");
  pub_algs(Getc());
  printf("\t");
  fingerprint();
}


x86 assembly (clang, -O0):
<revocation_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Getc@plt>
mov    %eax,-0x8(%rbp)
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11d9 <revocation_key+0x99>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x80,%eax
je     119d <revocation_key+0x5d>
jmp    118a <revocation_key+0x4a>
mov    -0xc(%rbp),%eax
sub    $0xc0,%eax
je     11b0 <revocation_key+0x70>
jmp    11c3 <revocation_key+0x83>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d4 <revocation_key+0x94>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d4 <revocation_key+0x94>
mov    -0x8(%rbp),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ea <revocation_key+0xaa>
mov    -0x8(%rbp),%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <Getc@plt>
mov    %eax,%edi
call   1060 <pub_algs@plt>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <fingerprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revocation_key>:
push   %rbx
xor    %eax,%eax
call   1050 <Getc@plt>
mov    %eax,%ebx
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x80,%bl
je     1186 <revocation_key+0x36>
cmp    $0xc0,%ebx
je     1198 <revocation_key+0x48>
cmp    $0x80,%ebx
jne    1186 <revocation_key+0x36>
lea    0xe87(%rip),%rdi
jmp    119f <revocation_key+0x4f>
lea    0xe8f(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11a6 <revocation_key+0x56>
lea    0xe73(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <Getc@plt>
mov    %eax,%edi
call   1070 <pub_algs@plt>
mov    $0x9,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <fingerprint@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\09\09Class - \00"
@.str.1 = [7 x i8] c"Normal\00"
@.str.2 = [10 x i8] c"Sensitive\00"
@.str.3 = [20 x i8] c"Unknown class(%02x)\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [2 x i8] c"\09\00"
define void @revocation_key(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @Getc()
store i32 %4, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = and i32 %6, 128
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %1
%10 = load i32, i32* %3
switch i32 %10, label %15 [
i32 128, label %11
i32 192, label %13
]
11: ; preds = %9
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %18
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %18
15: ; preds = %9
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %15, %13, %11
br label %22
19: ; preds = %1
%20 = load i32, i32* %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %18
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32 (...) @Getc()
%26 = call i32 @pub_algs(i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%28 = call i32 (...) @fingerprint()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\09\09Class - \00"
@.str.1 = [7 x i8] c"Normal\00"
@.str.2 = [10 x i8] c"Sensitive\00"
@.str.3 = [20 x i8] c"Unknown class(%02x)\00"
define void @revocation_key(i32 %0) {
%2 = tail call i32 (...) @Getc()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = and i32 %2, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
switch i32 %2, label %11 [
i32 128, label %7
i32 192, label %9
]
7: ; preds = %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %15
9: ; preds = %6
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %15
11: ; preds = %6
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %2)
br label %15
13: ; preds = %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %2)
br label %15
15: ; preds = %7, %9, %11, %13
%16 = tail call i32 @putchar(i32 10)
%17 = tail call i32 @putchar(i32 9)
%18 = tail call i32 (...) @Getc()
%19 = tail call i32 @pub_algs(i32 %18)
%20 = tail call i32 @putchar(i32 9)
%21 = tail call i32 (...) @fingerprint()
ret void
}