#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void fprint_type(FILE *f, unsigned char tagcls) {
  const char *s;
  switch (tagcls) {
  case 0x01:
    s = "BOOLEAN";
    break;
  case 0x02:
    s = "INTEGER";
    break;
  case (0x40 | 0xa):
    s = "Integer64";
    break;
  case 0x03:
    s = "BITS";
    break;
  case 0x04:
    s = "OCTET STRING";
    break;
  case 0x05:
    s = "NULL";
    break;
  case 0x06:
    s = "OBJECT IDENTIFIER";
    break;
  case (0x40 | 0x0):
    s = "IPAddress";
    break;
  case (0x40 | 0x1):
    s = "Counter32";
    break;
  case (0x40 | 0x2):
    s = "Gauge32";
    break;
  case (0x40 | 0x3):
    s = "TimeTicks";
    break;
  case (0x40 | 0x6):
    s = "Counter64";
    break;
  case (0x40 | 0x7):
    s = "Unsigned32";
    break;
  case (0x40 | 0xb):
    s = "Gauge64";
    break;
  case (0x40 | 0x5):
    s = "NSAP";
    break;
  case (0x40 | 0x4):
    s = "Opaque";
    break;
  case (0x40 | 0x8):
    s = "Float";
    break;
  case (0x40 | 0x9):
    s = "Double";
    break;
  default:
    s = "(invalid)";
    break;
  }
  fprintf(f, "%-18s", s);
}


