char *device_name(unsigned int family) {
  switch (family) {
  case 0x01:
    return "DS2401/DS1990A Serial Number iButton";
  case 0x05:
    return "DS2405 Addressable Switch";
  case 0x09:
    return "DS2502 1Kbit Add only memory";
  case 0x10:
    return "DS1820 Temperature Sensor";
  case 0x12:
    return "DS2406/2407 Dual Addressable Switch + 1Kbit memory";
  case 0x14:
    return "DS1971 256bit EEPROM iButton";
  case 0x18:
    return "DS1963S SHA iButton";
  case 0x1A:
    return "DS1963L 4kBit MONETARYiButton";
  case 0x1C:
    return "DS2422 1Kbit RAM + Counter";
  case 0x1D:
    return "DS2423 4Kbit RAM + Counter";
  case 0x1F:
    return "DS2409 MicroLAN Coupler";
  case 0x20:
    return "DS2450 Quad A/D Converter";
  case 0x21:
    return "DS1921 Thermochron iButton";
  case 0x22:
    return "DS1822 Temperature Sensor";
  case 0x28:
    return "DS18B20 Temperature Sensor";
  case 0x82:
    return "DS1425 Multi iButton";
  case 0x84:
    return "DS1427 TIME iButton";
  case 0x89:
    return "DS2502/1982 1024bit UniqueWare Add Only Memory";
  case 0x8B:
    return "DS2505/1985 16Kbit UniqueWare Add Only Memory";
  case 0x8F:
    return "DS2506/1986 64Kbit UniqueWare Add Only Memory";
  default:
    return "Unknown Family Code";
  }
}


