const char *dvb_component_type3_str(int component_type) {
  switch (component_type) {
  case 0x01:
    return "EBU Teletext subtitles";
  case 0x02:
    return "associated EBU Teletext";
  case 0x03:
    return "VBI data";
  case 0x10:
    return "DVB subtitles (normal) with no monitor aspect ratio criticality";
  case 0x11:
    return "DVB subtitles (normal) for display on 4:3 aspect ratio monitor";
  case 0x12:
    return "DVB subtitles (normal) for display on 16:9 aspect ratio monitor";
  case 0x13:
    return "DVB subtitles (normal) for display on 2.21:1 aspect ratio monitor";
  case 0x14:
    return "DVB subtitles (normal) for display on a high definition monitor";
  case 0x20:
    return "DVB subtitles (for the hard of hearing) with no monitor aspect "
           "ratio criticality";
  case 0x21:
    return "DVB subtitles (for the hard of hearing) for display on 4:3 aspect "
           "ratio monitor";
  case 0x22:
    return "DVB subtitles (for the hard of hearing) for display on 16:9 aspect "
           "ratio monitor";
  case 0x23:
    return "DVB subtitles (for the hard of hearing) for display on 2.21:1 "
           "aspect ratio monitor";
  case 0x24:
    return "DVB subtitles (for the hard of hearing) for display on a high "
           "definition monitor";
  default:
    if (component_type >= 0xb0 && component_type <= 0xfe) {
      return "user defined";
    }
    break;
  }
  return "reserved";
}


