#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 /*<<< orphan*/ mm;

/* Variables and functions */
scalar_t__ av_stristr(char *, char const *);
const char *get_mine_type(char *name) {
  int i, n;
  static const char *mm[][2] = {
      ".htm", "text/html",  ".m3u8", "text/plain",
      ".ts",  "video/MP2T", ".flv",  "video/MP2T",
      ".xml", "text/xml",   ".css",  "text/css",
      ".h",   "text/plain", ".c",    "text/plain",
      ".txt", "text/plain", "",      "application/octet-stream",
  };
  if (!name) {
    return "";
  }
  n = sizeof(mm) / sizeof(mm[0]);
  for (i = 0; i < n; ++i) {
    if (av_stristr(name, mm[i][0]))
      break;
  }
  if (i >= n)
    i = n - 1;
  return mm[i][1];
}


x86 assembly (clang, -O0):
<get_mine_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <get_mine_type+0x27>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c0 <get_mine_type+0xb0>
movl   $0xa,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1191 <get_mine_type+0x81>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rcx
lea    0x2ed0(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
call   1030 <av_stristr@plt>
cmp    $0x0,%rax
je     117e <get_mine_type+0x6e>
jmp    1191 <get_mine_type+0x81>
jmp    1183 <get_mine_type+0x73>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <get_mine_type+0x35>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     11a6 <get_mine_type+0x96>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
lea    0x2e7f(%rip),%rax
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mine_type>:
test   %rdi,%rdi
je     1131 <get_mine_type+0x21>
push   %rbx
mov    %rdi,%rbx
lea    0xee0(%rip),%rsi
call   1030 <av_stristr@plt>
test   %rax,%rax
je     1139 <get_mine_type+0x29>
xor    %ecx,%ecx
jmp    1221 <get_mine_type+0x111>
lea    0xedc(%rip),%rax
ret
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <av_stristr@plt>
mov    $0x1,%ecx
test   %rax,%rax
jne    1221 <get_mine_type+0x111>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <av_stristr@plt>
mov    $0x2,%ecx
test   %rax,%rax
jne    1221 <get_mine_type+0x111>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <av_stristr@plt>
mov    $0x3,%ecx
test   %rax,%rax
jne    1221 <get_mine_type+0x111>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <av_stristr@plt>
mov    $0x4,%ecx
test   %rax,%rax
jne    1221 <get_mine_type+0x111>
lea    0xe92(%rip),%rsi
mov    %rbx,%rdi
call   1030 <av_stristr@plt>
mov    $0x5,%ecx
test   %rax,%rax
jne    1221 <get_mine_type+0x111>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1030 <av_stristr@plt>
mov    $0x6,%ecx
test   %rax,%rax
jne    1221 <get_mine_type+0x111>
lea    0xe71(%rip),%rsi
mov    %rbx,%rdi
call   1030 <av_stristr@plt>
mov    $0x7,%ecx
test   %rax,%rax
jne    1221 <get_mine_type+0x111>
lea    0xe5b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <av_stristr@plt>
mov    $0x8,%ecx
test   %rax,%rax
jne    1221 <get_mine_type+0x111>
lea    0xe00(%rip),%rsi
mov    %rbx,%rdi
call   1030 <av_stristr@plt>
mov    $0x9,%ecx
shl    $0x4,%rcx
lea    0x2b54(%rip),%rax
mov    0x8(%rcx,%rax,1),%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_mine_type.mm = internal global [10 x [2 x i8*]] [[2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i32 0, i32 0)]]
@.str = [5 x i8] c".htm\00"
@.str.1 = [10 x i8] c"text/html\00"
@.str.2 = [6 x i8] c".m3u8\00"
@.str.3 = [11 x i8] c"text/plain\00"
@.str.4 = [4 x i8] c".ts\00"
@.str.5 = [11 x i8] c"video/MP2T\00"
@.str.6 = [5 x i8] c".flv\00"
@.str.7 = [5 x i8] c".xml\00"
@.str.8 = [9 x i8] c"text/xml\00"
@.str.9 = [5 x i8] c".css\00"
@.str.10 = [9 x i8] c"text/css\00"
@.str.11 = [3 x i8] c".h\00"
@.str.12 = [3 x i8] c".c\00"
@.str.13 = [5 x i8] c".txt\00"
@.str.14 = [1 x i8] zeroinitializer
@.str.15 = [25 x i8] c"application/octet-stream\00"
define i8* @get_mine_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %41
9: ; preds = %1
store i32 10, i32* %5
store i32 0, i32* %4
br label %10
10: ; preds = %25, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x [2 x i8*]], [10 x [2 x i8*]]* @get_mine_type.mm, i64 0, i64 %17
%19 = getelementptr inbounds [2 x i8*], [2 x i8*]* %18, i64 0, i64 0
%20 = load i8*, i8** %19
%21 = call i64 @av_stristr(i8* %15, i8* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %14
br label %28
24: ; preds = %14
br label %25
25: ; preds = %24
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %10
28: ; preds = %23, %10
%29 = load i32, i32* %4
%30 = load i32, i32* %5
%31 = icmp sge i32 %29, %30
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i32, i32* %5
%34 = sub nsw i32 %33, 1
store i32 %34, i32* %4
br label %35
35: ; preds = %32, %28
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [10 x [2 x i8*]], [10 x [2 x i8*]]* @get_mine_type.mm, i64 0, i64 %37
%39 = getelementptr inbounds [2 x i8*], [2 x i8*]* %38, i64 0, i64 1
%40 = load i8*, i8** %39
store i8* %40, i8** %2
br label %41
41: ; preds = %35, %8
%42 = load i8*, i8** %2
ret i8* %42
}