x86 assembly (clang, -O0):
<device_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x8e,%eax
ja     1272 <device_name+0x172>
mov    -0x18(%rbp),%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1103(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x1118(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x1122(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x112f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x1139(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x115c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x1169(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x116d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x117b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x1186(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x1191(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x1199(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x11a3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x11ae(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x11b8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x11c3(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x11c8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x11cc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x11eb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x1209(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    127d <device_name+0x17d>
lea    0x1227(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_name>:
add    $0xffffffff,%edi
cmp    $0x8e,%edi
ja     112a <device_name+0x2a>
lea    0x112a(%rip),%rax
lea    0xee7(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
lea    0x1138(%rip),%rax
ret
lea    0x136f(%rip),%rax
ret
lea    0x1142(%rip),%rax
ret
lea    0x1157(%rip),%rax
ret
lea    0x1169(%rip),%rax
ret
lea    0x1194(%rip),%rax
ret
lea    0x11a9(%rip),%rax
ret
lea    0x11b5(%rip),%rax
ret
lea    0x11cb(%rip),%rax
ret
lea    0x11de(%rip),%rax
ret
lea    0x11f1(%rip),%rax
ret
lea    0x1201(%rip),%rax
ret
lea    0x1213(%rip),%rax
ret
lea    0x1226(%rip),%rax
ret
lea    0x1238(%rip),%rax
ret
lea    0x124b(%rip),%rax
ret
lea    0x1258(%rip),%rax
ret
lea    0x1264(%rip),%rax
ret
lea    0x128b(%rip),%rax
ret
lea    0x12b1(%rip),%rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"DS2401/DS1990A Serial Number iButton\00"
@.str.1 = [26 x i8] c"DS2405 Addressable Switch\00"
@.str.2 = [29 x i8] c"DS2502 1Kbit Add only memory\00"
@.str.3 = [26 x i8] c"DS1820 Temperature Sensor\00"
@.str.4 = [51 x i8] c"DS2406/2407 Dual Addressable Switch + 1Kbit memory\00"
@.str.5 = [29 x i8] c"DS1971 256bit EEPROM iButton\00"
@.str.6 = [20 x i8] c"DS1963S SHA iButton\00"
@.str.7 = [30 x i8] c"DS1963L 4kBit MONETARYiButton\00"
@.str.8 = [27 x i8] c"DS2422 1Kbit RAM + Counter\00"
@.str.9 = [27 x i8] c"DS2423 4Kbit RAM + Counter\00"
@.str.10 = [24 x i8] c"DS2409 MicroLAN Coupler\00"
@.str.11 = [26 x i8] c"DS2450 Quad A/D Converter\00"
@.str.12 = [27 x i8] c"DS1921 Thermochron iButton\00"
@.str.13 = [26 x i8] c"DS1822 Temperature Sensor\00"
@.str.14 = [27 x i8] c"DS18B20 Temperature Sensor\00"
@.str.15 = [21 x i8] c"DS1425 Multi iButton\00"
@.str.16 = [20 x i8] c"DS1427 TIME iButton\00"
@.str.17 = [47 x i8] c"DS2502/1982 1024bit UniqueWare Add Only Memory\00"
@.str.18 = [46 x i8] c"DS2505/1985 16Kbit UniqueWare Add Only Memory\00"
@.str.19 = [46 x i8] c"DS2506/1986 64Kbit UniqueWare Add Only Memory\00"
@.str.20 = [20 x i8] c"Unknown Family Code\00"
define i8* @device_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %25 [
i32 1, label %5
i32 5, label %6
i32 9, label %7
i32 16, label %8
i32 18, label %9
i32 20, label %10
i32 24, label %11
i32 26, label %12
i32 28, label %13
i32 29, label %14
i32 31, label %15
i32 32, label %16
i32 33, label %17
i32 34, label %18
i32 40, label %19
i32 130, label %20
i32 132, label %21
i32 137, label %22
i32 139, label %23
i32 143, label %24
]
5: ; preds = %1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %2
br label %26
6: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %26
7: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %26
8: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %26
9: ; preds = %1
store i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %26
10: ; preds = %1
store i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %26
11: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %26
12: ; preds = %1
store i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %26
13: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %26
14: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %26
15: ; preds = %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %26
16: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %26
17: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %26
18: ; preds = %1
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %26
19: ; preds = %1
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %26
20: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %26
21: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %26
22: ; preds = %1
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %26
23: ; preds = %1
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.18, i64 0, i64 0), i8** %2
br label %26
24: ; preds = %1
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %26
25: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %26
26: ; preds = %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%27 = load i8*, i8** %2
ret i8* %27
}

LLVM IR (-O2):
@.str = [37 x i8] c"DS2401/DS1990A Serial Number iButton\00"
@.str.1 = [26 x i8] c"DS2405 Addressable Switch\00"
@.str.2 = [29 x i8] c"DS2502 1Kbit Add only memory\00"
@.str.3 = [26 x i8] c"DS1820 Temperature Sensor\00"
@.str.4 = [51 x i8] c"DS2406/2407 Dual Addressable Switch + 1Kbit memory\00"
@.str.5 = [29 x i8] c"DS1971 256bit EEPROM iButton\00"
@.str.6 = [20 x i8] c"DS1963S SHA iButton\00"
@.str.7 = [30 x i8] c"DS1963L 4kBit MONETARYiButton\00"
@.str.8 = [27 x i8] c"DS2422 1Kbit RAM + Counter\00"
@.str.9 = [27 x i8] c"DS2423 4Kbit RAM + Counter\00"
@.str.10 = [24 x i8] c"DS2409 MicroLAN Coupler\00"
@.str.11 = [26 x i8] c"DS2450 Quad A/D Converter\00"
@.str.12 = [27 x i8] c"DS1921 Thermochron iButton\00"
@.str.13 = [26 x i8] c"DS1822 Temperature Sensor\00"
@.str.14 = [27 x i8] c"DS18B20 Temperature Sensor\00"
@.str.15 = [21 x i8] c"DS1425 Multi iButton\00"
@.str.16 = [20 x i8] c"DS1427 TIME iButton\00"
@.str.17 = [47 x i8] c"DS2502/1982 1024bit UniqueWare Add Only Memory\00"
@.str.18 = [46 x i8] c"DS2505/1985 16Kbit UniqueWare Add Only Memory\00"
@.str.19 = [46 x i8] c"DS2506/1986 64Kbit UniqueWare Add Only Memory\00"
@.str.20 = [20 x i8] c"Unknown Family Code\00"
define i8* @device_name(i32 %0) {
switch i32 %0, label %21 [
i32 1, label %22
i32 5, label %2
i32 9, label %3
i32 16, label %4
i32 18, label %5
i32 20, label %6
i32 24, label %7
i32 26, label %8
i32 28, label %9
i32 29, label %10
i32 31, label %11
i32 32, label %12
i32 33, label %13
i32 34, label %14
i32 40, label %15
i32 130, label %16
i32 132, label %17
i32 137, label %18
i32 139, label %19
i32 143, label %20
]
2: ; preds = %1
br label %22
3: ; preds = %1
br label %22
4: ; preds = %1
br label %22
5: ; preds = %1
br label %22
6: ; preds = %1
br label %22
7: ; preds = %1
br label %22
8: ; preds = %1
br label %22
9: ; preds = %1
br label %22
10: ; preds = %1
br label %22
11: ; preds = %1
br label %22
12: ; preds = %1
br label %22
13: ; preds = %1
br label %22
14: ; preds = %1
br label %22
15: ; preds = %1
br label %22
16: ; preds = %1
br label %22
17: ; preds = %1
br label %22
18: ; preds = %1
br label %22
19: ; preds = %1
br label %22
20: ; preds = %1
br label %22
21: ; preds = %1
br label %22
22: ; preds = %1, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5, %4, %3, %2
%23 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.20, i64 0, i64 0), %21 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @.str.19, i64 0, i64 0), %20 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @.str.18, i64 0, i64 0), %19 ], [ getelementptr inbounds ([47 x i8], [47 x i8]* @.str.17, i64 0, i64 0), %18 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0), %17 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), %16 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), %14 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), %13 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), %12 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), %11 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), %10 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), %9 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), %6 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0), %5 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), %4 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %23
}