#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 */
scalar_t__ strcmp(char *, char *);
char *strrchr(char *, char);
char *get_mime_type(char *file) {
  char *ext = strrchr(file, '.');
  if (ext == NULL)
    return "text/html";
  ext = ext + 1;
  if (ext == NULL)
    return "text/plain";
  else if (strcmp(ext, "txt") == 0)
    return "text/plain";
  else if (strcmp(ext, "c") == 0)
    return "text/x-c";
  else if (strcmp(ext, "css") == 0)
    return "text/css";
  else if (strcmp(ext, "js") == 0)
    return "application/javascript";
  else if (strcmp(ext, "html") == 0)
    return "text/html";
  else if (strcmp(ext, "gif") == 0)
    return "image/gif";
  else if (strcmp(ext, "GIF") == 0)
    return "image/gif";
  else if (strcmp(ext, "jpeg") == 0)
    return "image/jpeg";
  else if (strcmp(ext, "JPEG") == 0)
    return "image/jpeg";
  else if (strcmp(ext, "JPG") == 0)
    return "image/jpeg";
  else if (strcmp(ext, "jpg") == 0)
    return "image/jpeg";
  else if (strcmp(ext, "bmp") == 0)
    return "image/bmp";
}


x86 assembly (clang, -O0):
<get_mime_type>:
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)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <get_mime_type+0x39>
lea    0xeb0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1180 <get_mime_type+0x60>
lea    0xe93(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11aa <get_mime_type+0x8a>
lea    0xe69(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11d4 <get_mime_type+0xb4>
lea    0xe4e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xe48(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11fe <get_mime_type+0xde>
lea    0xe2d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xe22(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1228 <get_mime_type+0x108>
lea    0xe0f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xdd2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1252 <get_mime_type+0x132>
lea    0xdb7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xdee(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    127c <get_mime_type+0x15c>
lea    0xdd2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12a6 <get_mime_type+0x186>
lea    0xda8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xda8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12d0 <get_mime_type+0x1b0>
lea    0xd8c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xd83(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12fa <get_mime_type+0x1da>
lea    0xd62(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xd5e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1324 <get_mime_type+0x204>
lea    0xd38(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xd38(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    134e <get_mime_type+0x22e>
lea    0xd0e(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
mov    -0x18(%rbp),%rdi
lea    0xd18(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1378 <get_mime_type+0x258>
lea    0xcfc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13b4 <get_mime_type+0x294>
jmp    137d <get_mime_type+0x25d>
jmp    1382 <get_mime_type+0x262>
jmp    1387 <get_mime_type+0x267>
jmp    138c <get_mime_type+0x26c>
jmp    1391 <get_mime_type+0x271>
jmp    1396 <get_mime_type+0x276>
jmp    139b <get_mime_type+0x27b>
jmp    13a0 <get_mime_type+0x280>
jmp    13a5 <get_mime_type+0x285>
jmp    13aa <get_mime_type+0x28a>
jmp    13af <get_mime_type+0x28f>
jmp    13b4 <get_mime_type+0x294>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mime_type>:
push   %r14
push   %rbx
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0xecb(%rip),%r14
test   %rax,%rax
je     1285 <get_mime_type+0x165>
mov    %rax,%rbx
add    $0x1,%rbx
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1263 <get_mime_type+0x143>
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     126c <get_mime_type+0x14c>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1275 <get_mime_type+0x155>
lea    0xe97(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     127e <get_mime_type+0x15e>
lea    0xe59(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1285 <get_mime_type+0x165>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xe72(%rip),%r14
test   %rax,%rax
je     1285 <get_mime_type+0x165>
lea    0xe6c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1285 <get_mime_type+0x165>
lea    0xe5e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xe49(%rip),%r14
test   %rax,%rax
je     1285 <get_mime_type+0x165>
lea    0xe48(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1285 <get_mime_type+0x165>
lea    0xe39(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1285 <get_mime_type+0x165>
lea    0xe29(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1285 <get_mime_type+0x165>
lea    0xe1f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xe0a(%rip),%r14
jmp    1285 <get_mime_type+0x165>
lea    0xda0(%rip),%r14
jmp    1285 <get_mime_type+0x165>
lea    0xda6(%rip),%r14
jmp    1285 <get_mime_type+0x165>
lea    0xda6(%rip),%r14
jmp    1285 <get_mime_type+0x165>
lea    0xda9(%rip),%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"text/html\00"
@.str.1 = [11 x i8] c"text/plain\00"
@.str.2 = [4 x i8] c"txt\00"
@.str.3 = [2 x i8] c"c\00"
@.str.4 = [9 x i8] c"text/x-c\00"
@.str.5 = [4 x i8] c"css\00"
@.str.6 = [9 x i8] c"text/css\00"
@.str.7 = [3 x i8] c"js\00"
@.str.8 = [23 x i8] c"application/javascript\00"
@.str.9 = [5 x i8] c"html\00"
@.str.10 = [4 x i8] c"gif\00"
@.str.11 = [10 x i8] c"image/gif\00"
@.str.12 = [4 x i8] c"GIF\00"
@.str.13 = [5 x i8] c"jpeg\00"
@.str.14 = [11 x i8] c"image/jpeg\00"
@.str.15 = [5 x i8] c"JPEG\00"
@.str.16 = [4 x i8] c"JPG\00"
@.str.17 = [4 x i8] c"jpg\00"
@.str.18 = [4 x i8] c"bmp\00"
@.str.19 = [10 x i8] c"image/bmp\00"
define i8* @get_mime_type(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 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
br label %88
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %10
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %88
16: ; preds = %10
%17 = load i8*, i8** %4
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %88
21: ; preds = %16
%22 = load i8*, i8** %4
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %21
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %88
26: ; preds = %21
%27 = load i8*, i8** %4
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %26
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %88
31: ; preds = %26
%32 = load i8*, i8** %4
%33 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %31
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8** %2
br label %88
36: ; preds = %31
%37 = load i8*, i8** %4
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %36
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
br label %88
41: ; preds = %36
%42 = load i8*, i8** %4
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %41
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %88
46: ; preds = %41
%47 = load i8*, i8** %4
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %46
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %88
51: ; preds = %46
%52 = load i8*, i8** %4
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %51
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %88
56: ; preds = %51
%57 = load i8*, i8** %4
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %61
60: ; preds = %56
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %88
61: ; preds = %56
%62 = load i8*, i8** %4
%63 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %66
65: ; preds = %61
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %88
66: ; preds = %61
%67 = load i8*, i8** %4
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %66
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i8** %2
br label %88
71: ; preds = %66
%72 = load i8*, i8** %4
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %71
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0), i8** %2
br label %88
76: ; preds = %71
br label %77
77: ; preds = %76
br label %78
78: ; preds = %77
br label %79
79: ; preds = %78
br label %80
80: ; preds = %79
br label %81
81: ; preds = %80
br label %82
82: ; preds = %81
br label %83
83: ; preds = %82
br label %84
84: ; preds = %83
br label %85
85: ; preds = %84
br label %86
86: ; preds = %85
br label %87
87: ; preds = %86
br label %88
88: ; preds = %9, %15, %20, %25, %30, %35, %40, %45, %50, %55, %60, %65, %70, %75, %87
%89 = load i8*, i8** %2
ret i8* %89
}

LLVM IR (-O2):
@.str = [10 x i8] c"text/html\00"
@.str.1 = [11 x i8] c"text/plain\00"
@.str.2 = [4 x i8] c"txt\00"
@.str.3 = [2 x i8] c"c\00"
@.str.4 = [9 x i8] c"text/x-c\00"
@.str.5 = [4 x i8] c"css\00"
@.str.6 = [9 x i8] c"text/css\00"
@.str.7 = [3 x i8] c"js\00"
@.str.8 = [23 x i8] c"application/javascript\00"
@.str.9 = [5 x i8] c"html\00"
@.str.10 = [4 x i8] c"gif\00"
@.str.11 = [10 x i8] c"image/gif\00"
@.str.12 = [4 x i8] c"GIF\00"
@.str.13 = [5 x i8] c"jpeg\00"
@.str.14 = [11 x i8] c"image/jpeg\00"
@.str.15 = [5 x i8] c"JPEG\00"
@.str.16 = [4 x i8] c"JPG\00"
@.str.17 = [4 x i8] c"jpg\00"
@.str.18 = [4 x i8] c"bmp\00"
@.str.19 = [10 x i8] c"image/bmp\00"
define i8* @get_mime_type(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %40, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %40, label %8
8: ; preds = %4
%9 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %40, label %11
11: ; preds = %8
%12 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %40, label %14
14: ; preds = %11
%15 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %40, label %17
17: ; preds = %14
%18 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %40, label %20
20: ; preds = %17
%21 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %40, label %23
23: ; preds = %20
%24 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %40, label %26
26: ; preds = %23
%27 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %40, label %29
29: ; preds = %26
%30 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %40, label %32
32: ; preds = %29
%33 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %40, label %35
35: ; preds = %32
%36 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %40, label %38
38: ; preds = %35
%39 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
br label %40
40: ; preds = %38, %35, %32, %29, %26, %23, %20, %17, %14, %11, %8, %4, %1
%41 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), %8 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), %11 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), %14 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %17 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), %20 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), %23 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), %26 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), %29 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), %32 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), %35 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0), %38 ]
ret i8* %41
}