#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 */
typedef int uint32_t;

/* Variables and functions */
const char *msdos_get_media_type(uint32_t index) {
  switch (index) {
  case 0xE5:
    return "\n"
           "    8-inch (200 mm) Single sided, 77 tracks per side, 26 sectors\n"
           "    per track, 128 bytes per sector (243 KB) (DR-DOS only)";
  case 0xED:
    return "\n"
           "    5.25-inch (130 mm) Double sided, 80 tracks per side, 9 "
           "sector,\n"
           "    720 KB (Tandy 2000 only)";
  case 0xF0:
    return "\n"
           "    3.5-inch (90 mm) Double Sided, 80 tracks per side, 18 or 36\n"
           "    sectors per track (1.44 MB or 2.88 MB).\n"
           "    Designated for use with custom floppy and superfloppy formats\n"
           "    where the geometry is defined in the BPB.\n"
           "    Used also for other media types such as tapes.";
  case 0xF8:
    return "\n"
           "    Fixed disk (i.e., typically a partition on a hard disk).\n"
           "    (since DOS 2.0)\n"
           "    Designated to be used for any partitioned fixed or removable\n"
           "    media, where the geometry is defined in the BPB.\n"
           "    3.5-inch Single sided, 80 tracks per side, 9 sectors per "
           "track\n"
           "    (360 KB) (MSX-DOS only)\n"
           "    5.25-inch Double sided, 80 tracks per side, 9 sectors per "
           "track\n"
           "    (720 KB) (Sanyo 55x DS-DOS 2.11 only)";
  case 0xF9:
    return "\n"
           "    3.5-inch Double sided, 80 tracks per side, 9 sectors per "
           "track\n"
           "    (720 KB) (since DOS 3.2)\n"
           "    3.5-inch Double sided, 80 tracks per side, 18 sectors per "
           "track\n"
           "    (1440 KB) (DOS 3.2 only)\n"
           "    5.25-inch Double sided, 80 tracks per side, 15 sectors per "
           "track\n"
           "    (1.2 MB) (since DOS 3.0)";
  case 0xFA:
    return "\n"
           "    3.5-inch and 5.25-inch Single sided, 80 tracks per side, 8\n"
           "    sectors per track (320 KB)\n"
           "    Used also for RAM disks and ROM disks (f.e. on HP 200LX)\n"
           "    Hard disk (Tandy MS-DOS only)";
  case 0xFB:
    return "\n"
           "    3.5-inch and 5.25-inch Double sided, 80 tracks per side,\n"
           "    8 sectors per track (640 KB)";
  case 0xFC:
    return "\n"
           "    5.25-inch Single sided, 40 tracks per side, 9 sectors per "
           "track\n"
           "    (180 KB) (since DOS 2.0)";
  case 0xFD:
    return "\n"
           "    5.25-inch Double sided, 40 tracks per side, 9 sectors per "
           "track\n"
           "    (360 KB) (since DOS 2.0)\n"
           "    8-inch Double sided, 77 tracks per side, 26 sectors per "
           "track,\n"
           "    128 bytes per sector (500.5 KB)\n"
           "    (8-inch Double sided, (single and) double density (DOS 1))";
  case 0xFE:
    return "\n"
           "    5.25-inch Single sided, 40 tracks per side, 8 sectors per "
           "track\n"
           "    (160 KB) (since DOS 1.0)\n"
           "    8-inch Single sided, 77 tracks per side, 26 sectors per "
           "track,\n"
           "    128 bytes per sector (250.25 KB)\n"
           "    8-inch Double sided, 77 tracks per side, 8 sectors per track,\n"
           "    ONE_K bytes per sector (1232 KB)\n"
           "    (8-inch Single sided, (single and) double density (DOS 1))";
  case 0xFF:
    return "\n"
           "    5.25-inch Double sided, 40 tracks per side, 8 sectors per "
           "track\n"
           "    (320 KB) (since DOS 1.1)\n"
           "    Hard disk (Sanyo 55x DS-DOS 2.11 only)";
  }
  return ("");
}


