char *ethertype(unsigned short id) {
  switch (id) {
  case 0x0800:
    return ("IPv4");
  case 0x0806:
    return ("ARP");
  case 0x0842:
    return ("Wake-on-LAN");
  case 0x22F3:
    return ("IETF TRILL Protocol");
  case 0x6003:
    return ("DECnet Phase IV");
  case 0x8035:
    return ("RARP");
  case 0x809B:
    return ("AppleTalk (Ethertalk)");
  case 0x80F3:
    return ("AARP");
  case 0x8100:
    return ("VLAN-tagged frame (IEEE 802.1Q)");
  case 0x8137:
    return ("IPX");
  case 0x8138:
    return ("IPX");
  case 0x8204:
    return ("QNX Qnet");
  case 0x86DD:
    return ("IPv6");
  case 0x8808:
    return ("Ethernet flow control");
  case 0x8809:
    return ("Slow Protocols (IEEE 802.3)");
  case 0x8819:
    return ("CobraNet");
  case 0x8847:
    return ("MPLS unicast");
  case 0x8848:
    return ("MPLS multicast");
  case 0x8863:
    return ("PPPoE Discovery Stage");
  case 0x8864:
    return ("PPPoE Session Stage");
  case 0x8870:
    return ("Jumbo Frames");
  case 0x887B:
    return ("HomePlug 1.0 MME");
  case 0x888E:
    return ("EAP over LAN (IEEE 802.1X)");
  case 0x8892:
    return ("PROFINET Protocol");
  case 0x889A:
    return ("HyperSCSI");
  case 0x88A2:
    return ("ATA over Ethernet");
  case 0x88A4:
    return ("EtherCAT Protocol");
  case 0x88A8:
    return ("Provider Bridging (IEEE 802.1ad)");
  case 0x88AB:
    return ("Ethernet Powerlink");
  case 0x88CC:
    return ("LLDP");
  case 0x88CD:
    return ("SERCOS III");
  case 0x88E1:
    return ("HomePlug AV MME");
  case 0x88E3:
    return ("Media Redundancy Protocol (IEC62439-2)");
  case 0x88E5:
    return ("MAC security (IEEE 802.1AE)");
  case 0x88F7:
    return ("Precision Time Protocol (IEEE 1588)");
  case 0x8902:
    return ("IEEE 802.1ag Connectivity Fault Management (CFM) Protocol");
  case 0x8906:
    return ("Fibre Channel over Ethernet (FCoE)");
  case 0x8914:
    return ("FCoE Initialization Protocol");
  case 0x8915:
    return ("RDMA over Converged Ethernet (RoCE)");
  case 0x892F:
    return ("High-availability Seamless Redundancy (HSR)");
  case 0x9000:
    return ("Ethernet Configuration Testing Protocol");
  case 0x9100:
    return ("Q-in-Q");
  case 0xCAFE:
    return ("Veritas Low Latency Transport (LLT)");
  }
  return ("UNKNOWN");
}


