char *ct_subtype_str(int type, int subtype) {
  switch (type) {
  case 0x01:
    switch (subtype) {
    case 0x01:
      return "octets";
    case 0x02:
      return "postscript";
    default:
      return "unknown_app_subtype";
    }
  case 0x04:
    switch (subtype) {
    case 0x01:
      return "rfc822";
    case 0x02:
      return "external";
    default:
      return "unknown_msg_subtype";
    }
  case 0x05:
    switch (subtype) {
    case 0x01:
      return "mixed";
    case 0x02:
      return "alternative";
    case 0x03:
      return "digest";
    case 0x04:
      return "parallel";
    case 0x05:
      return "related";
    default:
      return "unknown_multipart_subtype";
    }
  case 0x06:
    switch (subtype) {
    case 0x01:
      return "plain";
    case 0x02:
      return "richtext";
    case 0x03:
      return "enriched";
    default:
      return "unknown_text_subtype";
    }
  default:
    return "unknown_type";
  }
}


x86 assembly (clang, -O0):
<ct_subtype_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     12dc <ct_subtype_str+0x1dc>
mov    -0x18(%rbp),%rax
lea    0xed6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     1158 <ct_subtype_str+0x58>
jmp    1147 <ct_subtype_str+0x47>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     1168 <ct_subtype_str+0x68>
jmp    1178 <ct_subtype_str+0x78>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xebf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x1,%eax
je     11ad <ct_subtype_str+0xad>
jmp    119c <ct_subtype_str+0x9c>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
je     11bd <ct_subtype_str+0xbd>
jmp    11cd <ct_subtype_str+0xcd>
lea    0xe9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe95(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe8e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x4,%eax
ja     1256 <ct_subtype_str+0x156>
mov    -0x28(%rbp),%rax
lea    0xe1b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe69(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe5f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe5b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe52(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe4b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe43(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
mov    -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x1,%eax
je     129c <ct_subtype_str+0x19c>
jmp    127a <ct_subtype_str+0x17a>
mov    -0x2c(%rbp),%eax
sub    $0x2,%eax
je     12ac <ct_subtype_str+0x1ac>
jmp    128b <ct_subtype_str+0x18b>
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
je     12bc <ct_subtype_str+0x1bc>
jmp    12cc <ct_subtype_str+0x1cc>
lea    0xe17(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe0d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe06(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xdff(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12e7 <ct_subtype_str+0x1e7>
lea    0xe04(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_subtype_str>:
lea    0xfec(%rip),%rax
add    $0xffffffff,%edi
cmp    $0x5,%edi
ja     1198 <ct_subtype_str+0x98>
lea    0xee6(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
cmp    $0x2,%esi
lea    0xf12(%rip),%rax
lea    0xf16(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%esi
lea    0xef6(%rip),%rax
cmovne %rcx,%rax
ret
cmp    $0x2,%esi
lea    0xf14(%rip),%rax
lea    0xf16(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%esi
lea    0xef8(%rip),%rax
cmovne %rcx,%rax
ret
add    $0xffffffff,%esi
cmp    $0x5,%esi
jae    1199 <ct_subtype_str+0x99>
movslq %esi,%rax
lea    0xe9b(%rip),%rcx
jmp    1191 <ct_subtype_str+0x91>
add    $0xffffffff,%esi
cmp    $0x3,%esi
jae    11a1 <ct_subtype_str+0xa1>
movslq %esi,%rax
lea    0xe9b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf0c(%rip),%rax
ret
lea    0xf36(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"octets\00"
@.str.1 = [11 x i8] c"postscript\00"
@.str.2 = [20 x i8] c"unknown_app_subtype\00"
@.str.3 = [7 x i8] c"rfc822\00"
@.str.4 = [9 x i8] c"external\00"
@.str.5 = [20 x i8] c"unknown_msg_subtype\00"
@.str.6 = [6 x i8] c"mixed\00"
@.str.7 = [12 x i8] c"alternative\00"
@.str.8 = [7 x i8] c"digest\00"
@.str.9 = [9 x i8] c"parallel\00"
@.str.10 = [8 x i8] c"related\00"
@.str.11 = [26 x i8] c"unknown_multipart_subtype\00"
@.str.12 = [6 x i8] c"plain\00"
@.str.13 = [9 x i8] c"richtext\00"
@.str.14 = [9 x i8] c"enriched\00"
@.str.15 = [21 x i8] c"unknown_text_subtype\00"
@.str.16 = [13 x i8] c"unknown_type\00"
define i8* @ct_subtype_str(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %31 [
i32 1, label %7
i32 4, label %12
i32 5, label %17
i32 6, label %25
]
7: ; preds = %2
%8 = load i32, i32* %5
switch i32 %8, label %11 [
i32 1, label %9
i32 2, label %10
]
9: ; preds = %7
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
br label %32
10: ; preds = %7
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %32
11: ; preds = %7
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %32
12: ; preds = %2
%13 = load i32, i32* %5
switch i32 %13, label %16 [
i32 1, label %14
i32 2, label %15
]
14: ; preds = %12
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %32
15: ; preds = %12
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %32
16: ; preds = %12
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %32
17: ; preds = %2
%18 = load i32, i32* %5
switch i32 %18, label %24 [
i32 1, label %19
i32 2, label %20
i32 3, label %21
i32 4, label %22
i32 5, label %23
]
19: ; preds = %17
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %32
20: ; preds = %17
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %32
21: ; preds = %17
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %32
22: ; preds = %17
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %32
23: ; preds = %17
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %32
24: ; preds = %17
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %32
25: ; preds = %2
%26 = load i32, i32* %5
switch i32 %26, label %30 [
i32 1, label %27
i32 2, label %28
i32 3, label %29
]
27: ; preds = %25
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %32
28: ; preds = %25
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %32
29: ; preds = %25
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8** %3
br label %32
30: ; preds = %25
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8** %3
br label %32
31: ; preds = %2
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), i8** %3
br label %32
32: ; preds = %31, %30, %29, %28, %27, %24, %23, %22, %21, %20, %19, %16, %15, %14, %11, %10, %9
%33 = load i8*, i8** %3
ret i8* %33
}

LLVM IR (-O2):
@.str = [7 x i8] c"octets\00"
@.str.1 = [11 x i8] c"postscript\00"
@.str.2 = [20 x i8] c"unknown_app_subtype\00"
@.str.3 = [7 x i8] c"rfc822\00"
@.str.4 = [9 x i8] c"external\00"
@.str.5 = [20 x i8] c"unknown_msg_subtype\00"
@.str.6 = [6 x i8] c"mixed\00"
@.str.7 = [12 x i8] c"alternative\00"
@.str.8 = [7 x i8] c"digest\00"
@.str.9 = [9 x i8] c"parallel\00"
@.str.10 = [8 x i8] c"related\00"
@.str.11 = [26 x i8] c"unknown_multipart_subtype\00"
@.str.12 = [6 x i8] c"plain\00"
@.str.13 = [9 x i8] c"richtext\00"
@.str.14 = [9 x i8] c"enriched\00"
@.str.15 = [21 x i8] c"unknown_text_subtype\00"
@.str.16 = [13 x i8] c"unknown_type\00"
@reltable.ct_subtype_str = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([5 x i32]* @reltable.ct_subtype_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @.str.7 to i64), i64 ptrtoint ([5 x i32]* @reltable.ct_subtype_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.8 to i64), i64 ptrtoint ([5 x i32]* @reltable.ct_subtype_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.9 to i64), i64 ptrtoint ([5 x i32]* @reltable.ct_subtype_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.10 to i64), i64 ptrtoint ([5 x i32]* @reltable.ct_subtype_str to i64)) to i32)]
@reltable.ct_subtype_str.18 = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.12 to i64), i64 ptrtoint ([3 x i32]* @reltable.ct_subtype_str.18 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.13 to i64), i64 ptrtoint ([3 x i32]* @reltable.ct_subtype_str.18 to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.14 to i64), i64 ptrtoint ([3 x i32]* @reltable.ct_subtype_str.18 to i64)) to i32)]
define i8* @ct_subtype_str(i32 %0, i32 %1) {
switch i32 %0, label %27 [
i32 1, label %3
i32 4, label %8
i32 5, label %13
i32 6, label %16
]
3: ; preds = %2
%4 = icmp eq i32 %1, 2
%5 = select i1 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0)
%6 = icmp eq i32 %1, 1
%7 = select i1 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5
br label %27
8: ; preds = %2
%9 = icmp eq i32 %1, 2
%10 = select i1 %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0)
%11 = icmp eq i32 %1, 1
%12 = select i1 %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %10
br label %27
13: ; preds = %2
%14 = add i32 %1, -1
%15 = icmp ult i32 %14, 5
br i1 %15, label %19, label %27
16: ; preds = %2
%17 = add i32 %1, -1
%18 = icmp ult i32 %17, 3
br i1 %18, label %23, label %27
19: ; preds = %13
%20 = sext i32 %14 to i64
%21 = shl i64 %20, 2
%22 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.ct_subtype_str to i8*), i64 %21)
br label %27
23: ; preds = %16
%24 = sext i32 %17 to i64
%25 = shl i64 %24, 2
%26 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.ct_subtype_str.18 to i8*), i64 %25)
br label %27
27: ; preds = %16, %23, %13, %19, %2, %8, %3
%28 = phi i8* [ %7, %3 ], [ %12, %8 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), %2 ], [ %22, %19 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), %13 ], [ %26, %23 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), %16 ]
ret i8* %28
}