#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 *);
char *strrchr(char *, char);
const char *get_mime(char *filename) {
  const char *extension = strrchr(filename, '.');
  if (!strcmp(extension, ".js"))
    return "application/javascript";
  if (!strcmp(extension, ".css"))
    return "text/css";
  if (!strcmp(extension, ".ico"))
    return "image/vnd.microsoft.icon";
  if (!strcmp(extension, ".woff"))
    return "application/font-woff";
  if (!strcmp(extension, ".woff2"))
    return "application/font-woff";
  if (!strcmp(extension, ".ttf"))
    return "application/x-font-ttf";
  if (!strcmp(extension, ".eot"))
    return "application/octet-stream";
  if (!strcmp(extension, ".svg"))
    return "image/svg+xml";
  if (!strcmp(extension, ".html"))
    return "text/html";
  return "text/plain";
}


x86 assembly (clang, -O0):
<get_mime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1167 <get_mime+0x47>
lea    0xea6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ba <get_mime+0x19a>
mov    -0x18(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1190 <get_mime+0x70>
lea    0xe99(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ba <get_mime+0x19a>
mov    -0x18(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11b9 <get_mime+0x99>
lea    0xe7e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ba <get_mime+0x19a>
mov    -0x18(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11e2 <get_mime+0xc2>
lea    0xe74(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ba <get_mime+0x19a>
mov    -0x18(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    120b <get_mime+0xeb>
lea    0xe4b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ba <get_mime+0x19a>
mov    -0x18(%rbp),%rdi
lea    0xe54(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1234 <get_mime+0x114>
lea    0xe44(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ba <get_mime+0x19a>
mov    -0x18(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    125d <get_mime+0x13d>
lea    0xe37(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ba <get_mime+0x19a>
mov    -0x18(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1286 <get_mime+0x166>
lea    0xe2c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ba <get_mime+0x19a>
mov    -0x18(%rbp),%rdi
lea    0xe26(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12af <get_mime+0x18f>
lea    0xe17(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    12ba <get_mime+0x19a>
lea    0xe11(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mime>:
push   %r14
push   %rbx
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,%rbx
lea    0xec8(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1205 <get_mime+0xe5>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     120e <get_mime+0xee>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1217 <get_mime+0xf7>
lea    0xeca(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xec1(%rip),%r14
test   %eax,%eax
je     121e <get_mime+0xfe>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     121e <get_mime+0xfe>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1229 <get_mime+0x109>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1232 <get_mime+0x112>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     123b <get_mime+0x11b>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
lea    0xec5(%rip),%rax
lea    0xec8(%rip),%r14
cmove  %rax,%r14
jmp    121e <get_mime+0xfe>
lea    0xdf8(%rip),%r14
jmp    121e <get_mime+0xfe>
lea    0xe0b(%rip),%r14
jmp    121e <get_mime+0xfe>
lea    0xe10(%rip),%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe3f(%rip),%r14
jmp    121e <get_mime+0xfe>
lea    0xe52(%rip),%r14
jmp    121e <get_mime+0xfe>
lea    0xe67(%rip),%r14
jmp    121e <get_mime+0xfe>

LLVM IR (-O0):
@.str = [4 x i8] c".js\00"
@.str.1 = [23 x i8] c"application/javascript\00"
@.str.2 = [5 x i8] c".css\00"
@.str.3 = [9 x i8] c"text/css\00"
@.str.4 = [5 x i8] c".ico\00"
@.str.5 = [25 x i8] c"image/vnd.microsoft.icon\00"
@.str.6 = [6 x i8] c".woff\00"
@.str.7 = [22 x i8] c"application/font-woff\00"
@.str.8 = [7 x i8] c".woff2\00"
@.str.9 = [5 x i8] c".ttf\00"
@.str.10 = [23 x i8] c"application/x-font-ttf\00"
@.str.11 = [5 x i8] c".eot\00"
@.str.12 = [25 x i8] c"application/octet-stream\00"
@.str.13 = [5 x i8] c".svg\00"
@.str.14 = [14 x i8] c"image/svg+xml\00"
@.str.15 = [6 x i8] c".html\00"
@.str.16 = [10 x i8] c"text/html\00"
@.str.17 = [11 x i8] c"text/plain\00"
define i8* @get_mime(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %52
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %52
16: ; preds = %11
%17 = load i8*, i8** %4
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %16
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %52
21: ; preds = %16
%22 = load i8*, i8** %4
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %21
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %52
26: ; preds = %21
%27 = load i8*, i8** %4
%28 = call i32 @strcmp(i8* %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %31, label %30
30: ; preds = %26
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %52
31: ; preds = %26
%32 = load i8*, i8** %4
%33 = call i32 @strcmp(i8* %32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%34 = icmp ne i32 %33, 0
br i1 %34, label %36, label %35
35: ; preds = %31
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i8** %2
br label %52
36: ; preds = %31
%37 = load i8*, i8** %4
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %36
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), i8** %2
br label %52
41: ; preds = %36
%42 = load i8*, i8** %4
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %41
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %52
46: ; preds = %41
%47 = load i8*, i8** %4
%48 = call i32 @strcmp(i8* %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%49 = icmp ne i32 %48, 0
br i1 %49, label %51, label %50
50: ; preds = %46
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i8** %2
br label %52
51: ; preds = %46
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %52
52: ; preds = %51, %50, %45, %40, %35, %30, %25, %20, %15, %10
%53 = load i8*, i8** %2
ret i8* %53
}

LLVM IR (-O2):
@.str = [4 x i8] c".js\00"
@.str.1 = [23 x i8] c"application/javascript\00"
@.str.2 = [5 x i8] c".css\00"
@.str.3 = [9 x i8] c"text/css\00"
@.str.4 = [5 x i8] c".ico\00"
@.str.5 = [25 x i8] c"image/vnd.microsoft.icon\00"
@.str.6 = [6 x i8] c".woff\00"
@.str.7 = [22 x i8] c"application/font-woff\00"
@.str.8 = [7 x i8] c".woff2\00"
@.str.9 = [5 x i8] c".ttf\00"
@.str.10 = [23 x i8] c"application/x-font-ttf\00"
@.str.11 = [5 x i8] c".eot\00"
@.str.12 = [25 x i8] c"application/octet-stream\00"
@.str.13 = [5 x i8] c".svg\00"
@.str.14 = [14 x i8] c"image/svg+xml\00"
@.str.15 = [6 x i8] c".html\00"
@.str.16 = [10 x i8] c"text/html\00"
@.str.17 = [11 x i8] c"text/plain\00"
define i8* @get_mime(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %30, label %5
5: ; preds = %1
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %30, label %8
8: ; preds = %5
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %30, label %11
11: ; preds = %8
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %30, label %14
14: ; preds = %11
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %30, label %17
17: ; preds = %14
%18 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %30, label %20
20: ; preds = %17
%21 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %30, label %23
23: ; preds = %20
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %30, label %26
26: ; preds = %23
%27 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0)
br label %30
30: ; preds = %26, %23, %20, %17, %14, %11, %8, %5, %1
%31 = phi i8* [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), %1 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), %11 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), %14 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), %17 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i64 0, i64 0), %20 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), %23 ], [ %29, %26 ]
ret i8* %31
}