x86 assembly (clang, -O0):
<ethertype>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x800,%eax
je     1440 <ethertype+0x340>
jmp    1122 <ethertype+0x22>
mov    -0x10(%rbp),%eax
sub    $0x806,%eax
je     1450 <ethertype+0x350>
jmp    1135 <ethertype+0x35>
mov    -0x10(%rbp),%eax
sub    $0x842,%eax
je     1460 <ethertype+0x360>
jmp    1148 <ethertype+0x48>
mov    -0x10(%rbp),%eax
sub    $0x22f3,%eax
je     1470 <ethertype+0x370>
jmp    115b <ethertype+0x5b>
mov    -0x10(%rbp),%eax
sub    $0x6003,%eax
je     1480 <ethertype+0x380>
jmp    116e <ethertype+0x6e>
mov    -0x10(%rbp),%eax
sub    $0x8035,%eax
je     1490 <ethertype+0x390>
jmp    1181 <ethertype+0x81>
mov    -0x10(%rbp),%eax
sub    $0x809b,%eax
je     14a0 <ethertype+0x3a0>
jmp    1194 <ethertype+0x94>
mov    -0x10(%rbp),%eax
sub    $0x80f3,%eax
je     14b0 <ethertype+0x3b0>
jmp    11a7 <ethertype+0xa7>
mov    -0x10(%rbp),%eax
sub    $0x8100,%eax
je     14c0 <ethertype+0x3c0>
jmp    11ba <ethertype+0xba>
mov    -0x10(%rbp),%eax
sub    $0x8137,%eax
je     14d0 <ethertype+0x3d0>
jmp    11cd <ethertype+0xcd>
mov    -0x10(%rbp),%eax
sub    $0x8138,%eax
je     14e0 <ethertype+0x3e0>
jmp    11e0 <ethertype+0xe0>
mov    -0x10(%rbp),%eax
sub    $0x8204,%eax
je     14f0 <ethertype+0x3f0>
jmp    11f3 <ethertype+0xf3>
mov    -0x10(%rbp),%eax
sub    $0x86dd,%eax
je     1500 <ethertype+0x400>
jmp    1206 <ethertype+0x106>
mov    -0x10(%rbp),%eax
sub    $0x8808,%eax
je     1510 <ethertype+0x410>
jmp    1219 <ethertype+0x119>
mov    -0x10(%rbp),%eax
sub    $0x8809,%eax
je     1520 <ethertype+0x420>
jmp    122c <ethertype+0x12c>
mov    -0x10(%rbp),%eax
sub    $0x8819,%eax
je     1530 <ethertype+0x430>
jmp    123f <ethertype+0x13f>
mov    -0x10(%rbp),%eax
sub    $0x8847,%eax
je     1540 <ethertype+0x440>
jmp    1252 <ethertype+0x152>
mov    -0x10(%rbp),%eax
sub    $0x8848,%eax
je     1550 <ethertype+0x450>
jmp    1265 <ethertype+0x165>
mov    -0x10(%rbp),%eax
sub    $0x8863,%eax
je     1560 <ethertype+0x460>
jmp    1278 <ethertype+0x178>
mov    -0x10(%rbp),%eax
sub    $0x8864,%eax
je     1570 <ethertype+0x470>
jmp    128b <ethertype+0x18b>
mov    -0x10(%rbp),%eax
sub    $0x8870,%eax
je     1580 <ethertype+0x480>
jmp    129e <ethertype+0x19e>
mov    -0x10(%rbp),%eax
sub    $0x887b,%eax
je     1590 <ethertype+0x490>
jmp    12b1 <ethertype+0x1b1>
mov    -0x10(%rbp),%eax
sub    $0x888e,%eax
je     15a0 <ethertype+0x4a0>
jmp    12c4 <ethertype+0x1c4>
mov    -0x10(%rbp),%eax
sub    $0x8892,%eax
je     15b0 <ethertype+0x4b0>
jmp    12d7 <ethertype+0x1d7>
mov    -0x10(%rbp),%eax
sub    $0x889a,%eax
je     15c0 <ethertype+0x4c0>
jmp    12ea <ethertype+0x1ea>
mov    -0x10(%rbp),%eax
sub    $0x88a2,%eax
je     15d0 <ethertype+0x4d0>
jmp    12fd <ethertype+0x1fd>
mov    -0x10(%rbp),%eax
sub    $0x88a4,%eax
je     15e0 <ethertype+0x4e0>
jmp    1310 <ethertype+0x210>
mov    -0x10(%rbp),%eax
sub    $0x88a8,%eax
je     15f0 <ethertype+0x4f0>
jmp    1323 <ethertype+0x223>
mov    -0x10(%rbp),%eax
sub    $0x88ab,%eax
je     1600 <ethertype+0x500>
jmp    1336 <ethertype+0x236>
mov    -0x10(%rbp),%eax
sub    $0x88cc,%eax
je     1610 <ethertype+0x510>
jmp    1349 <ethertype+0x249>
mov    -0x10(%rbp),%eax
sub    $0x88cd,%eax
je     1620 <ethertype+0x520>
jmp    135c <ethertype+0x25c>
mov    -0x10(%rbp),%eax
sub    $0x88e1,%eax
je     1630 <ethertype+0x530>
jmp    136f <ethertype+0x26f>
mov    -0x10(%rbp),%eax
sub    $0x88e3,%eax
je     1640 <ethertype+0x540>
jmp    1382 <ethertype+0x282>
mov    -0x10(%rbp),%eax
sub    $0x88e5,%eax
je     1650 <ethertype+0x550>
jmp    1395 <ethertype+0x295>
mov    -0x10(%rbp),%eax
sub    $0x88f7,%eax
je     1660 <ethertype+0x560>
jmp    13a8 <ethertype+0x2a8>
mov    -0x10(%rbp),%eax
sub    $0x8902,%eax
je     1670 <ethertype+0x570>
jmp    13bb <ethertype+0x2bb>
mov    -0x10(%rbp),%eax
sub    $0x8906,%eax
je     1680 <ethertype+0x580>
jmp    13ce <ethertype+0x2ce>
mov    -0x10(%rbp),%eax
sub    $0x8914,%eax
je     1690 <ethertype+0x590>
jmp    13e1 <ethertype+0x2e1>
mov    -0x10(%rbp),%eax
sub    $0x8915,%eax
je     16a0 <ethertype+0x5a0>
jmp    13f4 <ethertype+0x2f4>
mov    -0x10(%rbp),%eax
sub    $0x892f,%eax
je     16b0 <ethertype+0x5b0>
jmp    1407 <ethertype+0x307>
mov    -0x10(%rbp),%eax
sub    $0x9000,%eax
je     16c0 <ethertype+0x5c0>
jmp    141a <ethertype+0x31a>
mov    -0x10(%rbp),%eax
sub    $0x9100,%eax
je     16d0 <ethertype+0x5d0>
jmp    142d <ethertype+0x32d>
mov    -0x10(%rbp),%eax
sub    $0xcafe,%eax
je     16e0 <ethertype+0x5e0>
jmp    16f0 <ethertype+0x5f0>
lea    0xbb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xbfa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb9a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb93(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb99(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb8e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb8e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb82(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb7b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb70(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb76(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb82(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb7b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb78(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb77(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb7d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb81(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb7e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb7f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb8a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb8c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb86(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb88(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb8a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb9b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb9e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb93(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb8e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xb8e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xba5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xbb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xbc5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xbef(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xc02(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xc0f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xc23(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xc3f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xc57(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xc4e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    16fb <ethertype+0x5fb>
lea    0xc62(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ethertype>:
movswl %di,%eax
cmp    $0xffff8846,%eax
jle    1140 <ethertype+0x40>
cmp    $0xffff8fff,%eax
jg     117e <ethertype+0x7e>
add    $0x77b9,%edi
movzwl %di,%eax
cmp    $0xe8,%eax
ja     13ac <ethertype+0x2ac>
movzwl %di,%eax
lea    0xed1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1327(%rip),%rax
ret
cmp    $0xffff8137,%eax
jle    11b1 <ethertype+0xb1>
cmp    $0xffff8807,%eax
jg     1216 <ethertype+0x116>
movzwl %di,%eax
cmp    $0x8138,%eax
je     11e0 <ethertype+0xe0>
cmp    $0x8204,%eax
je     135c <ethertype+0x25c>
cmp    $0x86dd,%eax
jne    13ac <ethertype+0x2ac>
lea    0x12a9(%rip),%rax
ret
cmp    $0x805,%eax
jg     11e8 <ethertype+0xe8>
cmp    $0xffffcafd,%eax
jg     1242 <ethertype+0x142>
movzwl %di,%eax
cmp    $0x9000,%eax
je     1364 <ethertype+0x264>
cmp    $0x9100,%eax
jne    13ac <ethertype+0x2ac>
lea    0x1522(%rip),%rax
ret
cmp    $0xffff80f2,%eax
jle    1263 <ethertype+0x163>
movzwl %di,%eax
cmp    $0x80f3,%eax
je     136c <ethertype+0x26c>
cmp    $0x8100,%eax
je     1374 <ethertype+0x274>
cmp    $0x8137,%eax
jne    13ac <ethertype+0x2ac>
lea    0x1232(%rip),%rax
ret
movzwl %di,%ecx
cmp    $0x22f2,%eax
jg     1284 <ethertype+0x184>
cmp    $0x806,%ecx
je     137c <ethertype+0x27c>
cmp    $0x842,%ecx
jne    13ac <ethertype+0x2ac>
lea    0x1194(%rip),%rax
ret
movzwl %di,%eax
cmp    $0x8808,%eax
je     1384 <ethertype+0x284>
cmp    $0x8809,%eax
je     138c <ethertype+0x28c>
cmp    $0x8819,%eax
jne    13ac <ethertype+0x2ac>
lea    0x121c(%rip),%rax
ret
movzwl %di,%eax
cmp    $0xcafe,%eax
je     1394 <ethertype+0x294>
cmp    $0x800,%eax
jne    13ac <ethertype+0x2ac>
lea    0x1142(%rip),%rax
ret
movzwl %di,%eax
cmp    $0x8035,%eax
je     139c <ethertype+0x29c>
cmp    $0x809b,%eax
jne    13ac <ethertype+0x2ac>
lea    0x115b(%rip),%rax
ret
cmp    $0x22f3,%ecx
je     13a4 <ethertype+0x2a4>
cmp    $0x6003,%ecx
jne    13ac <ethertype+0x2ac>
lea    0x1126(%rip),%rax
ret
lea    0x11c8(%rip),%rax
ret
lea    0x11cf(%rip),%rax
ret
lea    0x11dd(%rip),%rax
ret
lea    0x11e9(%rip),%rax
ret
lea    0x11ee(%rip),%rax
ret
lea    0x11f7(%rip),%rax
ret
lea    0x120a(%rip),%rax
ret
lea    0x1214(%rip),%rax
ret
lea    0x1216(%rip),%rax
ret
lea    0x1220(%rip),%rax
ret
lea    0x122a(%rip),%rax
ret
lea    0x1243(%rip),%rax
ret
lea    0x124e(%rip),%rax
ret
lea    0x124b(%rip),%rax
ret
lea    0x124e(%rip),%rax
ret
lea    0x1256(%rip),%rax
ret
lea    0x1275(%rip),%rax
ret
lea    0x1289(%rip),%rax
ret
lea    0x12a5(%rip),%rax
ret
lea    0x12d7(%rip),%rax
ret
lea    0x12f2(%rip),%rax
ret
lea    0x1307(%rip),%rax
ret
lea    0x1323(%rip),%rax
ret
lea    0x10ba(%rip),%rax
ret
lea    0x133f(%rip),%rax
ret
lea    0x1081(%rip),%rax
ret
lea    0x107e(%rip),%rax
ret
lea    0x1072(%rip),%rax
ret
lea    0x10a0(%rip),%rax
ret
lea    0x10ae(%rip),%rax
ret
lea    0x133e(%rip),%rax
ret
lea    0x1036(%rip),%rax
ret
lea    0x100a(%rip),%rax
ret
lea    0x134a(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"IPv4\00"
@.str.1 = [4 x i8] c"ARP\00"
@.str.2 = [12 x i8] c"Wake-on-LAN\00"
@.str.3 = [20 x i8] c"IETF TRILL Protocol\00"
@.str.4 = [16 x i8] c"DECnet Phase IV\00"
@.str.5 = [5 x i8] c"RARP\00"
@.str.6 = [22 x i8] c"AppleTalk (Ethertalk)\00"
@.str.7 = [5 x i8] c"AARP\00"
@.str.8 = [32 x i8] c"VLAN-tagged frame (IEEE 802.1Q)\00"
@.str.9 = [4 x i8] c"IPX\00"
@.str.10 = [9 x i8] c"QNX Qnet\00"
@.str.11 = [5 x i8] c"IPv6\00"
@.str.12 = [22 x i8] c"Ethernet flow control\00"
@.str.13 = [28 x i8] c"Slow Protocols (IEEE 802.3)\00"
@.str.14 = [9 x i8] c"CobraNet\00"
@.str.15 = [13 x i8] c"MPLS unicast\00"
@.str.16 = [15 x i8] c"MPLS multicast\00"
@.str.17 = [22 x i8] c"PPPoE Discovery Stage\00"
@.str.18 = [20 x i8] c"PPPoE Session Stage\00"
@.str.19 = [13 x i8] c"Jumbo Frames\00"
@.str.20 = [17 x i8] c"HomePlug 1.0 MME\00"
@.str.21 = [27 x i8] c"EAP over LAN (IEEE 802.1X)\00"
@.str.22 = [18 x i8] c"PROFINET Protocol\00"
@.str.23 = [10 x i8] c"HyperSCSI\00"
@.str.24 = [18 x i8] c"ATA over Ethernet\00"
@.str.25 = [18 x i8] c"EtherCAT Protocol\00"
@.str.26 = [33 x i8] c"Provider Bridging (IEEE 802.1ad)\00"
@.str.27 = [19 x i8] c"Ethernet Powerlink\00"
@.str.28 = [5 x i8] c"LLDP\00"
@.str.29 = [11 x i8] c"SERCOS III\00"
@.str.30 = [16 x i8] c"HomePlug AV MME\00"
@.str.31 = [39 x i8] c"Media Redundancy Protocol (IEC62439-2)\00"
@.str.32 = [28 x i8] c"MAC security (IEEE 802.1AE)\00"
@.str.33 = [36 x i8] c"Precision Time Protocol (IEEE 1588)\00"
@.str.34 = [58 x i8] c"IEEE 802.1ag Connectivity Fault Management (CFM) Protocol\00"
@.str.35 = [35 x i8] c"Fibre Channel over Ethernet (FCoE)\00"
@.str.36 = [29 x i8] c"FCoE Initialization Protocol\00"
@.str.37 = [36 x i8] c"RDMA over Converged Ethernet (RoCE)\00"
@.str.38 = [44 x i8] c"High-availability Seamless Redundancy (HSR)\00"
@.str.39 = [40 x i8] c"Ethernet Configuration Testing Protocol\00"
@.str.40 = [7 x i8] c"Q-in-Q\00"
@.str.41 = [36 x i8] c"Veritas Low Latency Transport (LLT)\00"
@.str.42 = [8 x i8] c"UNKNOWN\00"
define i8* @ethertype(i16 zeroext %0) {
%2 = alloca i8*
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
switch i32 %5, label %49 [
i32 2048, label %6
i32 2054, label %7
i32 2114, label %8
i32 8947, label %9
i32 24579, label %10
i32 32821, label %11
i32 32923, label %12
i32 33011, label %13
i32 33024, label %14
i32 33079, label %15
i32 33080, label %16
i32 33284, label %17
i32 34525, label %18
i32 34824, label %19
i32 34825, label %20
i32 34841, label %21
i32 34887, label %22
i32 34888, label %23
i32 34915, label %24
i32 34916, label %25
i32 34928, label %26
i32 34939, label %27
i32 34958, label %28
i32 34962, label %29
i32 34970, label %30
i32 34978, label %31
i32 34980, label %32
i32 34984, label %33
i32 34987, label %34
i32 35020, label %35
i32 35021, label %36
i32 35041, label %37
i32 35043, label %38
i32 35045, label %39
i32 35063, label %40
i32 35074, label %41
i32 35078, label %42
i32 35092, label %43
i32 35093, label %44
i32 35119, label %45
i32 36864, label %46
i32 37120, label %47
i32 51966, label %48
]
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %50
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %50
8: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %50
9: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %50
10: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %50
11: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %50
12: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %50
13: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %50
14: ; preds = %1
store i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %50
15: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %50
16: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %50
17: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %50
18: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %50
19: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %50
20: ; preds = %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %50
21: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %50
22: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %50
23: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %50
24: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %50
25: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %50
26: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %50
27: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %50
28: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0), i8** %2
br label %50
29: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0), i8** %2
br label %50
30: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0), i8** %2
br label %50
31: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i64 0, i64 0), i8** %2
br label %50
32: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.25, i64 0, i64 0), i8** %2
br label %50
33: ; preds = %1
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.26, i64 0, i64 0), i8** %2
br label %50
34: ; preds = %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.27, i64 0, i64 0), i8** %2
br label %50
35: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i64 0, i64 0), i8** %2
br label %50
36: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i64 0, i64 0), i8** %2
br label %50
37: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.30, i64 0, i64 0), i8** %2
br label %50
38: ; preds = %1
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.31, i64 0, i64 0), i8** %2
br label %50
39: ; preds = %1
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.32, i64 0, i64 0), i8** %2
br label %50
40: ; preds = %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.33, i64 0, i64 0), i8** %2
br label %50
41: ; preds = %1
store i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.34, i64 0, i64 0), i8** %2
br label %50
42: ; preds = %1
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.35, i64 0, i64 0), i8** %2
br label %50
43: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.36, i64 0, i64 0), i8** %2
br label %50
44: ; preds = %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.37, i64 0, i64 0), i8** %2
br label %50
45: ; preds = %1
store i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.38, i64 0, i64 0), i8** %2
br label %50
46: ; preds = %1
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.39, i64 0, i64 0), i8** %2
br label %50
47: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.40, i64 0, i64 0), i8** %2
br label %50
48: ; preds = %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.41, i64 0, i64 0), i8** %2
br label %50
49: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.42, i64 0, i64 0), i8** %2
br label %50
50: ; preds = %49, %48, %47, %46, %45, %44, %43, %42, %41, %40, %39, %38, %37, %36, %35, %34, %33, %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
%51 = load i8*, i8** %2
ret i8* %51
}