x86 assembly (clang, -O0):
<dvb_component_type3_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x23,%eax
ja     1200 <dvb_component_type3_str+0x100>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf59(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0xf60(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0xf68(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0xf61(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0xf91(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0xfc0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0xff0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0x1022(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0x1052(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0x1093(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0x10d3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0x1114(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
lea    0x1157(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
cmpl   $0xb0,-0xc(%rbp)
jl     122a <dvb_component_type3_str+0x12a>
cmpl   $0xfe,-0xc(%rbp)
jg     122a <dvb_component_type3_str+0x12a>
lea    0x117e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    123a <dvb_component_type3_str+0x13a>
jmp    122f <dvb_component_type3_str+0x12f>
lea    0x1176(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvb_component_type3_str>:
lea    -0x1(%rdi),%ecx
cmp    $0x23,%ecx
ja     112f <dvb_component_type3_str+0x2f>
lea    0xf81(%rip),%rax
lea    0xeea(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
lea    0xf81(%rip),%rax
ret
lea    0xf91(%rip),%rax
ret
add    $0xffffff50,%edi
cmp    $0x4f,%edi
lea    0x1260(%rip),%rcx
lea    0x1266(%rip),%rax
cmovb  %rcx,%rax
ret
lea    0xf76(%rip),%rax
ret
lea    0xfae(%rip),%rax
ret
lea    0xfe5(%rip),%rax
ret
lea    0x101d(%rip),%rax
ret
lea    0x1057(%rip),%rax
ret
lea    0x108f(%rip),%rax
ret
lea    0x10d8(%rip),%rax
ret
lea    0x1120(%rip),%rax
ret
lea    0x1169(%rip),%rax
ret
lea    0x11b4(%rip),%rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"EBU Teletext subtitles\00"
@.str.1 = [24 x i8] c"associated EBU Teletext\00"
@.str.2 = [9 x i8] c"VBI data\00"
@.str.3 = [64 x i8] c"DVB subtitles (normal) with no monitor aspect ratio criticality\00"
@.str.4 = [63 x i8] c"DVB subtitles (normal) for display on 4:3 aspect ratio monitor\00"
@.str.5 = [64 x i8] c"DVB subtitles (normal) for display on 16:9 aspect ratio monitor\00"
@.str.6 = [66 x i8] c"DVB subtitles (normal) for display on 2.21:1 aspect ratio monitor\00"
@.str.7 = [64 x i8] c"DVB subtitles (normal) for display on a high definition monitor\00"
@.str.8 = [81 x i8] c"DVB subtitles (for the hard of hearing) with no monitor aspect ratio criticality\00"
@.str.9 = [80 x i8] c"DVB subtitles (for the hard of hearing) for display on 4:3 aspect ratio monitor\00"
@.str.10 = [81 x i8] c"DVB subtitles (for the hard of hearing) for display on 16:9 aspect ratio monitor\00"
@.str.11 = [83 x i8] c"DVB subtitles (for the hard of hearing) for display on 2.21:1 aspect ratio monitor\00"
@.str.12 = [81 x i8] c"DVB subtitles (for the hard of hearing) for display on a high definition monitor\00"
@.str.13 = [13 x i8] c"user defined\00"
@.str.14 = [9 x i8] c"reserved\00"
define i8* @dvb_component_type3_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %18 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 16, label %8
i32 17, label %9
i32 18, label %10
i32 19, label %11
i32 20, label %12
i32 32, label %13
i32 33, label %14
i32 34, label %15
i32 35, label %16
i32 36, label %17
]
5: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %2
br label %27
6: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %27
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %27
8: ; preds = %1
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %27
9: ; preds = %1
store i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %27
10: ; preds = %1
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %27
11: ; preds = %1
store i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %27
12: ; preds = %1
store i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %27
13: ; preds = %1
store i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %27
14: ; preds = %1
store i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %27
15: ; preds = %1
store i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %27
16: ; preds = %1
store i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %27
17: ; preds = %1
store i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %27
18: ; preds = %1
%19 = load i32, i32* %3
%20 = icmp sge i32 %19, 176
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp sle i32 %22, 254
br i1 %23, label %24, label %25
24: ; preds = %21
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %27
25: ; preds = %21, %18
br label %26
26: ; preds = %25
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %27
27: ; preds = %26, %24, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%28 = load i8*, i8** %2
ret i8* %28
}

LLVM IR (-O2):
@.str = [23 x i8] c"EBU Teletext subtitles\00"
@.str.1 = [24 x i8] c"associated EBU Teletext\00"
@.str.2 = [9 x i8] c"VBI data\00"
@.str.3 = [64 x i8] c"DVB subtitles (normal) with no monitor aspect ratio criticality\00"
@.str.4 = [63 x i8] c"DVB subtitles (normal) for display on 4:3 aspect ratio monitor\00"
@.str.5 = [64 x i8] c"DVB subtitles (normal) for display on 16:9 aspect ratio monitor\00"
@.str.6 = [66 x i8] c"DVB subtitles (normal) for display on 2.21:1 aspect ratio monitor\00"
@.str.7 = [64 x i8] c"DVB subtitles (normal) for display on a high definition monitor\00"
@.str.8 = [81 x i8] c"DVB subtitles (for the hard of hearing) with no monitor aspect ratio criticality\00"
@.str.9 = [80 x i8] c"DVB subtitles (for the hard of hearing) for display on 4:3 aspect ratio monitor\00"
@.str.10 = [81 x i8] c"DVB subtitles (for the hard of hearing) for display on 16:9 aspect ratio monitor\00"
@.str.11 = [83 x i8] c"DVB subtitles (for the hard of hearing) for display on 2.21:1 aspect ratio monitor\00"
@.str.12 = [81 x i8] c"DVB subtitles (for the hard of hearing) for display on a high definition monitor\00"
@.str.13 = [13 x i8] c"user defined\00"
@.str.14 = [9 x i8] c"reserved\00"
define i8* @dvb_component_type3_str(i32 %0) {
switch i32 %0, label %14 [
i32 1, label %18
i32 2, label %2
i32 3, label %3
i32 16, label %4
i32 17, label %5
i32 18, label %6
i32 19, label %7
i32 20, label %8
i32 32, label %9
i32 33, label %10
i32 34, label %11
i32 35, label %12
i32 36, label %13
]
2: ; preds = %1
br label %18
3: ; preds = %1
br label %18
4: ; preds = %1
br label %18
5: ; preds = %1
br label %18
6: ; preds = %1
br label %18
7: ; preds = %1
br label %18
8: ; preds = %1
br label %18
9: ; preds = %1
br label %18
10: ; preds = %1
br label %18
11: ; preds = %1
br label %18
12: ; preds = %1
br label %18
13: ; preds = %1
br label %18
14: ; preds = %1
%15 = add i32 %0, -176
%16 = icmp ult i32 %15, 79
%17 = select i1 %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0)
br label %18
18: ; preds = %14, %1, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%19 = phi i8* [ getelementptr inbounds ([81 x i8], [81 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([83 x i8], [83 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([81 x i8], [81 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([80 x i8], [80 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([81 x i8], [81 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([64 x i8], [64 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([66 x i8], [66 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([64 x i8], [64 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), %1 ], [ %17, %14 ]
ret i8* %19
}