user: What is the c source code of the assembly code below?

```asm
<get_mime_type>:
  endbr64
  push   %rbp
  xor    %esi,%esi
  mov    %rdi,%rbp
  sub    $0x10,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  call   <read_mimefile@plt>
  test   %rax,%rax
  je     L1
L127:
  mov    (%rsp),%rax
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L49
  add    $0x10,%rsp
  pop    %rbp
  ret
  xchg   %ax,%ax
L1:
  mov    $0x2e,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L127
  mov    $0x2e,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  lea    0x1(%rax),%rdi
  call   <strdup@plt>
  lea    D113(%rip),%rsi
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L176
  mov    %rsp,%rdi
  lea    D119(%rip),%rsi
  call   <asprintf@plt>
L138:
  mov    %rbp,%rdi
  call   <free@plt>
  jmp    L127
  nopl   0x0(%rax,%rax,1)
L176:
  lea    D96(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L91
  lea    D91(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L40
  mov    %rsp,%rdi
  lea    D97(%rip),%rsi
  call   <asprintf@plt>
  jmp    L138
  nopl   0x0(%rax)
L91:
  mov    %rsp,%rdi
  lea    D150(%rip),%rsi
  call   <asprintf@plt>
  jmp    L138
  nopl   0x0(%rax)
L40:
  lea    D167(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L83
  lea    D142(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L83
  lea    D61(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L163
  mov    %rsp,%rdi
  lea    D38(%rip),%rsi
  call   <asprintf@plt>
  jmp    L138
  nopl   0x0(%rax,%rax,1)
L83:
  mov    %rsp,%rdi
  lea    D18(%rip),%rsi
  xor    %eax,%eax
  call   <asprintf@plt>
  jmp    L138
L163:
  lea    D177(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L96
  mov    %rsp,%rdi
  lea    D81(%rip),%rsi
  call   <asprintf@plt>
  jmp    L138
L96:
  lea    D108(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L159
  mov    %rsp,%rdi
  lea    D69(%rip),%rsi
  call   <asprintf@plt>
  jmp    L138
L159:
  mov    %rbp,%rdi
  lea    D105(%rip),%rsi
  call   <strcmp@plt>
  mov    %rsp,%rdi
  test   %rax,%rax
  jne    L126
  lea    D106(%rip),%rsi
  call   <asprintf@plt>
  jmp    L138
L49:
  call   <__stack_chk_fail@plt>
L126:
  lea    D156(%rip),%rdx
  lea    D77(%rip),%rsi
  xor    %eax,%eax
  call   <asprintf@plt>
  jmp    L138
```

tool_calls: name: extract_symbolic_data
arguments: label: D113
type_guessed: string
name: extract_symbolic_data
arguments: label: D119
type_guessed: string
name: extract_symbolic_data
arguments: label: D96
type_guessed: string
name: extract_symbolic_data
arguments: label: D91
type_guessed: string
name: extract_symbolic_data
arguments: label: D97
type_guessed: string
name: extract_symbolic_data
arguments: label: D150
type_guessed: string
name: extract_symbolic_data
arguments: label: D167
type_guessed: string
name: extract_symbolic_data
arguments: label: D142
type_guessed: string
name: extract_symbolic_data
arguments: label: D61
type_guessed: string
name: extract_symbolic_data
arguments: label: D38
type_guessed: string
name: extract_symbolic_data
arguments: label: D18
type_guessed: string
name: extract_symbolic_data
arguments: label: D177
type_guessed: string
name: extract_symbolic_data
arguments: label: D81
type_guessed: string
name: extract_symbolic_data
arguments: label: D108
type_guessed: string
name: extract_symbolic_data
arguments: label: D69
type_guessed: string
name: extract_symbolic_data
arguments: label: D105
type_guessed: string
name: extract_symbolic_data
arguments: label: D106
type_guessed: string
name: extract_symbolic_data
arguments: label: D156
type_guessed: string
name: extract_symbolic_data
arguments: label: D77
type_guessed: string

tool: D113: html

tool: D119: text/html

tool: D96: gif

tool: D91: png

tool: D97: image/png

tool: D150: image/gif

tool: D167: xml

tool: D142: xsl

tool: D61: css

tool: D38: text/css

tool: D18: application/xml

tool: D177: js

tool: D81: text/javascript

tool: D108: pdf

tool: D69: application/pdf

tool: D105: ogv

tool: D106: video/ogg

tool: D156: application/octet-stream

tool: D77: %s

assistant: ```c
char *get_mime_type(char *filename) {
  char *fileext;
  char *mimetype = NULL;
  if (read_mimefile(filename, mimetype))
    return mimetype;
  if (strrchr(filename, '.')) {
    fileext = strdup(strrchr(filename, '.') + 1);
    if (strcmp(fileext, "html") == 0) {
      asprintf(&mimetype, "text/html");
    } else if (strcmp(fileext, "gif") == 0) {
      asprintf(&mimetype, "image/gif");
    } else if (strcmp(fileext, "png") == 0) {
      asprintf(&mimetype, "image/png");
    } else if (strcmp(fileext, "xml") == 0) {
      asprintf(&mimetype, "application/xml");
    } else if (strcmp(fileext, "xsl") == 0) {
      asprintf(&mimetype, "application/xml");
    } else if (strcmp(fileext, "css") == 0) {
      asprintf(&mimetype, "text/css");
    } else if (strcmp(fileext, "js") == 0) {
      asprintf(&mimetype, "text/javascript");
    } else if (strcmp(fileext, "pdf") == 0) {
      asprintf(&mimetype, "application/pdf");
    } else if (strcmp(fileext, "ogv") == 0) {
      asprintf(&mimetype, "video/ogg");
    } else {
      asprintf(&mimetype, "%s", "application/octet-stream");
    }
    free(fileext);
  }
  return mimetype;
}
```