#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 */
int /*<<< orphan*/ strcmp(char const *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void mime_to_ext(const char *mime, char *buf) {
  switch (*mime) {
  case 'a':
    if (strcmp(mime + 6, "mpeg") == 0)
      strcpy(buf, "mp3");
    else if (strcmp(mime + 6, "mp4") == 0)
      strcpy(buf, "m4a");
    else if (strcmp(mime + 6, "x-ms-wma") == 0)
      strcpy(buf, "wma");
    else if (strcmp(mime + 6, "x-flac") == 0)
      strcpy(buf, "flac");
    else if (strcmp(mime + 6, "flac") == 0)
      strcpy(buf, "flac");
    else if (strcmp(mime + 6, "x-wav") == 0)
      strcpy(buf, "wav");
    else
      strcpy(buf, "dat");
    break;
  case 'v':
    if (strcmp(mime + 6, "avi") == 0)
      strcpy(buf, "avi");
    else if (strcmp(mime + 6, "divx") == 0)
      strcpy(buf, "avi");
    else if (strcmp(mime + 6, "x-msvideo") == 0)
      strcpy(buf, "avi");
    else if (strcmp(mime + 6, "mpeg") == 0)
      strcpy(buf, "mpg");
    else if (strcmp(mime + 6, "mp4") == 0)
      strcpy(buf, "mp4");
    else if (strcmp(mime + 6, "x-ms-wmv") == 0)
      strcpy(buf, "wmv");
    else if (strcmp(mime + 6, "x-matroska") == 0)
      strcpy(buf, "mkv");
    else if (strcmp(mime + 6, "x-mkv") == 0)
      strcpy(buf, "mkv");
    else if (strcmp(mime + 6, "x-flv") == 0)
      strcpy(buf, "flv");
    else if (strcmp(mime + 6, "vnd.dlna.mpeg-tts") == 0)
      strcpy(buf, "mpg");
    else if (strcmp(mime + 6, "x-tivo-mpeg") == 0)
      strcpy(buf, "TiVo");
    else
      strcpy(buf, "dat");
    break;
  case 'i':
    if (strcmp(mime + 6, "jpeg") == 0)
      strcpy(buf, "jpg");
    else if (strcmp(mime + 6, "png") == 0)
      strcpy(buf, "png");
    else
      strcpy(buf, "dat");
    break;
  default:
    strcpy(buf, "dat");
    break;
  }
}


x86 assembly (clang, -O0):
<mime_to_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x61,%eax
je     116a <mime_to_ext+0x4a>
jmp    1148 <mime_to_ext+0x28>
mov    -0x14(%rbp),%eax
sub    $0x69,%eax
je     1531 <mime_to_ext+0x411>
jmp    1159 <mime_to_ext+0x39>
mov    -0x14(%rbp),%eax
sub    $0x76,%eax
je     12c4 <mime_to_ext+0x1a4>
jmp    15af <mime_to_ext+0x48f>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xefd(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    119c <mime_to_ext+0x7c>
mov    -0x10(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12bf <mime_to_ext+0x19f>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xe59(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11ce <mime_to_ext+0xae>
mov    -0x10(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12ba <mime_to_ext+0x19a>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xe2f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1200 <mime_to_ext+0xe0>
mov    -0x10(%rbp),%rdi
lea    0xe1b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b5 <mime_to_ext+0x195>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xe06(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1232 <mime_to_ext+0x112>
mov    -0x10(%rbp),%rdi
lea    0xdef(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12b0 <mime_to_ext+0x190>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xdd6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1264 <mime_to_ext+0x144>
mov    -0x10(%rbp),%rdi
lea    0xdbd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12ab <mime_to_ext+0x18b>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xda9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1296 <mime_to_ext+0x176>
mov    -0x10(%rbp),%rdi
lea    0xd92(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12a6 <mime_to_ext+0x186>
mov    -0x10(%rbp),%rdi
lea    0xd81(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12ab <mime_to_ext+0x18b>
jmp    12b0 <mime_to_ext+0x190>
jmp    12b5 <mime_to_ext+0x195>
jmp    12ba <mime_to_ext+0x19a>
jmp    12bf <mime_to_ext+0x19f>
jmp    15bf <mime_to_ext+0x49f>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xd53(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12f6 <mime_to_ext+0x1d6>
mov    -0x10(%rbp),%rdi
lea    0xd3a(%rip),%rsi
call   1030 <strcpy@plt>
jmp    152c <mime_to_ext+0x40c>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xd25(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1328 <mime_to_ext+0x208>
mov    -0x10(%rbp),%rdi
lea    0xd08(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1527 <mime_to_ext+0x407>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xcf8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    135a <mime_to_ext+0x23a>
mov    -0x10(%rbp),%rdi
lea    0xcd6(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1522 <mime_to_ext+0x402>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xd0d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    138c <mime_to_ext+0x26c>
mov    -0x10(%rbp),%rdi
lea    0xcb7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    151d <mime_to_ext+0x3fd>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xc69(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    13be <mime_to_ext+0x29e>
mov    -0x10(%rbp),%rdi
lea    0xc50(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1518 <mime_to_ext+0x3f8>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xc70(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    13f0 <mime_to_ext+0x2d0>
mov    -0x10(%rbp),%rdi
lea    0xc5c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1513 <mime_to_ext+0x3f3>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xc47(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1422 <mime_to_ext+0x302>
mov    -0x10(%rbp),%rdi
lea    0xc3b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    150e <mime_to_ext+0x3ee>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xc20(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1454 <mime_to_ext+0x334>
mov    -0x10(%rbp),%rdi
lea    0xc09(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1509 <mime_to_ext+0x3e9>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xbf4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1486 <mime_to_ext+0x366>
mov    -0x10(%rbp),%rdi
lea    0xbdd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1504 <mime_to_ext+0x3e4>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xbc8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    14b8 <mime_to_ext+0x398>
mov    -0x10(%rbp),%rdi
lea    0xb8b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    14ff <mime_to_ext+0x3df>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xba8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    14ea <mime_to_ext+0x3ca>
mov    -0x10(%rbp),%rdi
lea    0xb9b(%rip),%rsi
call   1030 <strcpy@plt>
jmp    14fa <mime_to_ext+0x3da>
mov    -0x10(%rbp),%rdi
lea    0xb2d(%rip),%rsi
call   1030 <strcpy@plt>
jmp    14ff <mime_to_ext+0x3df>
jmp    1504 <mime_to_ext+0x3e4>
jmp    1509 <mime_to_ext+0x3e9>
jmp    150e <mime_to_ext+0x3ee>
jmp    1513 <mime_to_ext+0x3f3>
jmp    1518 <mime_to_ext+0x3f8>
jmp    151d <mime_to_ext+0x3fd>
jmp    1522 <mime_to_ext+0x402>
jmp    1527 <mime_to_ext+0x407>
jmp    152c <mime_to_ext+0x40c>
jmp    15bf <mime_to_ext+0x49f>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xb40(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1563 <mime_to_ext+0x443>
mov    -0x10(%rbp),%rdi
lea    0xb2c(%rip),%rsi
call   1030 <strcpy@plt>
jmp    15aa <mime_to_ext+0x48a>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
lea    0xb17(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1595 <mime_to_ext+0x475>
mov    -0x10(%rbp),%rdi
lea    0xafe(%rip),%rsi
call   1030 <strcpy@plt>
jmp    15a5 <mime_to_ext+0x485>
mov    -0x10(%rbp),%rdi
lea    0xa82(%rip),%rsi
call   1030 <strcpy@plt>
jmp    15aa <mime_to_ext+0x48a>
jmp    15bf <mime_to_ext+0x49f>
mov    -0x10(%rbp),%rdi
lea    0xa68(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mime_to_ext>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl (%rdi),%eax
cmp    $0x76,%eax
je     11ee <mime_to_ext+0xce>
cmp    $0x69,%eax
je     130c <mime_to_ext+0x1ec>
cmp    $0x61,%eax
jne    1344 <mime_to_ext+0x224>
add    $0x6,%rbx
lea    0xf1f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     134d <mime_to_ext+0x22d>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     135f <mime_to_ext+0x23f>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1368 <mime_to_ext+0x248>
lea    0xe79(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xe6c(%rip),%r15
test   %eax,%eax
je     1386 <mime_to_ext+0x266>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1386 <mime_to_ext+0x266>
lea    0xe4f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
lea    0xe40(%rip),%rax
lea    0xe3d(%rip),%r15
cmove  %rax,%r15
jmp    1386 <mime_to_ext+0x266>
add    $0x6,%rbx
lea    0xe2d(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1386 <mime_to_ext+0x266>
lea    0xe17(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1386 <mime_to_ext+0x266>
lea    0xe05(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1386 <mime_to_ext+0x266>
lea    0xe35(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xde9(%rip),%r12
test   %eax,%eax
je     1371 <mime_to_ext+0x251>
lea    0xda5(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1386 <mime_to_ext+0x266>
lea    0xdc4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1376 <mime_to_ext+0x256>
lea    0xdb6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xdb4(%rip),%r15
test   %eax,%eax
je     1386 <mime_to_ext+0x266>
lea    0xda3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1386 <mime_to_ext+0x266>
lea    0xd92(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     137f <mime_to_ext+0x25f>
lea    0xd81(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %r12,%r15
test   %eax,%eax
je     1386 <mime_to_ext+0x266>
lea    0xd79(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
lea    0xd74(%rip),%rax
jmp    11de <mime_to_ext+0xbe>
add    $0x6,%rbx
lea    0xd69(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1356 <mime_to_ext+0x236>
lea    0xd5f(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
lea    0xce4(%rip),%r15
cmove  %r12,%r15
jmp    1386 <mime_to_ext+0x266>
lea    0xcd7(%rip),%r15
jmp    1386 <mime_to_ext+0x266>
lea    0xcac(%rip),%r15
jmp    1386 <mime_to_ext+0x266>
lea    0xd28(%rip),%r15
jmp    1386 <mime_to_ext+0x266>
lea    0xca2(%rip),%r15
jmp    1386 <mime_to_ext+0x266>
lea    0xca2(%rip),%r15
jmp    1386 <mime_to_ext+0x266>
mov    %r12,%r15
jmp    1386 <mime_to_ext+0x266>
lea    0xcc5(%rip),%r15
jmp    1386 <mime_to_ext+0x266>
lea    0xcd3(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"mpeg\00"
@.str.1 = [4 x i8] c"mp3\00"
@.str.2 = [4 x i8] c"mp4\00"
@.str.3 = [4 x i8] c"m4a\00"
@.str.4 = [9 x i8] c"x-ms-wma\00"
@.str.5 = [4 x i8] c"wma\00"
@.str.6 = [7 x i8] c"x-flac\00"
@.str.7 = [5 x i8] c"flac\00"
@.str.8 = [6 x i8] c"x-wav\00"
@.str.9 = [4 x i8] c"wav\00"
@.str.10 = [4 x i8] c"dat\00"
@.str.11 = [4 x i8] c"avi\00"
@.str.12 = [5 x i8] c"divx\00"
@.str.13 = [10 x i8] c"x-msvideo\00"
@.str.14 = [4 x i8] c"mpg\00"
@.str.15 = [9 x i8] c"x-ms-wmv\00"
@.str.16 = [4 x i8] c"wmv\00"
@.str.17 = [11 x i8] c"x-matroska\00"
@.str.18 = [4 x i8] c"mkv\00"
@.str.19 = [6 x i8] c"x-mkv\00"
@.str.20 = [6 x i8] c"x-flv\00"
@.str.21 = [4 x i8] c"flv\00"
@.str.22 = [18 x i8] c"vnd.dlna.mpeg-tts\00"
@.str.23 = [12 x i8] c"x-tivo-mpeg\00"
@.str.24 = [5 x i8] c"TiVo\00"
@.str.25 = [5 x i8] c"jpeg\00"
@.str.26 = [4 x i8] c"jpg\00"
@.str.27 = [4 x i8] c"png\00"
define void @mime_to_ext(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %188 [
i32 97, label %8
i32 118, label %65
i32 105, label %167
]
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 6
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %64
16: ; preds = %8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 6
%19 = call i32 @strcmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load i8*, i8** %4
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %63
24: ; preds = %16
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 6
%27 = call i32 @strcmp(i8* %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = load i8*, i8** %4
%31 = call i32 @strcpy(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
br label %62
32: ; preds = %24
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 6
%35 = call i32 @strcmp(i8* %34, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = load i8*, i8** %4
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %61
40: ; preds = %32
%41 = load i8*, i8** %3
%42 = getelementptr inbounds i8, i8* %41, i64 6
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %40
%46 = load i8*, i8** %4
%47 = call i32 @strcpy(i8* %46, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %60
48: ; preds = %40
%49 = load i8*, i8** %3
%50 = getelementptr inbounds i8, i8* %49, i64 6
%51 = call i32 @strcmp(i8* %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %48
%54 = load i8*, i8** %4
%55 = call i32 @strcpy(i8* %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %59
56: ; preds = %48
%57 = load i8*, i8** %4
%58 = call i32 @strcpy(i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %59
59: ; preds = %56, %53
br label %60
60: ; preds = %59, %45
br label %61
61: ; preds = %60, %37
br label %62
62: ; preds = %61, %29
br label %63
63: ; preds = %62, %21
br label %64
64: ; preds = %63, %13
br label %191
65: ; preds = %2
%66 = load i8*, i8** %3
%67 = getelementptr inbounds i8, i8* %66, i64 6
%68 = call i32 @strcmp(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %65
%71 = load i8*, i8** %4
%72 = call i32 @strcpy(i8* %71, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %166
73: ; preds = %65
%74 = load i8*, i8** %3
%75 = getelementptr inbounds i8, i8* %74, i64 6
%76 = call i32 @strcmp(i8* %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %81
78: ; preds = %73
%79 = load i8*, i8** %4
%80 = call i32 @strcpy(i8* %79, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %165
81: ; preds = %73
%82 = load i8*, i8** %3
%83 = getelementptr inbounds i8, i8* %82, i64 6
%84 = call i32 @strcmp(i8* %83, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0))
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %89
86: ; preds = %81
%87 = load i8*, i8** %4
%88 = call i32 @strcpy(i8* %87, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %164
89: ; preds = %81
%90 = load i8*, i8** %3
%91 = getelementptr inbounds i8, i8* %90, i64 6
%92 = call i32 @strcmp(i8* %91, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%93 = icmp eq i32 %92, 0
br i1 %93, label %94, label %97
94: ; preds = %89
%95 = load i8*, i8** %4
%96 = call i32 @strcpy(i8* %95, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
br label %163
97: ; preds = %89
%98 = load i8*, i8** %3
%99 = getelementptr inbounds i8, i8* %98, i64 6
%100 = call i32 @strcmp(i8* %99, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%101 = icmp eq i32 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %97
%103 = load i8*, i8** %4
%104 = call i32 @strcpy(i8* %103, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %162
105: ; preds = %97
%106 = load i8*, i8** %3
%107 = getelementptr inbounds i8, i8* %106, i64 6
%108 = call i32 @strcmp(i8* %107, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%109 = icmp eq i32 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %105
%111 = load i8*, i8** %4
%112 = call i32 @strcpy(i8* %111, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
br label %161
113: ; preds = %105
%114 = load i8*, i8** %3
%115 = getelementptr inbounds i8, i8* %114, i64 6
%116 = call i32 @strcmp(i8* %115, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0))
%117 = icmp eq i32 %116, 0
br i1 %117, label %118, label %121
118: ; preds = %113
%119 = load i8*, i8** %4
%120 = call i32 @strcpy(i8* %119, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
br label %160
121: ; preds = %113
%122 = load i8*, i8** %3
%123 = getelementptr inbounds i8, i8* %122, i64 6
%124 = call i32 @strcmp(i8* %123, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%125 = icmp eq i32 %124, 0
br i1 %125, label %126, label %129
126: ; preds = %121
%127 = load i8*, i8** %4
%128 = call i32 @strcpy(i8* %127, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
br label %159
129: ; preds = %121
%130 = load i8*, i8** %3
%131 = getelementptr inbounds i8, i8* %130, i64 6
%132 = call i32 @strcmp(i8* %131, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
%133 = icmp eq i32 %132, 0
br i1 %133, label %134, label %137
134: ; preds = %129
%135 = load i8*, i8** %4
%136 = call i32 @strcpy(i8* %135, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0))
br label %158
137: ; preds = %129
%138 = load i8*, i8** %3
%139 = getelementptr inbounds i8, i8* %138, i64 6
%140 = call i32 @strcmp(i8* %139, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%141 = icmp eq i32 %140, 0
br i1 %141, label %142, label %145
142: ; preds = %137
%143 = load i8*, i8** %4
%144 = call i32 @strcpy(i8* %143, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
br label %157
145: ; preds = %137
%146 = load i8*, i8** %3
%147 = getelementptr inbounds i8, i8* %146, i64 6
%148 = call i32 @strcmp(i8* %147, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.23, i64 0, i64 0))
%149 = icmp eq i32 %148, 0
br i1 %149, label %150, label %153
150: ; preds = %145
%151 = load i8*, i8** %4
%152 = call i32 @strcpy(i8* %151, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0))
br label %156
153: ; preds = %145
%154 = load i8*, i8** %4
%155 = call i32 @strcpy(i8* %154, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %156
156: ; preds = %153, %150
br label %157
157: ; preds = %156, %142
br label %158
158: ; preds = %157, %134
br label %159
159: ; preds = %158, %126
br label %160
160: ; preds = %159, %118
br label %161
161: ; preds = %160, %110
br label %162
162: ; preds = %161, %102
br label %163
163: ; preds = %162, %94
br label %164
164: ; preds = %163, %86
br label %165
165: ; preds = %164, %78
br label %166
166: ; preds = %165, %70
br label %191
167: ; preds = %2
%168 = load i8*, i8** %3
%169 = getelementptr inbounds i8, i8* %168, i64 6
%170 = call i32 @strcmp(i8* %169, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
%171 = icmp eq i32 %170, 0
br i1 %171, label %172, label %175
172: ; preds = %167
%173 = load i8*, i8** %4
%174 = call i32 @strcpy(i8* %173, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i64 0, i64 0))
br label %187
175: ; preds = %167
%176 = load i8*, i8** %3
%177 = getelementptr inbounds i8, i8* %176, i64 6
%178 = call i32 @strcmp(i8* %177, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0))
%179 = icmp eq i32 %178, 0
br i1 %179, label %180, label %183
180: ; preds = %175
%181 = load i8*, i8** %4
%182 = call i32 @strcpy(i8* %181, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0))
br label %186
183: ; preds = %175
%184 = load i8*, i8** %4
%185 = call i32 @strcpy(i8* %184, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %186
186: ; preds = %183, %180
br label %187
187: ; preds = %186, %172
br label %191
188: ; preds = %2
%189 = load i8*, i8** %4
%190 = call i32 @strcpy(i8* %189, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %191
191: ; preds = %188, %187, %166, %64
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"mpeg\00"
@.str.1 = [4 x i8] c"mp3\00"
@.str.2 = [4 x i8] c"mp4\00"
@.str.3 = [4 x i8] c"m4a\00"
@.str.4 = [9 x i8] c"x-ms-wma\00"
@.str.5 = [4 x i8] c"wma\00"
@.str.6 = [7 x i8] c"x-flac\00"
@.str.7 = [5 x i8] c"flac\00"
@.str.8 = [6 x i8] c"x-wav\00"
@.str.9 = [4 x i8] c"wav\00"
@.str.10 = [4 x i8] c"dat\00"
@.str.11 = [4 x i8] c"avi\00"
@.str.12 = [5 x i8] c"divx\00"
@.str.13 = [10 x i8] c"x-msvideo\00"
@.str.14 = [4 x i8] c"mpg\00"
@.str.15 = [9 x i8] c"x-ms-wmv\00"
@.str.16 = [4 x i8] c"wmv\00"
@.str.17 = [11 x i8] c"x-matroska\00"
@.str.18 = [4 x i8] c"mkv\00"
@.str.19 = [6 x i8] c"x-mkv\00"
@.str.20 = [6 x i8] c"x-flv\00"
@.str.21 = [4 x i8] c"flv\00"
@.str.22 = [18 x i8] c"vnd.dlna.mpeg-tts\00"
@.str.23 = [12 x i8] c"x-tivo-mpeg\00"
@.str.24 = [5 x i8] c"TiVo\00"
@.str.25 = [5 x i8] c"jpeg\00"
@.str.26 = [4 x i8] c"jpg\00"
@.str.27 = [4 x i8] c"png\00"
define void @mime_to_ext(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
switch i32 %4, label %68 [
i32 97, label %5
i32 118, label %25
i32 105, label %60
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 6
%7 = tail call i32 @strcmp(i8* %6, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %68, label %9
9: ; preds = %5
%10 = tail call i32 @strcmp(i8* %6, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %68, label %12
12: ; preds = %9
%13 = tail call i32 @strcmp(i8* %6, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %68, label %15
15: ; preds = %12
%16 = tail call i32 @strcmp(i8* %6, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %68, label %18
18: ; preds = %15
%19 = tail call i32 @strcmp(i8* %6, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %68, label %21
21: ; preds = %18
%22 = tail call i32 @strcmp(i8* %6, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
%24 = select i1 %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0)
br label %68
25: ; preds = %2
%26 = getelementptr inbounds i8, i8* %0, i64 6
%27 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %68, label %29
29: ; preds = %25
%30 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br i1 %31, label %68, label %32
32: ; preds = %29
%33 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %68, label %35
35: ; preds = %32
%36 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %68, label %38
38: ; preds = %35
%39 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %68, label %41
41: ; preds = %38
%42 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %68, label %44
44: ; preds = %41
%45 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %68, label %47
47: ; preds = %44
%48 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br i1 %49, label %68, label %50
50: ; preds = %47
%51 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
%52 = icmp eq i32 %51, 0
br i1 %52, label %68, label %53
53: ; preds = %50
%54 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(18) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%55 = icmp eq i32 %54, 0
br i1 %55, label %68, label %56
56: ; preds = %53
%57 = tail call i32 @strcmp(i8* %26, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.23, i64 0, i64 0))
%58 = icmp eq i32 %57, 0
%59 = select i1 %58, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0)
br label %68
60: ; preds = %2
%61 = getelementptr inbounds i8, i8* %0, i64 6
%62 = tail call i32 @strcmp(i8* %61, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.25, i64 0, i64 0))
%63 = icmp eq i32 %62, 0
br i1 %63, label %68, label %64
64: ; preds = %60
%65 = tail call i32 @strcmp(i8* %61, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0))
%66 = icmp eq i32 %65, 0
%67 = select i1 %66, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.27, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0)
br label %68
68: ; preds = %2, %64, %60, %56, %53, %50, %47, %44, %41, %38, %35, %32, %29, %25, %21, %18, %15, %12, %9, %5
%69 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %9 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), %12 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %15 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), %18 ], [ %24, %21 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), %25 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), %29 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), %32 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), %35 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %38 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), %41 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), %44 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0), %47 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0), %50 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), %53 ], [ %59, %56 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i64 0, i64 0), %60 ], [ %67, %64 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), %2 ]
%70 = tail call i32 @strcpy(i8* %1, i8* %69)
ret void
}