// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_get_mime_type
static struct mg_str mg_get_mime_type(const char *path, const char *dflt,
                                      const struct mg_serve_http_opts *opts) {
  const char *ext, *overrides;
  size_t i, path_len;
  struct mg_str r, k, v;

  path_len = strlen(path);

  overrides = opts->custom_mime_types;
  while ((overrides = mg_next_comma_list_entry(overrides, &k, &v)) != NULL) {
    ext = path + (path_len - k.len);
    if (path_len > k.len && mg_vcasecmp(&k, ext) == 0) {
      return v;
    }
  }

  for (i = 0; mg_static_builtin_mime_types[i].extension != NULL; i++) {
    ext = path + (path_len - mg_static_builtin_mime_types[i].ext_len);
    if (path_len > mg_static_builtin_mime_types[i].ext_len && ext[-1] == '.' &&
        mg_casecmp(ext, mg_static_builtin_mime_types[i].extension) == 0) {
      r.p = mg_static_builtin_mime_types[i].mime_type;
      r.len = strlen(r.p);
      return r;
    }
  }

  r.p = dflt;
  r.len = strlen(r.p);
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3180
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0xa320
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x1bf01
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
subq -0x60(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x60(%rbp), %rax
jbe 0x1beff
movq -0x30(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x8b60
cmpl $0x0, %eax
jne 0x1beff
movq -0x78(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1bff8
jmp 0x1bea0
movq $0x0, -0x40(%rbp)
leaq 0xaa30(%rip), %rax      # 0x26940
imulq $0x18, -0x40(%rbp), %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x1bfd3
movq -0x18(%rbp), %rax
movq -0x48(%rbp), %rcx
leaq 0xaa0f(%rip), %rdx      # 0x26940
imulq $0x18, -0x40(%rbp), %rsi
addq %rsi, %rdx
subq 0x8(%rdx), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x48(%rbp), %rax
leaq 0xa9f1(%rip), %rcx      # 0x26940
imulq $0x18, -0x40(%rbp), %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jbe 0x1bfc0
movq -0x30(%rbp), %rax
movsbl -0x1(%rax), %eax
cmpl $0x2e, %eax
jne 0x1bfc0
movq -0x30(%rbp), %rdi
leaq 0xa9cb(%rip), %rax      # 0x26940
imulq $0x18, -0x40(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0xa0c0
cmpl $0x0, %eax
jne 0x1bfc0
leaq 0xa9af(%rip), %rax      # 0x26940
imulq $0x18, -0x40(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x3180
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1bff8
jmp 0x1bfc2
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1bf09
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x3180
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)