LLVM IR (-O2):
@get_mine_type.mm = internal unnamed_addr constant [10 x [2 x i8*]] [[2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0)], [2 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i32 0, i32 0)]]
@.str = [5 x i8] c".htm\00"
@.str.1 = [10 x i8] c"text/html\00"
@.str.2 = [6 x i8] c".m3u8\00"
@.str.3 = [11 x i8] c"text/plain\00"
@.str.4 = [4 x i8] c".ts\00"
@.str.5 = [11 x i8] c"video/MP2T\00"
@.str.6 = [5 x i8] c".flv\00"
@.str.7 = [5 x i8] c".xml\00"
@.str.8 = [9 x i8] c"text/xml\00"
@.str.9 = [5 x i8] c".css\00"
@.str.10 = [9 x i8] c"text/css\00"
@.str.11 = [3 x i8] c".h\00"
@.str.12 = [3 x i8] c".c\00"
@.str.13 = [5 x i8] c".txt\00"
@.str.14 = [1 x i8] zeroinitializer
@.str.15 = [25 x i8] c"application/octet-stream\00"
define i8* @get_mine_type(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %36, label %3
3: ; preds = %1
%4 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %32
6: ; preds = %3
%7 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %32
9: ; preds = %6
%10 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %32
15: ; preds = %12
%16 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %32
18: ; preds = %15
%19 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %32
21: ; preds = %18
%22 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = tail call i64 @av_stristr(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0))
br label %32
32: ; preds = %30, %27, %24, %21, %18, %15, %12, %9, %6, %3
%33 = phi i64 [ 8, %27 ], [ 7, %24 ], [ 6, %21 ], [ 5, %18 ], [ 4, %15 ], [ 3, %12 ], [ 2, %9 ], [ 1, %6 ], [ 0, %3 ], [ 9, %30 ]
%34 = getelementptr inbounds [10 x [2 x i8*]], [10 x [2 x i8*]]* @get_mine_type.mm, i64 0, i64 %33, i64 1
%35 = load i8*, i8** %34
br label %36
36: ; preds = %1, %32
%37 = phi i8* [ %35, %32 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.14, i64 0, i64 0), %1 ]
ret i8* %37
}