// File: /workspace/github_cpp_makefile_star2_O1/tylerkaraszewski[P]Argyle/FilenameResolver.cpp
// Function: FilenameResolver::getContentType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string FilenameResolver::getContentType(const string& filename)
{
  string contentType = "text/plain";
  size_t offset = filename.find_last_of('.');
  string ext = filename.substr(offset + 1);
  HttpRequest::toLower(ext);
  if (ext == "html")
    contentType = "text/html";
  else if (ext == "gz")
    contentType = "application/x-compressed";
  else if (ext == "avi")
    contentType = "video/avi";
  else if (ext == "mp4")
    contentType = "video/mp4";
  else if (ext == "zip")
    contentType = "application/zip";
  else if (ext == "js")
    contentType = "application/x-javascript";
  else if (ext == "css")
    contentType = "text/css";
  else if (ext == "png")
    contentType = "image/png";
  else if (ext == "jpg")
    contentType = "image/jpeg";
  else if (ext == "xml")
    contentType = "application/xml";
  else if (ext == "pdf")
    contentType = "application/pdf";
  else if (ext == "ico")
    contentType = "image/png"; // hack for favicons.

  return contentType;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
leaq 0x317c(%rip), %rsi      # 0xc319
leaq 0x317f(%rip), %rdx      # 0xc323
callq 0x513e
movq %r14, %rdi
movl $0x2e, %esi
movq $-0x1, %rdx
callq 0x3590
leaq 0x1(%rax), %rdx
movq %rsp, %rdi
movq %r14, %rsi
movq $-0x1, %rcx
callq 0x32b0
movq %rsp, %rdi
callq 0x7554
leaq 0x3132(%rip), %rsi      # 0xc314
movq %rsp, %rdi
callq 0x30d0
movl $0x9, %r14d
testl %eax, %eax
je 0x92fd
leaq 0x312f(%rip), %rsi      # 0xc32e
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
je 0x9306
leaq 0x313a(%rip), %rsi      # 0xc350
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
je 0x9315
leaq 0x312d(%rip), %rsi      # 0xc35a
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
je 0x931e
leaq 0x3126(%rip), %rsi      # 0xc36a
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
je 0x9327
leaq 0x3113(%rip), %rsi      # 0xc36e
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
je 0x936d
leaq 0x311d(%rip), %rsi      # 0xc38f
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
je 0x9376
leaq 0x3110(%rip), %rsi      # 0xc399
movq %rsp, %rdi
callq 0x30d0
leaq 0x30fb(%rip), %r14      # 0xc393
testl %eax, %eax
je 0x9398
leaq 0x30f6(%rip), %rsi      # 0xc39d
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
je 0x937f
leaq 0x303f(%rip), %rsi      # 0xc2fd
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
je 0x9388
leaq 0x30f3(%rip), %rsi      # 0xc3c8
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
je 0x9391
leaq 0x30e0(%rip), %rsi      # 0xc3cc
movq %rsp, %rdi
callq 0x30d0
testl %eax, %eax
jne 0x9345
jmp 0x9398
leaq 0x3020(%rip), %rcx      # 0xc324
jmp 0x9334
movl $0x18, %r14d
leaq 0x301e(%rip), %rcx      # 0xc331
jmp 0x9334
leaq 0x302e(%rip), %rcx      # 0xc34a
jmp 0x9334
leaq 0x302f(%rip), %rcx      # 0xc354
jmp 0x9334
movl $0xf, %r14d
leaq 0x302a(%rip), %rcx      # 0xc35e
movq 0x8(%rbx), %rdx
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %r8
callq 0x3440
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9360
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x2ffd(%rip), %r14      # 0xc371
jmp 0x9398
leaq 0x300d(%rip), %r14      # 0xc38a
jmp 0x9398
leaq 0x301b(%rip), %r14      # 0xc3a1
jmp 0x9398
leaq 0x301d(%rip), %r14      # 0xc3ac
jmp 0x9398
leaq 0x3024(%rip), %r14      # 0xc3bc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3390
jmp 0x9345
movq %rax, %r14
jmp 0x93c8
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x93c8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x3290
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x93db
movq (%r15), %rsi
incq %rsi
callq 0x3290
movq %r14, %rdi
callq 0x3520