#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 /*<<< orphan*/ printf(char *, ...);
void signature_type(int type) {
  printf("\tSig type - ");
  switch (type) {
  case 0x00:
    printf("Signature of a binary document(0x00).");
    break;
  case 0x01:
    printf("Signature of a canonical text document(0x01).");
    break;
  case 0x02:
    printf("Standalone signature(0x02).");
    break;
  case 0x10:
    printf("Generic certification of a User ID and Public Key packet(0x10).");
    break;
  case 0x11:
    printf("Persona certification of a User ID and Public Key packet.(0x11)");
    break;
  case 0x12:
    printf("Casual certification of a User ID and Public Key packet(0x12).");
    break;
  case 0x13:
    printf("Positive certification of a User ID and Public Key packet(0x13).");
    break;
  case 0x18:
    printf("Subkey Binding Signature(0x18).");
    break;
  case 0x19:
    printf("Primary Key Binding Signature(0x19).");
    break;
  case 0x1f:
    printf("Signature directly on a key(0x1f).");
    break;
  case 0x20:
    printf("Key revocation signature(0x20).");
    break;
  case 0x28:
    printf("Subkey revocation signature(0x28).");
    break;
  case 0x30:
    printf("Certification revocation signature(0x30).");
    break;
  case 0x40:
    printf("Timestamp signature(0x40).");
    break;
  case 0x50:
    printf("Third-Party Confirmation signature(0x50).");
    break;
  default:
    printf("unknown(%02x)", type);
    break;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<signature_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0x1022(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x50,%rax
ja     126b <signature_type+0x15b>
mov    -0x10(%rbp),%rax
lea    0xebb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xffc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x100f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x102a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x1033(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x1060(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x108d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x10b9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x10e7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x10f4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x1106(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x1116(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x1123(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x1133(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x114a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
lea    0x1152(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127c <signature_type+0x16c>
mov    -0x4(%rbp),%esi
lea    0x1166(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1166(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signature_type>:
push   %rbx
mov    %edi,%ebx
lea    0x101a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x50,%ebx
ja     1169 <signature_type+0x49>
mov    %ebx,%eax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1002(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x101c(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x103e(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x126b(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ec <signature_type+0xcc>
lea    0x103f(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x1076(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x10ad(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x10e3(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x111b(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x1157(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x1171(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x1188(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x11a2(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x11c3(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x11d5(%rip),%rdi
jmp    11e5 <signature_type+0xc5>
lea    0x10fc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"\09Sig type - \00"
@.str.1 = [38 x i8] c"Signature of a binary document(0x00).\00"
@.str.2 = [46 x i8] c"Signature of a canonical text document(0x01).\00"
@.str.3 = [28 x i8] c"Standalone signature(0x02).\00"
@.str.4 = [64 x i8] c"Generic certification of a User ID and Public Key packet(0x10).\00"
@.str.5 = [64 x i8] c"Persona certification of a User ID and Public Key packet.(0x11)\00"
@.str.6 = [63 x i8] c"Casual certification of a User ID and Public Key packet(0x12).\00"
@.str.7 = [65 x i8] c"Positive certification of a User ID and Public Key packet(0x13).\00"
@.str.8 = [32 x i8] c"Subkey Binding Signature(0x18).\00"
@.str.9 = [37 x i8] c"Primary Key Binding Signature(0x19).\00"
@.str.10 = [35 x i8] c"Signature directly on a key(0x1f).\00"
@.str.11 = [32 x i8] c"Key revocation signature(0x20).\00"
@.str.12 = [35 x i8] c"Subkey revocation signature(0x28).\00"
@.str.13 = [42 x i8] c"Certification revocation signature(0x30).\00"
@.str.14 = [27 x i8] c"Timestamp signature(0x40).\00"
@.str.15 = [42 x i8] c"Third-Party Confirmation signature(0x50).\00"
@.str.16 = [14 x i8] c"unknown(%02x)\00"
@.str.17 = [2 x i8] c"\0A\00"
define void @signature_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
switch i32 %4, label %35 [
i32 0, label %5
i32 1, label %7
i32 2, label %9
i32 16, label %11
i32 17, label %13
i32 18, label %15
i32 19, label %17
i32 24, label %19
i32 25, label %21
i32 31, label %23
i32 32, label %25
i32 40, label %27
i32 48, label %29
i32 64, label %31
i32 80, label %33
]
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %38
7: ; preds = %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
br label %38
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %38
11: ; preds = %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0))
br label %38
13: ; preds = %1
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0))
br label %38
15: ; preds = %1
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0))
br label %38
17: ; preds = %1
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0))
br label %38
19: ; preds = %1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
br label %38
21: ; preds = %1
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
br label %38
23: ; preds = %1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
br label %38
25: ; preds = %1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
br label %38
27: ; preds = %1
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0))
br label %38
29: ; preds = %1
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0))
br label %38
31: ; preds = %1
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0))
br label %38
33: ; preds = %1
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0))
br label %38
35: ; preds = %1
%36 = load i32, i32* %2
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %35, %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\09Sig type - \00"
@.str.1 = [38 x i8] c"Signature of a binary document(0x00).\00"
@.str.2 = [46 x i8] c"Signature of a canonical text document(0x01).\00"
@.str.3 = [28 x i8] c"Standalone signature(0x02).\00"
@.str.4 = [64 x i8] c"Generic certification of a User ID and Public Key packet(0x10).\00"
@.str.5 = [64 x i8] c"Persona certification of a User ID and Public Key packet.(0x11)\00"
@.str.6 = [63 x i8] c"Casual certification of a User ID and Public Key packet(0x12).\00"
@.str.7 = [65 x i8] c"Positive certification of a User ID and Public Key packet(0x13).\00"
@.str.8 = [32 x i8] c"Subkey Binding Signature(0x18).\00"
@.str.9 = [37 x i8] c"Primary Key Binding Signature(0x19).\00"
@.str.10 = [35 x i8] c"Signature directly on a key(0x1f).\00"
@.str.11 = [32 x i8] c"Key revocation signature(0x20).\00"
@.str.12 = [35 x i8] c"Subkey revocation signature(0x28).\00"
@.str.13 = [42 x i8] c"Certification revocation signature(0x30).\00"
@.str.14 = [27 x i8] c"Timestamp signature(0x40).\00"
@.str.15 = [42 x i8] c"Third-Party Confirmation signature(0x50).\00"
@.str.16 = [14 x i8] c"unknown(%02x)\00"
define void @signature_type(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
switch i32 %0, label %33 [
i32 0, label %3
i32 1, label %5
i32 2, label %7
i32 16, label %9
i32 17, label %11
i32 18, label %13
i32 19, label %15
i32 24, label %17
i32 25, label %19
i32 31, label %21
i32 32, label %23
i32 40, label %25
i32 48, label %27
i32 64, label %29
i32 80, label %31
]
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %35
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
br label %35
7: ; preds = %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
br label %35
9: ; preds = %1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0))
br label %35
11: ; preds = %1
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0))
br label %35
13: ; preds = %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0))
br label %35
15: ; preds = %1
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0))
br label %35
17: ; preds = %1
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
br label %35
19: ; preds = %1
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
br label %35
21: ; preds = %1
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.10, i64 0, i64 0))
br label %35
23: ; preds = %1
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.11, i64 0, i64 0))
br label %35
25: ; preds = %1
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.12, i64 0, i64 0))
br label %35
27: ; preds = %1
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0))
br label %35
29: ; preds = %1
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0))
br label %35
31: ; preds = %1
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.15, i64 0, i64 0))
br label %35
33: ; preds = %1
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i32 %0)
br label %35
35: ; preds = %33, %31, %29, %27, %25, %23, %21, %19, %17, %15, %13, %11, %9, %7, %5, %3
%36 = tail call i32 @putchar(i32 10)
ret void
}