x86 assembly (clang, -O0):
<fprint_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x4a,%eax
ja     126c <fprint_type+0x15c>
mov    -0x20(%rbp),%rax
lea    0xebd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfd9(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xfd1(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xfc9(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xfc3(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xfb8(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xfb5(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xfaa(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xfac(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xfa6(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xfa0(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xf98(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xf92(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xf8c(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xf87(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xf7f(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xf74(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xf6b(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xf61(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1277 <fprint_type+0x167>
lea    0xf58(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xf4f(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_type>:
add    $0xff,%sil
cmp    $0x4a,%sil
ja     1194 <fprint_type+0x84>
lea    0x100b(%rip),%rdx
movzbl %sil,%eax
lea    0xed4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xff8(%rip),%rdx
lea    0x1092(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xff7(%rip),%rdx
lea    0x107f(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xfe9(%rip),%rdx
lea    0x106c(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xfe3(%rip),%rdx
lea    0x1059(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xfd5(%rip),%rdx
lea    0x1046(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0x1030(%rip),%rdx
lea    0x1033(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xfc1(%rip),%rdx
lea    0x1020(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xfb8(%rip),%rdx
lea    0x100d(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xfaf(%rip),%rdx
lea    0xffa(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xfa4(%rip),%rdx
lea    0xfe7(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xfbd(%rip),%rdx
lea    0xfd4(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xfa5(%rip),%rdx
lea    0xfc1(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xf75(%rip),%rdx
lea    0xfae(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xf6c(%rip),%rdx
lea    0xf9b(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xf78(%rip),%rdx
lea    0xf88(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xf6b(%rip),%rdx
lea    0xf75(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xed0(%rip),%rdx
lea    0xf62(%rip),%rsi
jmp    1030 <fprintf@plt>
lea    0xf2b(%rip),%rdx
lea    0xf4f(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"BOOLEAN\00"
@.str.1 = [8 x i8] c"INTEGER\00"
@.str.2 = [10 x i8] c"Integer64\00"
@.str.3 = [5 x i8] c"BITS\00"
@.str.4 = [13 x i8] c"OCTET STRING\00"
@.str.5 = [5 x i8] c"NULL\00"
@.str.6 = [18 x i8] c"OBJECT IDENTIFIER\00"
@.str.7 = [10 x i8] c"IPAddress\00"
@.str.8 = [10 x i8] c"Counter32\00"
@.str.9 = [8 x i8] c"Gauge32\00"
@.str.10 = [10 x i8] c"TimeTicks\00"
@.str.11 = [10 x i8] c"Counter64\00"
@.str.12 = [11 x i8] c"Unsigned32\00"
@.str.13 = [8 x i8] c"Gauge64\00"
@.str.14 = [5 x i8] c"NSAP\00"
@.str.15 = [7 x i8] c"Opaque\00"
@.str.16 = [6 x i8] c"Float\00"
@.str.17 = [7 x i8] c"Double\00"
@.str.18 = [10 x i8] c"(invalid)\00"
@.str.19 = [6 x i8] c"%-18s\00"
define void @fprint_type(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i8*
store i32* %0, i32** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
switch i32 %7, label %26 [
i32 1, label %8
i32 2, label %9
i32 74, label %10
i32 3, label %11
i32 4, label %12
i32 5, label %13
i32 6, label %14
i32 64, label %15
i32 65, label %16
i32 66, label %17
i32 67, label %18
i32 70, label %19
i32 71, label %20
i32 75, label %21
i32 69, label %22
i32 68, label %23
i32 72, label %24
i32 73, label %25
]
8: ; preds = %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %5
br label %27
9: ; preds = %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %5
br label %27
10: ; preds = %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %5
br label %27
11: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %5
br label %27
12: ; preds = %2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8** %5
br label %27
13: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %5
br label %27
14: ; preds = %2
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i8** %5
br label %27
15: ; preds = %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8** %5
br label %27
16: ; preds = %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8** %5
br label %27
17: ; preds = %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i8** %5
br label %27
18: ; preds = %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8** %5
br label %27
19: ; preds = %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8** %5
br label %27
20: ; preds = %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8** %5
br label %27
21: ; preds = %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i8** %5
br label %27
22: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8** %5
br label %27
23: ; preds = %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8** %5
br label %27
24: ; preds = %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8** %5
br label %27
25: ; preds = %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i8** %5
br label %27
26: ; preds = %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i8** %5
br label %27
27: ; preds = %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8
%28 = load i32*, i32** %3
%29 = load i8*, i8** %5
%30 = call i32 @fprintf(i32* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %29)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"BOOLEAN\00"
@.str.1 = [8 x i8] c"INTEGER\00"
@.str.2 = [10 x i8] c"Integer64\00"
@.str.3 = [5 x i8] c"BITS\00"
@.str.4 = [13 x i8] c"OCTET STRING\00"
@.str.5 = [5 x i8] c"NULL\00"
@.str.6 = [18 x i8] c"OBJECT IDENTIFIER\00"
@.str.7 = [10 x i8] c"IPAddress\00"
@.str.8 = [10 x i8] c"Counter32\00"
@.str.9 = [8 x i8] c"Gauge32\00"
@.str.10 = [10 x i8] c"TimeTicks\00"
@.str.11 = [10 x i8] c"Counter64\00"
@.str.12 = [11 x i8] c"Unsigned32\00"
@.str.13 = [8 x i8] c"Gauge64\00"
@.str.14 = [5 x i8] c"NSAP\00"
@.str.15 = [7 x i8] c"Opaque\00"
@.str.16 = [6 x i8] c"Float\00"
@.str.17 = [7 x i8] c"Double\00"
@.str.18 = [10 x i8] c"(invalid)\00"
@.str.19 = [6 x i8] c"%-18s\00"
define void @fprint_type(i32* nocapture %0, i8 zeroext %1) {
switch i8 %1, label %20 [
i8 1, label %21
i8 2, label %3
i8 74, label %4
i8 3, label %5
i8 4, label %6
i8 5, label %7
i8 6, label %8
i8 64, label %9
i8 65, label %10
i8 66, label %11
i8 67, label %12
i8 70, label %13
i8 71, label %14
i8 75, label %15
i8 69, label %16
i8 68, label %17
i8 72, label %18
i8 73, label %19
]
3: ; preds = %2
br label %21
4: ; preds = %2
br label %21
5: ; preds = %2
br label %21
6: ; preds = %2
br label %21
7: ; preds = %2
br label %21
8: ; preds = %2
br label %21
9: ; preds = %2
br label %21
10: ; preds = %2
br label %21
11: ; preds = %2
br label %21
12: ; preds = %2
br label %21
13: ; preds = %2
br label %21
14: ; preds = %2
br label %21
15: ; preds = %2
br label %21
16: ; preds = %2
br label %21
17: ; preds = %2
br label %21
18: ; preds = %2
br label %21
19: ; preds = %2
br label %21
20: ; preds = %2
br label %21
21: ; preds = %2, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3
%22 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), %20 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), %19 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), %18 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), %17 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), %16 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), %15 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), %14 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), %13 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), %12 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), %11 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), %10 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), %9 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), %8 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), %2 ]
%23 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %22)
ret void
}