LLVM IR (-O2):
@.str = [5 x i8] c"IPv4\00"
@.str.1 = [4 x i8] c"ARP\00"
@.str.2 = [12 x i8] c"Wake-on-LAN\00"
@.str.3 = [20 x i8] c"IETF TRILL Protocol\00"
@.str.4 = [16 x i8] c"DECnet Phase IV\00"
@.str.5 = [5 x i8] c"RARP\00"
@.str.6 = [22 x i8] c"AppleTalk (Ethertalk)\00"
@.str.7 = [5 x i8] c"AARP\00"
@.str.8 = [32 x i8] c"VLAN-tagged frame (IEEE 802.1Q)\00"
@.str.9 = [4 x i8] c"IPX\00"
@.str.10 = [9 x i8] c"QNX Qnet\00"
@.str.11 = [5 x i8] c"IPv6\00"
@.str.12 = [22 x i8] c"Ethernet flow control\00"
@.str.13 = [28 x i8] c"Slow Protocols (IEEE 802.3)\00"
@.str.14 = [9 x i8] c"CobraNet\00"
@.str.15 = [13 x i8] c"MPLS unicast\00"
@.str.16 = [15 x i8] c"MPLS multicast\00"
@.str.17 = [22 x i8] c"PPPoE Discovery Stage\00"
@.str.18 = [20 x i8] c"PPPoE Session Stage\00"
@.str.19 = [13 x i8] c"Jumbo Frames\00"
@.str.20 = [17 x i8] c"HomePlug 1.0 MME\00"
@.str.21 = [27 x i8] c"EAP over LAN (IEEE 802.1X)\00"
@.str.22 = [18 x i8] c"PROFINET Protocol\00"
@.str.23 = [10 x i8] c"HyperSCSI\00"
@.str.24 = [18 x i8] c"ATA over Ethernet\00"
@.str.25 = [18 x i8] c"EtherCAT Protocol\00"
@.str.26 = [33 x i8] c"Provider Bridging (IEEE 802.1ad)\00"
@.str.27 = [19 x i8] c"Ethernet Powerlink\00"
@.str.28 = [5 x i8] c"LLDP\00"
@.str.29 = [11 x i8] c"SERCOS III\00"
@.str.30 = [16 x i8] c"HomePlug AV MME\00"
@.str.31 = [39 x i8] c"Media Redundancy Protocol (IEC62439-2)\00"
@.str.32 = [28 x i8] c"MAC security (IEEE 802.1AE)\00"
@.str.33 = [36 x i8] c"Precision Time Protocol (IEEE 1588)\00"
@.str.34 = [58 x i8] c"IEEE 802.1ag Connectivity Fault Management (CFM) Protocol\00"
@.str.35 = [35 x i8] c"Fibre Channel over Ethernet (FCoE)\00"
@.str.36 = [29 x i8] c"FCoE Initialization Protocol\00"
@.str.37 = [36 x i8] c"RDMA over Converged Ethernet (RoCE)\00"
@.str.38 = [44 x i8] c"High-availability Seamless Redundancy (HSR)\00"
@.str.39 = [40 x i8] c"Ethernet Configuration Testing Protocol\00"
@.str.40 = [7 x i8] c"Q-in-Q\00"
@.str.41 = [36 x i8] c"Veritas Low Latency Transport (LLT)\00"
@.str.42 = [8 x i8] c"UNKNOWN\00"
define i8* @ethertype(i16 zeroext %0) {
switch i16 %0, label %44 [
i16 2048, label %45
i16 2054, label %2
i16 2114, label %3
i16 8947, label %4
i16 24579, label %5
i16 -32715, label %6
i16 -32613, label %7
i16 -32525, label %8
i16 -32512, label %9
i16 -32457, label %10
i16 -32456, label %11
i16 -32252, label %12
i16 -31011, label %13
i16 -30712, label %14
i16 -30711, label %15
i16 -30695, label %16
i16 -30649, label %17
i16 -30648, label %18
i16 -30621, label %19
i16 -30620, label %20
i16 -30608, label %21
i16 -30597, label %22
i16 -30578, label %23
i16 -30574, label %24
i16 -30566, label %25
i16 -30558, label %26
i16 -30556, label %27
i16 -30552, label %28
i16 -30549, label %29
i16 -30516, label %30
i16 -30515, label %31
i16 -30495, label %32
i16 -30493, label %33
i16 -30491, label %34
i16 -30473, label %35
i16 -30462, label %36
i16 -30458, label %37
i16 -30444, label %38
i16 -30443, label %39
i16 -30417, label %40
i16 -28672, label %41
i16 -28416, label %42
i16 -13570, label %43
]
2: ; preds = %1
br label %45
3: ; preds = %1
br label %45
4: ; preds = %1
br label %45
5: ; preds = %1
br label %45
6: ; preds = %1
br label %45
7: ; preds = %1
br label %45
8: ; preds = %1
br label %45
9: ; preds = %1
br label %45
10: ; preds = %1
br label %45
11: ; preds = %1
br label %45
12: ; preds = %1
br label %45
13: ; preds = %1
br label %45
14: ; preds = %1
br label %45
15: ; preds = %1
br label %45
16: ; preds = %1
br label %45
17: ; preds = %1
br label %45
18: ; preds = %1
br label %45
19: ; preds = %1
br label %45
20: ; preds = %1
br label %45
21: ; preds = %1
br label %45
22: ; preds = %1
br label %45
23: ; preds = %1
br label %45
24: ; preds = %1
br label %45
25: ; preds = %1
br label %45
26: ; preds = %1
br label %45
27: ; preds = %1
br label %45
28: ; preds = %1
br label %45
29: ; preds = %1
br label %45
30: ; preds = %1
br label %45
31: ; preds = %1
br label %45
32: ; preds = %1
br label %45
33: ; preds = %1
br label %45
34: ; preds = %1
br label %45
35: ; preds = %1
br label %45
36: ; preds = %1
br label %45
37: ; preds = %1
br label %45
38: ; preds = %1
br label %45
39: ; preds = %1
br label %45
40: ; preds = %1
br label %45
41: ; preds = %1
br label %45
42: ; preds = %1
br label %45
43: ; preds = %1
br label %45
44: ; preds = %1
br label %45
45: ; preds = %1, %44, %43, %42, %41, %40, %39, %38, %37, %36, %35, %34, %33, %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, %5, %4, %3, %2
%46 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.42, i64 0, i64 0), %44 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.41, i64 0, i64 0), %43 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.40, i64 0, i64 0), %42 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @.str.39, i64 0, i64 0), %41 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str.38, i64 0, i64 0), %40 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.37, i64 0, i64 0), %39 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.36, i64 0, i64 0), %38 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @.str.35, i64 0, i64 0), %37 ], [ getelementptr inbounds ([58 x i8], [58 x i8]* @.str.34, i64 0, i64 0), %36 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @.str.33, i64 0, i64 0), %35 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.32, i64 0, i64 0), %34 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.31, i64 0, i64 0), %33 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.30, i64 0, i64 0), %32 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i64 0, i64 0), %31 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.28, i64 0, i64 0), %30 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str.27, i64 0, i64 0), %29 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.26, i64 0, i64 0), %28 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.25, i64 0, i64 0), %27 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i64 0, i64 0), %26 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0), %25 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0), %24 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.21, i64 0, i64 0), %23 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.20, i64 0, i64 0), %22 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), %21 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), %20 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0), %19 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), %18 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.15, i64 0, i64 0), %17 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), %16 ], [ getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0), %15 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.12, i64 0, i64 0), %14 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), %13 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), %12 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %46
}