#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 *name) {
  char *ext = strrchr(name, '.');
  if (!ext)
    return NULL;
  if (strcmp(ext, ".html") == 0 || strcmp(ext, ".htm") == 0)
    return "text/html";
  if (strcmp(ext, ".jpg") == 0 || strcmp(ext, ".jpeg") == 0)
    return "image/jpeg";
  if (strcmp(ext, ".gif") == 0)
    return "image/gif";
  if (strcmp(ext, ".png") == 0)
    return "image/png";
  if (strcmp(ext, ".css") == 0)
    return "text/css";
  if (strcmp(ext, ".au") == 0)
    return "audio/basic";
  if (strcmp(ext, ".wav") == 0)
    return "audio/wav";
  if (strcmp(ext, ".avi") == 0)
    return "video/x-msvideo";
  if (strcmp(ext, ".mpeg") == 0 || strcmp(ext, ".mpg") == 0)
    return "video/mpeg";
  if (strcmp(ext, ".mp3") == 0)
    return "audio/mpeg";
  return NULL;
}


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    1156 <get_mime_type+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     118a <get_mime_type+0x6a>
mov    -0x18(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    119a <get_mime_type+0x7a>
lea    0xe7a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xe70(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11ce <get_mime_type+0xae>
mov    -0x18(%rbp),%rdi
lea    0xe5b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11de <get_mime_type+0xbe>
lea    0xe4b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xe42(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1208 <get_mime_type+0xe8>
lea    0xe31(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xe27(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1232 <get_mime_type+0x112>
lea    0xe16(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xe0c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    125c <get_mime_type+0x13c>
lea    0xdfb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xdf0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1286 <get_mime_type+0x166>
lea    0xdde(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xdd6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12b0 <get_mime_type+0x190>
lea    0xdc5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xdbb(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    12da <get_mime_type+0x1ba>
lea    0xdaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xda6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     130e <get_mime_type+0x1ee>
mov    -0x18(%rbp),%rdi
lea    0xd92(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    131e <get_mime_type+0x1fe>
lea    0xd81(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
mov    -0x18(%rbp),%rdi
lea    0xd78(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1348 <get_mime_type+0x228>
lea    0xd67(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1350 <get_mime_type+0x230>
movq   $0x0,-0x8(%rbp)
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>
test   %rax,%rax
je     1289 <get_mime_type+0x169>
mov    %rax,%rbx
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
lea    0xebb(%rip),%r14
test   %rax,%rax
je     128c <get_mime_type+0x16c>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     128c <get_mime_type+0x16c>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xe99(%rip),%r14
test   %rax,%rax
je     128c <get_mime_type+0x16c>
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     128c <get_mime_type+0x16c>
lea    0xe7c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1297 <get_mime_type+0x177>
lea    0xe73(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12a0 <get_mime_type+0x180>
lea    0xe6a(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12a9 <get_mime_type+0x189>
lea    0xe60(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12b2 <get_mime_type+0x192>
lea    0xe58(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12bb <get_mime_type+0x19b>
lea    0xe4f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     12c4 <get_mime_type+0x1a4>
lea    0xe4c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
lea    0xe48(%rip),%r14
test   %rax,%rax
je     128c <get_mime_type+0x16c>
lea    0xe37(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     128c <get_mime_type+0x16c>
lea    0xe33(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %r14d,%r14d
test   %rax,%rax
lea    0xe23(%rip),%rax
cmove  %rax,%r14
jmp    128c <get_mime_type+0x16c>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xd92(%rip),%r14
jmp    128c <get_mime_type+0x16c>
lea    0xd98(%rip),%r14
jmp    128c <get_mime_type+0x16c>
lea    0xd9e(%rip),%r14
jmp    128c <get_mime_type+0x16c>
lea    0xda2(%rip),%r14
jmp    128c <get_mime_type+0x16c>
lea    0xdaa(%rip),%r14
jmp    128c <get_mime_type+0x16c>
lea    0xdb0(%rip),%r14
jmp    128c <get_mime_type+0x16c>

LLVM IR (-O0):
@.str = [6 x i8] c".html\00"
@.str.1 = [5 x i8] c".htm\00"
@.str.2 = [10 x i8] c"text/html\00"
@.str.3 = [5 x i8] c".jpg\00"
@.str.4 = [6 x i8] c".jpeg\00"
@.str.5 = [11 x i8] c"image/jpeg\00"
@.str.6 = [5 x i8] c".gif\00"
@.str.7 = [10 x i8] c"image/gif\00"
@.str.8 = [5 x i8] c".png\00"
@.str.9 = [10 x i8] c"image/png\00"
@.str.10 = [5 x i8] c".css\00"
@.str.11 = [9 x i8] c"text/css\00"
@.str.12 = [4 x i8] c".au\00"
@.str.13 = [12 x i8] c"audio/basic\00"
@.str.14 = [5 x i8] c".wav\00"
@.str.15 = [10 x i8] c"audio/wav\00"
@.str.16 = [5 x i8] c".avi\00"
@.str.17 = [16 x i8] c"video/x-msvideo\00"
@.str.18 = [6 x i8] c".mpeg\00"
@.str.19 = [5 x i8] c".mpg\00"
@.str.20 = [11 x i8] c"video/mpeg\00"
@.str.21 = [5 x i8] c".mp3\00"
@.str.22 = [11 x i8] c"audio/mpeg\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 ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %73
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8*, i8** %4
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14, %10
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %73
19: ; preds = %14
%20 = load i8*, i8** %4
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8*, i8** %4
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23, %19
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %73
28: ; preds = %23
%29 = load i8*, i8** %4
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %28
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8** %2
br label %73
33: ; preds = %28
%34 = load i8*, i8** %4
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %33
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i8** %2
br label %73
38: ; preds = %33
%39 = load i8*, i8** %4
%40 = call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %38
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8** %2
br label %73
43: ; preds = %38
%44 = load i8*, i8** %4
%45 = call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %43
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i8** %2
br label %73
48: ; preds = %43
%49 = load i8*, i8** %4
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %48
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8** %2
br label %73
53: ; preds = %48
%54 = load i8*, i8** %4
%55 = call i64 @strcmp(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %53
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i8** %2
br label %73
58: ; preds = %53
%59 = load i8*, i8** %4
%60 = call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %66, label %62
62: ; preds = %58
%63 = load i8*, i8** %4
%64 = call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %62, %58
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0), i8** %2
br label %73
67: ; preds = %62
%68 = load i8*, i8** %4
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %67
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.22, i64 0, i64 0), i8** %2
br label %73
72: ; preds = %67
store i8* null, i8** %2
br label %73
73: ; preds = %72, %71, %66, %57, %52, %47, %42, %37, %32, %27, %18, %9
%74 = load i8*, i8** %2
ret i8* %74
}

LLVM IR (-O2):
@.str = [6 x i8] c".html\00"
@.str.1 = [5 x i8] c".htm\00"
@.str.2 = [10 x i8] c"text/html\00"
@.str.3 = [5 x i8] c".jpg\00"
@.str.4 = [6 x i8] c".jpeg\00"
@.str.5 = [11 x i8] c"image/jpeg\00"
@.str.6 = [5 x i8] c".gif\00"
@.str.7 = [10 x i8] c"image/gif\00"
@.str.8 = [5 x i8] c".png\00"
@.str.9 = [10 x i8] c"image/png\00"
@.str.10 = [5 x i8] c".css\00"
@.str.11 = [9 x i8] c"text/css\00"
@.str.12 = [4 x i8] c".au\00"
@.str.13 = [12 x i8] c"audio/basic\00"
@.str.14 = [5 x i8] c".wav\00"
@.str.15 = [10 x i8] c"audio/wav\00"
@.str.16 = [5 x i8] c".avi\00"
@.str.17 = [16 x i8] c"video/x-msvideo\00"
@.str.18 = [6 x i8] c".mpeg\00"
@.str.19 = [5 x i8] c".mpg\00"
@.str.20 = [11 x i8] c"video/mpeg\00"
@.str.21 = [5 x i8] c".mp3\00"
@.str.22 = [11 x i8] c"audio/mpeg\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 %44, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %44, label %7
7: ; preds = %4
%8 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %44, label %10
10: ; preds = %7
%11 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %44, label %13
13: ; preds = %10
%14 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %44, label %16
16: ; preds = %13
%17 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %44, label %19
19: ; preds = %16
%20 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %44, label %22
22: ; preds = %19
%23 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %44, label %25
25: ; preds = %22
%26 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %44, label %28
28: ; preds = %25
%29 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %44, label %31
31: ; preds = %28
%32 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %44, label %34
34: ; preds = %31
%35 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %44, label %37
37: ; preds = %34
%38 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.19, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %44, label %40
40: ; preds = %37
%41 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
%43 = select i1 %42, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.22, i64 0, i64 0), i8* null
br label %44
44: ; preds = %40, %34, %37, %31, %28, %25, %22, %19, %16, %10, %13, %4, %7, %1
%45 = phi i8* [ null, %1 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %7 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %13 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %10 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), %16 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), %19 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), %22 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), %25 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), %28 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), %31 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0), %37 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0), %34 ], [ %43, %40 ]
ret i8* %45
}