char *ipv4_optnumber(unsigned char id) {
  switch (id) {
  case 0:
    return ("EOOL");
  case 1:
    return ("NOP");
  case 2:
    return ("SEC");
  case 3:
    return ("LSR");
  case 4:
    return ("TS");
  case 5:
    return ("E-SEC");
  case 6:
    return ("CIPSO");
  case 7:
    return ("RR");
  case 8:
    return ("SID");
  case 9:
    return ("SSR");
  case 10:
    return ("ZSU");
  case 11:
    return ("MTUP");
  case 12:
    return ("MTUR");
  case 13:
    return ("FINN");
  case 14:
    return ("VISA");
  case 15:
    return ("ENCODE");
  case 16:
    return ("IMITD");
  case 17:
    return ("EIP");
  case 18:
    return ("TR");
  case 19:
    return ("ADDEXT");
  case 20:
    return ("RTRALT");
  case 21:
    return ("SDB");
  case 23:
    return ("DPS");
  case 24:
    return ("UMP");
  case 25:
    return ("QS");
  case 30:
    return ("EXP");
  }
  return ("UNKNOWN");
}


x86 assembly (clang, -O0):
<ipv4_optnumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x1e,%rax
ja     12d0 <ipv4_optnumber+0x1d0>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf45(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xf3a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xf37(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xf1e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xf12(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xf05(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xefb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xef1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xee4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xecc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xec0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xeaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe9f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe94(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe8b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe81(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe75(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe68(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe5f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe56(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe4a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe3e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe32(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe25(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12db <ipv4_optnumber+0x1db>
lea    0xe19(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv4_optnumber>:
cmp    $0x1e,%dil
ja     1119 <ipv4_optnumber+0x19>
movsbq %dil,%rax
lea    0xf6b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf54(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"EOOL\00"
@.str.1 = [4 x i8] c"NOP\00"
@.str.2 = [4 x i8] c"SEC\00"
@.str.3 = [4 x i8] c"LSR\00"
@.str.4 = [3 x i8] c"TS\00"
@.str.5 = [6 x i8] c"E-SEC\00"
@.str.6 = [6 x i8] c"CIPSO\00"
@.str.7 = [3 x i8] c"RR\00"
@.str.8 = [4 x i8] c"SID\00"
@.str.9 = [4 x i8] c"SSR\00"
@.str.10 = [4 x i8] c"ZSU\00"
@.str.11 = [5 x i8] c"MTUP\00"
@.str.12 = [5 x i8] c"MTUR\00"
@.str.13 = [5 x i8] c"FINN\00"
@.str.14 = [5 x i8] c"VISA\00"
@.str.15 = [7 x i8] c"ENCODE\00"
@.str.16 = [6 x i8] c"IMITD\00"
@.str.17 = [4 x i8] c"EIP\00"
@.str.18 = [3 x i8] c"TR\00"
@.str.19 = [7 x i8] c"ADDEXT\00"
@.str.20 = [7 x i8] c"RTRALT\00"
@.str.21 = [4 x i8] c"SDB\00"
@.str.22 = [4 x i8] c"DPS\00"
@.str.23 = [4 x i8] c"UMP\00"
@.str.24 = [3 x i8] c"QS\00"
@.str.25 = [4 x i8] c"EXP\00"
@.str.26 = [8 x i8] c"UNKNOWN\00"
define i8* @ipv4_optnumber(i8 zeroext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %32 [
i32 0, label %6
i32 1, label %7
i32 2, label %8
i32 3, label %9
i32 4, label %10
i32 5, label %11
i32 6, label %12
i32 7, label %13
i32 8, label %14
i32 9, label %15
i32 10, label %16
i32 11, label %17
i32 12, label %18
i32 13, label %19
i32 14, label %20
i32 15, label %21
i32 16, label %22
i32 17, label %23
i32 18, label %24
i32 19, label %25
i32 20, label %26
i32 21, label %27
i32 23, label %28
i32 24, label %29
i32 25, label %30
i32 30, label %31
]
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %33
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %33
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %33
9: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %33
10: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %33
11: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %33
12: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %33
13: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %33
14: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %33
15: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %33
16: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %33
17: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %33
18: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %33
19: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %33
20: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %33
21: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %33
22: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %33
23: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %33
24: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %33
25: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %33
26: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %33
27: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), i8** %2
br label %33
28: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i64 0, i64 0), i8** %2
br label %33
29: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i64 0, i64 0), i8** %2
br label %33
30: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i8** %2
br label %33
31: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.25, i64 0, i64 0), i8** %2
br label %33
32: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0), i8** %2
br label %33
33: ; preds = %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%34 = load i8*, i8** %2
ret i8* %34
}

LLVM IR (-O2):
@.str = [5 x i8] c"EOOL\00"
@.str.1 = [4 x i8] c"NOP\00"
@.str.2 = [4 x i8] c"SEC\00"
@.str.3 = [4 x i8] c"LSR\00"
@.str.4 = [3 x i8] c"TS\00"
@.str.5 = [6 x i8] c"E-SEC\00"
@.str.6 = [6 x i8] c"CIPSO\00"
@.str.7 = [3 x i8] c"RR\00"
@.str.8 = [4 x i8] c"SID\00"
@.str.9 = [4 x i8] c"SSR\00"
@.str.10 = [4 x i8] c"ZSU\00"
@.str.11 = [5 x i8] c"MTUP\00"
@.str.12 = [5 x i8] c"MTUR\00"
@.str.13 = [5 x i8] c"FINN\00"
@.str.14 = [5 x i8] c"VISA\00"
@.str.15 = [7 x i8] c"ENCODE\00"
@.str.16 = [6 x i8] c"IMITD\00"
@.str.17 = [4 x i8] c"EIP\00"
@.str.18 = [3 x i8] c"TR\00"
@.str.19 = [7 x i8] c"ADDEXT\00"
@.str.20 = [7 x i8] c"RTRALT\00"
@.str.21 = [4 x i8] c"SDB\00"
@.str.22 = [4 x i8] c"DPS\00"
@.str.23 = [4 x i8] c"UMP\00"
@.str.24 = [3 x i8] c"QS\00"
@.str.25 = [4 x i8] c"EXP\00"
@.str.26 = [8 x i8] c"UNKNOWN\00"
@reltable.ipv4_optnumber = [31 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.1 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.3 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.5 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.6 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.7 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.8 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.9 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.10 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.11 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.12 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.13 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.14 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.15 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.16 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.17 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.18 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.19 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.20 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.21 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.26 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.22 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.23 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.24 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.26 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.26 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.26 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.26 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.25 to i64), i64 ptrtoint ([31 x i32]* @reltable.ipv4_optnumber to i64)) to i32)]
define i8* @ipv4_optnumber(i8 zeroext %0) {
%2 = icmp ult i8 %0, 31
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([31 x i32]* @reltable.ipv4_optnumber to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i64 0, i64 0), %1 ]
ret i8* %8
}