#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 additional_decryption_key(int len) {
  int c = Getc();
  printf("\t\tClass - ");
  switch (c) {
  case 0x80:
    printf("Strong request");
    break;
  case 0x0:
    printf("Normal");
    break;
  default:
    printf("Unknown class(%02x)", c);
    break;
  }
  printf("\n");
  printf("\t");
  pub_algs(Getc());
  printf("\t");
  fingerprint();
}


x86 assembly (clang, -O0):
<additional_decryption_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %al,-0xd(%rbp)
call   1040 <Getc@plt>
mov    %eax,%ecx
mov    -0xd(%rbp),%al
mov    %ecx,-0x8(%rbp)
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11a2 <additional_decryption_key+0x62>
jmp    117c <additional_decryption_key+0x3c>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    11b5 <additional_decryption_key+0x75>
jmp    118f <additional_decryption_key+0x4f>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c6 <additional_decryption_key+0x86>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c6 <additional_decryption_key+0x86>
mov    -0x8(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5c(%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    0xe40(%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):
<additional_decryption_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   %ebx,%ebx
je     117d <additional_decryption_key+0x2d>
cmp    $0x80,%ebx
jne    118d <additional_decryption_key+0x3d>
lea    0xe90(%rip),%rdi
jmp    1184 <additional_decryption_key+0x34>
lea    0xe96(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    119d <additional_decryption_key+0x4d>
lea    0xe8d(%rip),%rdi
mov    %ebx,%esi
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 = [15 x i8] c"Strong request\00"
@.str.2 = [7 x i8] c"Normal\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 @additional_decryption_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
switch i32 %6, label %11 [
i32 128, label %7
i32 0, label %9
]
7: ; preds = %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %14
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %9, %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (...) @Getc()
%18 = call i32 @pub_algs(i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 (...) @fingerprint()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\09\09Class - \00"
@.str.1 = [15 x i8] c"Strong request\00"
@.str.2 = [7 x i8] c"Normal\00"
@.str.3 = [20 x i8] c"Unknown class(%02x)\00"
define void @additional_decryption_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))
switch i32 %2, label %8 [
i32 128, label %4
i32 0, label %6
]
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = 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 %10
10: ; preds = %8, %6, %4
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @putchar(i32 9)
%13 = tail call i32 (...) @Getc()
%14 = tail call i32 @pub_algs(i32 %13)
%15 = tail call i32 @putchar(i32 9)
%16 = tail call i32 (...) @fingerprint()
ret void
}