#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 */

/* Variables and functions */
#define ARPHRD_ARCNET 159
#define ARPHRD_ATM 158
#define ARPHRD_AX25 157
#define ARPHRD_CAN 156
#define ARPHRD_CHAOS 155
#define ARPHRD_CISCO 154
#define ARPHRD_CSLIP 153
#define ARPHRD_CSLIP6 152
#define ARPHRD_DLCI 151
#define ARPHRD_ECONET 150
#define ARPHRD_EETHER 149
#define ARPHRD_ETHER 148
#define ARPHRD_FDDI 147
#define ARPHRD_IEEE802 146
#define ARPHRD_IEEE80211 145
#define ARPHRD_IEEE80211_PRISM 144
#define ARPHRD_IEEE80211_RADIOTAP 143
#define ARPHRD_IEEE802154 142
#define ARPHRD_IEEE802_TR 141
#define ARPHRD_INFINIBAND 140
#define ARPHRD_IPDDP 139
#define ARPHRD_IPGRE 138
#define ARPHRD_IRDA 137
#define ARPHRD_LOOPBACK 136
#define ARPHRD_PPP 135
#define ARPHRD_PRONET 134
#define ARPHRD_RAWHDLC 133
#define ARPHRD_SIT 132
#define ARPHRD_SLIP 131
#define ARPHRD_SLIP6 130
#define ARPHRD_TUNNEL 129
#define ARPHRD_TUNNEL6 128
int pcap_devtype_to_linktype(int dev_type) {
  switch (dev_type) {
  case ARPHRD_TUNNEL:
  case ARPHRD_TUNNEL6:
  case ARPHRD_LOOPBACK:
  case ARPHRD_SIT:
  case ARPHRD_IPDDP:
  case ARPHRD_IPGRE:
  case 823:
  case ARPHRD_ETHER:
    return 1;
  case ARPHRD_IEEE80211_RADIOTAP:
    return 127;
  case ARPHRD_IEEE80211_PRISM:
  case ARPHRD_IEEE80211:
    return 105;
  case 824:
    return 253;
  case ARPHRD_EETHER:
    return 2;
  case ARPHRD_AX25:
    return 3;
  case ARPHRD_CHAOS:
    return 5;
  case ARPHRD_PRONET:
    return 4;
  case ARPHRD_IEEE802_TR:
  case ARPHRD_IEEE802:
    return 6;
  case ARPHRD_INFINIBAND:
    return 247;
  case ARPHRD_ATM:
    return 19;
  case ARPHRD_DLCI:
    return 107;
  case ARPHRD_ARCNET:
    return 129;
  case ARPHRD_CSLIP:
  case ARPHRD_CSLIP6:
  case ARPHRD_SLIP6:
  case ARPHRD_SLIP:
    return 8;
  case ARPHRD_PPP:
    return 9;
  case ARPHRD_CAN:
    return 190;
  case ARPHRD_ECONET:
    return 115;
  case ARPHRD_RAWHDLC:
  case ARPHRD_CISCO:
    return 104;
  case ARPHRD_FDDI:
    return 10;
  case 805:
  case ARPHRD_IEEE802154:
    return 191;
  case ARPHRD_IRDA:
    return 144;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pcap_devtype_to_linktype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffff80,%eax
sub    $0x2,%eax
jb     1351 <pcap_devtype_to_linktype+0x251>
jmp    111e <pcap_devtype_to_linktype+0x1e>
mov    -0xc(%rbp),%eax
add    $0xffffff7e,%eax
sub    $0x2,%eax
jb     13ed <pcap_devtype_to_linktype+0x2ed>
jmp    1134 <pcap_devtype_to_linktype+0x34>
mov    -0xc(%rbp),%eax
sub    $0x84,%eax
je     1351 <pcap_devtype_to_linktype+0x251>
jmp    1147 <pcap_devtype_to_linktype+0x47>
mov    -0xc(%rbp),%eax
sub    $0x85,%eax
je     141d <pcap_devtype_to_linktype+0x31d>
jmp    115a <pcap_devtype_to_linktype+0x5a>
mov    -0xc(%rbp),%eax
sub    $0x86,%eax
je     13a5 <pcap_devtype_to_linktype+0x2a5>
jmp    116d <pcap_devtype_to_linktype+0x6d>
mov    -0xc(%rbp),%eax
sub    $0x87,%eax
je     13f9 <pcap_devtype_to_linktype+0x2f9>
jmp    1180 <pcap_devtype_to_linktype+0x80>
mov    -0xc(%rbp),%eax
sub    $0x88,%eax
je     1351 <pcap_devtype_to_linktype+0x251>
jmp    1193 <pcap_devtype_to_linktype+0x93>
mov    -0xc(%rbp),%eax
sub    $0x89,%eax
je     1441 <pcap_devtype_to_linktype+0x341>
jmp    11a6 <pcap_devtype_to_linktype+0xa6>
mov    -0xc(%rbp),%eax
add    $0xffffff76,%eax
sub    $0x2,%eax
jb     1351 <pcap_devtype_to_linktype+0x251>
jmp    11bc <pcap_devtype_to_linktype+0xbc>
mov    -0xc(%rbp),%eax
sub    $0x8c,%eax
je     13bd <pcap_devtype_to_linktype+0x2bd>
jmp    11cf <pcap_devtype_to_linktype+0xcf>
mov    -0xc(%rbp),%eax
sub    $0x8d,%eax
je     13b1 <pcap_devtype_to_linktype+0x2b1>
jmp    11e2 <pcap_devtype_to_linktype+0xe2>
mov    -0xc(%rbp),%eax
sub    $0x8e,%eax
je     1435 <pcap_devtype_to_linktype+0x335>
jmp    11f5 <pcap_devtype_to_linktype+0xf5>
mov    -0xc(%rbp),%eax
sub    $0x8f,%eax
je     135d <pcap_devtype_to_linktype+0x25d>
jmp    1208 <pcap_devtype_to_linktype+0x108>
mov    -0xc(%rbp),%eax
add    $0xffffff70,%eax
sub    $0x2,%eax
jb     1369 <pcap_devtype_to_linktype+0x269>
jmp    121e <pcap_devtype_to_linktype+0x11e>
mov    -0xc(%rbp),%eax
sub    $0x92,%eax
je     13b1 <pcap_devtype_to_linktype+0x2b1>
jmp    1231 <pcap_devtype_to_linktype+0x131>
mov    -0xc(%rbp),%eax
sub    $0x93,%eax
je     1429 <pcap_devtype_to_linktype+0x329>
jmp    1244 <pcap_devtype_to_linktype+0x144>
mov    -0xc(%rbp),%eax
sub    $0x94,%eax
je     1351 <pcap_devtype_to_linktype+0x251>
jmp    1257 <pcap_devtype_to_linktype+0x157>
mov    -0xc(%rbp),%eax
sub    $0x95,%eax
je     1381 <pcap_devtype_to_linktype+0x281>
jmp    126a <pcap_devtype_to_linktype+0x16a>
mov    -0xc(%rbp),%eax
sub    $0x96,%eax
je     1411 <pcap_devtype_to_linktype+0x311>
jmp    127d <pcap_devtype_to_linktype+0x17d>
mov    -0xc(%rbp),%eax
sub    $0x97,%eax
je     13d5 <pcap_devtype_to_linktype+0x2d5>
jmp    1290 <pcap_devtype_to_linktype+0x190>
mov    -0xc(%rbp),%eax
add    $0xffffff68,%eax
sub    $0x2,%eax
jb     13ed <pcap_devtype_to_linktype+0x2ed>
jmp    12a6 <pcap_devtype_to_linktype+0x1a6>
mov    -0xc(%rbp),%eax
sub    $0x9a,%eax
je     141d <pcap_devtype_to_linktype+0x31d>
jmp    12b9 <pcap_devtype_to_linktype+0x1b9>
mov    -0xc(%rbp),%eax
sub    $0x9b,%eax
je     1399 <pcap_devtype_to_linktype+0x299>
jmp    12cc <pcap_devtype_to_linktype+0x1cc>
mov    -0xc(%rbp),%eax
sub    $0x9c,%eax
je     1405 <pcap_devtype_to_linktype+0x305>
jmp    12df <pcap_devtype_to_linktype+0x1df>
mov    -0xc(%rbp),%eax
sub    $0x9d,%eax
je     138d <pcap_devtype_to_linktype+0x28d>
jmp    12f2 <pcap_devtype_to_linktype+0x1f2>
mov    -0xc(%rbp),%eax
sub    $0x9e,%eax
je     13c9 <pcap_devtype_to_linktype+0x2c9>
jmp    1305 <pcap_devtype_to_linktype+0x205>
mov    -0xc(%rbp),%eax
sub    $0x9f,%eax
je     13e1 <pcap_devtype_to_linktype+0x2e1>
jmp    1318 <pcap_devtype_to_linktype+0x218>
mov    -0xc(%rbp),%eax
sub    $0x325,%eax
je     1435 <pcap_devtype_to_linktype+0x335>
jmp    132b <pcap_devtype_to_linktype+0x22b>
mov    -0xc(%rbp),%eax
sub    $0x337,%eax
je     1351 <pcap_devtype_to_linktype+0x251>
jmp    133e <pcap_devtype_to_linktype+0x23e>
mov    -0xc(%rbp),%eax
sub    $0x338,%eax
je     1375 <pcap_devtype_to_linktype+0x275>
jmp    144d <pcap_devtype_to_linktype+0x34d>
movl   $0x1,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x7f,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x69,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0xfd,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x2,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x3,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x5,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x4,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x6,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0xf7,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x13,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x6b,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x81,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x8,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x9,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0xbe,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x73,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x68,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0xa,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0xbf,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x90,-0x4(%rbp)
jmp    1454 <pcap_devtype_to_linktype+0x354>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcap_devtype_to_linktype>:
mov    $0x1,%eax
cmp    $0x324,%edi
jg     1130 <pcap_devtype_to_linktype+0x30>
add    $0xffffff80,%edi
cmp    $0x1f,%edi
ja     11ba <pcap_devtype_to_linktype+0xba>
lea    0xee0(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
mov    $0x8,%eax
ret
cmp    $0x325,%edi
je     1160 <pcap_devtype_to_linktype+0x60>
cmp    $0x337,%edi
je     1129 <pcap_devtype_to_linktype+0x29>
cmp    $0x338,%edi
jne    11ba <pcap_devtype_to_linktype+0xba>
mov    $0xfd,%eax
ret
mov    $0x68,%eax
ret
mov    $0x6,%eax
ret
mov    $0x69,%eax
ret
mov    $0xbf,%eax
ret
mov    $0x4,%eax
ret
mov    $0x9,%eax
ret
mov    $0x90,%eax
ret
mov    $0xf7,%eax
ret
mov    $0x7f,%eax
ret
mov    $0xa,%eax
ret
mov    $0x2,%eax
ret
mov    $0x73,%eax
ret
mov    $0x6b,%eax
ret
mov    $0x5,%eax
ret
mov    $0xbe,%eax
ret
mov    $0x3,%eax
ret
mov    $0x13,%eax
ret
mov    $0x81,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @pcap_devtype_to_linktype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %26 [
i32 129, label %5
i32 128, label %5
i32 136, label %5
i32 132, label %5
i32 139, label %5
i32 138, label %5
i32 823, label %5
i32 148, label %5
i32 143, label %6
i32 144, label %7
i32 145, label %7
i32 824, label %8
i32 149, label %9
i32 157, label %10
i32 155, label %11
i32 134, label %12
i32 141, label %13
i32 146, label %13
i32 140, label %14
i32 158, label %15
i32 151, label %16
i32 159, label %17
i32 153, label %18
i32 152, label %18
i32 130, label %18
i32 131, label %18
i32 135, label %19
i32 156, label %20
i32 150, label %21
i32 133, label %22
i32 154, label %22
i32 147, label %23
i32 805, label %24
i32 142, label %24
i32 137, label %25
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %27
6: ; preds = %1
store i32 127, i32* %2
br label %27
7: ; preds = %1, %1
store i32 105, i32* %2
br label %27
8: ; preds = %1
store i32 253, i32* %2
br label %27
9: ; preds = %1
store i32 2, i32* %2
br label %27
10: ; preds = %1
store i32 3, i32* %2
br label %27
11: ; preds = %1
store i32 5, i32* %2
br label %27
12: ; preds = %1
store i32 4, i32* %2
br label %27
13: ; preds = %1, %1
store i32 6, i32* %2
br label %27
14: ; preds = %1
store i32 247, i32* %2
br label %27
15: ; preds = %1
store i32 19, i32* %2
br label %27
16: ; preds = %1
store i32 107, i32* %2
br label %27
17: ; preds = %1
store i32 129, i32* %2
br label %27
18: ; preds = %1, %1, %1, %1
store i32 8, i32* %2
br label %27
19: ; preds = %1
store i32 9, i32* %2
br label %27
20: ; preds = %1
store i32 190, i32* %2
br label %27
21: ; preds = %1
store i32 115, i32* %2
br label %27
22: ; preds = %1, %1
store i32 104, i32* %2
br label %27
23: ; preds = %1
store i32 10, i32* %2
br label %27
24: ; preds = %1, %1
store i32 191, i32* %2
br label %27
25: ; preds = %1
store i32 144, i32* %2
br label %27
26: ; preds = %1
store i32 0, i32* %2
br label %27
27: ; preds = %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @pcap_devtype_to_linktype(i32 %0) {
switch i32 %0, label %22 [
i32 129, label %23
i32 128, label %23
i32 136, label %23
i32 132, label %23
i32 139, label %23
i32 138, label %23
i32 823, label %23
i32 148, label %23
i32 143, label %2
i32 144, label %3
i32 145, label %3
i32 824, label %4
i32 149, label %5
i32 157, label %6
i32 155, label %7
i32 134, label %8
i32 141, label %9
i32 146, label %9
i32 140, label %10
i32 158, label %11
i32 151, label %12
i32 159, label %13
i32 153, label %14
i32 152, label %14
i32 130, label %14
i32 131, label %14
i32 135, label %15
i32 156, label %16
i32 150, label %17
i32 133, label %18
i32 154, label %18
i32 147, label %19
i32 805, label %20
i32 142, label %20
i32 137, label %21
]
2: ; preds = %1
br label %23
3: ; preds = %1, %1
br label %23
4: ; preds = %1
br label %23
5: ; preds = %1
br label %23
6: ; preds = %1
br label %23
7: ; preds = %1
br label %23
8: ; preds = %1
br label %23
9: ; preds = %1, %1
br label %23
10: ; preds = %1
br label %23
11: ; preds = %1
br label %23
12: ; preds = %1
br label %23
13: ; preds = %1
br label %23
14: ; preds = %1, %1, %1, %1
br label %23
15: ; preds = %1
br label %23
16: ; preds = %1
br label %23
17: ; preds = %1
br label %23
18: ; preds = %1, %1
br label %23
19: ; preds = %1
br label %23
20: ; preds = %1, %1
br label %23
21: ; preds = %1
br label %23
22: ; preds = %1
br label %23
23: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%24 = phi i32 [ 0, %22 ], [ 144, %21 ], [ 191, %20 ], [ 10, %19 ], [ 104, %18 ], [ 115, %17 ], [ 190, %16 ], [ 9, %15 ], [ 8, %14 ], [ 129, %13 ], [ 107, %12 ], [ 19, %11 ], [ 247, %10 ], [ 6, %9 ], [ 4, %8 ], [ 5, %7 ], [ 3, %6 ], [ 2, %5 ], [ 253, %4 ], [ 105, %3 ], [ 127, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %24
}