x86 assembly (clang, -O0):
<msdos_get_media_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff1b,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x1a,%eax
ja     11e2 <msdos_get_media_type+0xe2>
mov    -0x18(%rbp),%rax
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf33(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0xfa0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0xff1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0x10f1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0x1276(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0x138a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0x1438(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0x1487(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0x14d9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0x15d1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0x1731(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11ed <msdos_get_media_type+0xed>
lea    0x15b0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msdos_get_media_type>:
add    $0xffffff1b,%edi
cmp    $0x1a,%edi
ja     111d <msdos_get_media_type+0x1d>
movslq %edi,%rax
lea    0x1817(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0x1609(%rip),%rax
ret

LLVM IR (-O0):
@.str = [125 x i8] c"\0A 8-inch (200 mm) Single sided, 77 tracks per side, 26 sectors\0A per track, 128 bytes per sector (243 KB) (DR-DOS only)\00"
@.str.1 = [97 x i8] c"\0A 5.25-inch (130 mm) Double sided, 80 tracks per side, 9 sector,\0A 720 KB (Tandy 2000 only)\00"
@.str.2 = [272 x i8] c"\0A 3.5-inch (90 mm) Double Sided, 80 tracks per side, 18 or 36\0A sectors per track (1.44 MB or 2.88 MB).\0A Designated for use with custom floppy and superfloppy formats\0A where the geometry is defined in the BPB.\0A Used also for other media types such as tapes.\00"
@.str.3 = [405 x i8] c"\0A Fixed disk (i.e., typically a partition on a hard disk).\0A (since DOS 2.0)\0A Designated to be used for any partitioned fixed or removable\0A media, where the geometry is defined in the BPB.\0A 3.5-inch Single sided, 80 tracks per side, 9 sectors per track\0A (360 KB) (MSX-DOS only)\0A 5.25-inch Double sided, 80 tracks per side, 9 sectors per track\0A (720 KB) (Sanyo 55x DS-DOS 2.11 only)\00"
@.str.4 = [292 x i8] c"\0A 3.5-inch Double sided, 80 tracks per side, 9 sectors per track\0A (720 KB) (since DOS 3.2)\0A 3.5-inch Double sided, 80 tracks per side, 18 sectors per track\0A (1440 KB) (DOS 3.2 only)\0A 5.25-inch Double sided, 80 tracks per side, 15 sectors per track\0A (1.2 MB) (since DOS 3.0)\00"
@.str.5 = [190 x i8] c"\0A 3.5-inch and 5.25-inch Single sided, 80 tracks per side, 8\0A sectors per track (320 KB)\0A Used also for RAM disks and ROM disks (f.e. on HP 200LX)\0A Hard disk (Tandy MS-DOS only)\00"
@.str.6 = [95 x i8] c"\0A 3.5-inch and 5.25-inch Double sided, 80 tracks per side,\0A 8 sectors per track (640 KB)\00"
@.str.7 = [98 x i8] c"\0A 5.25-inch Single sided, 40 tracks per side, 9 sectors per track\0A (180 KB) (since DOS 2.0)\00"
@.str.8 = [264 x i8] c"\0A 5.25-inch Double sided, 40 tracks per side, 9 sectors per track\0A (360 KB) (since DOS 2.0)\0A 8-inch Double sided, 77 tracks per side, 26 sectors per track,\0A 128 bytes per sector (500.5 KB)\0A (8-inch Double sided, (single and) double density (DOS 1))\00"
@.str.9 = [368 x i8] c"\0A 5.25-inch Single sided, 40 tracks per side, 8 sectors per track\0A (160 KB) (since DOS 1.0)\0A 8-inch Single sided, 77 tracks per side, 26 sectors per track,\0A 128 bytes per sector (250.25 KB)\0A 8-inch Double sided, 77 tracks per side, 8 sectors per track,\0A ONE_K bytes per sector (1232 KB)\0A (8-inch Single sided, (single and) double density (DOS 1))\00"
@.str.10 = [141 x i8] c"\0A 5.25-inch Double sided, 40 tracks per side, 8 sectors per track\0A (320 KB) (since DOS 1.1)\0A Hard disk (Sanyo 55x DS-DOS 2.11 only)\00"
@.str.11 = [1 x i8] zeroinitializer
define i8* @msdos_get_media_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %16 [
i32 229, label %5
i32 237, label %6
i32 240, label %7
i32 248, label %8
i32 249, label %9
i32 250, label %10
i32 251, label %11
i32 252, label %12
i32 253, label %13
i32 254, label %14
i32 255, label %15
]
5: ; preds = %1
store i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
6: ; preds = %1
store i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %17
7: ; preds = %1
store i8* getelementptr inbounds ([272 x i8], [272 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %17
8: ; preds = %1
store i8* getelementptr inbounds ([405 x i8], [405 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %17
9: ; preds = %1
store i8* getelementptr inbounds ([292 x i8], [292 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %17
10: ; preds = %1
store i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %17
11: ; preds = %1
store i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %17
12: ; preds = %1
store i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %17
13: ; preds = %1
store i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %1
store i8* getelementptr inbounds ([368 x i8], [368 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %17
15: ; preds = %1
store i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %17
16: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [125 x i8] c"\0A 8-inch (200 mm) Single sided, 77 tracks per side, 26 sectors\0A per track, 128 bytes per sector (243 KB) (DR-DOS only)\00"
@.str.1 = [97 x i8] c"\0A 5.25-inch (130 mm) Double sided, 80 tracks per side, 9 sector,\0A 720 KB (Tandy 2000 only)\00"
@.str.2 = [272 x i8] c"\0A 3.5-inch (90 mm) Double Sided, 80 tracks per side, 18 or 36\0A sectors per track (1.44 MB or 2.88 MB).\0A Designated for use with custom floppy and superfloppy formats\0A where the geometry is defined in the BPB.\0A Used also for other media types such as tapes.\00"
@.str.3 = [405 x i8] c"\0A Fixed disk (i.e., typically a partition on a hard disk).\0A (since DOS 2.0)\0A Designated to be used for any partitioned fixed or removable\0A media, where the geometry is defined in the BPB.\0A 3.5-inch Single sided, 80 tracks per side, 9 sectors per track\0A (360 KB) (MSX-DOS only)\0A 5.25-inch Double sided, 80 tracks per side, 9 sectors per track\0A (720 KB) (Sanyo 55x DS-DOS 2.11 only)\00"
@.str.4 = [292 x i8] c"\0A 3.5-inch Double sided, 80 tracks per side, 9 sectors per track\0A (720 KB) (since DOS 3.2)\0A 3.5-inch Double sided, 80 tracks per side, 18 sectors per track\0A (1440 KB) (DOS 3.2 only)\0A 5.25-inch Double sided, 80 tracks per side, 15 sectors per track\0A (1.2 MB) (since DOS 3.0)\00"
@.str.5 = [190 x i8] c"\0A 3.5-inch and 5.25-inch Single sided, 80 tracks per side, 8\0A sectors per track (320 KB)\0A Used also for RAM disks and ROM disks (f.e. on HP 200LX)\0A Hard disk (Tandy MS-DOS only)\00"
@.str.6 = [95 x i8] c"\0A 3.5-inch and 5.25-inch Double sided, 80 tracks per side,\0A 8 sectors per track (640 KB)\00"
@.str.7 = [98 x i8] c"\0A 5.25-inch Single sided, 40 tracks per side, 9 sectors per track\0A (180 KB) (since DOS 2.0)\00"
@.str.8 = [264 x i8] c"\0A 5.25-inch Double sided, 40 tracks per side, 9 sectors per track\0A (360 KB) (since DOS 2.0)\0A 8-inch Double sided, 77 tracks per side, 26 sectors per track,\0A 128 bytes per sector (500.5 KB)\0A (8-inch Double sided, (single and) double density (DOS 1))\00"
@.str.9 = [368 x i8] c"\0A 5.25-inch Single sided, 40 tracks per side, 8 sectors per track\0A (160 KB) (since DOS 1.0)\0A 8-inch Single sided, 77 tracks per side, 26 sectors per track,\0A 128 bytes per sector (250.25 KB)\0A 8-inch Double sided, 77 tracks per side, 8 sectors per track,\0A ONE_K bytes per sector (1232 KB)\0A (8-inch Single sided, (single and) double density (DOS 1))\00"
@.str.10 = [141 x i8] c"\0A 5.25-inch Double sided, 40 tracks per side, 8 sectors per track\0A (320 KB) (since DOS 1.1)\0A Hard disk (Sanyo 55x DS-DOS 2.11 only)\00"
@.str.11 = [1 x i8] zeroinitializer
@reltable.msdos_get_media_type = [27 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([125 x i8]* @.str to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([97 x i8]* @.str.1 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([272 x i8]* @.str.2 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([1 x i8]* @.str.11 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([405 x i8]* @.str.3 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([292 x i8]* @.str.4 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([190 x i8]* @.str.5 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([95 x i8]* @.str.6 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([98 x i8]* @.str.7 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([264 x i8]* @.str.8 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([368 x i8]* @.str.9 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([141 x i8]* @.str.10 to i64), i64 ptrtoint ([27 x i32]* @reltable.msdos_get_media_type to i64)) to i32)]
define i8* @msdos_get_media_type(i32 %0) {
%2 = add i32 %0, -229
%3 = icmp ult i32 %2, 27
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([27 x i32]* @reltable.msdos_get_media_type to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.11, i64 0, i64 0), %1 ]
ret i8* %9
}