user: 请将以下的汇编代码转换成C语言代码:

```asm
<get_mime_type>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x18(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <read_mimefile@plt>
  test   %rax,%rax
  je     L70
  mov    -0x18(%rbp),%rax
  jmp    L96
L70:
  mov    -0x28(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L117
  mov    -0x28(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  add    $0x1,%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    D75(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L112
  lea    -0x18(%rbp),%rax
  lea    D101(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
  jmp    L30
L112:
  mov    -0x10(%rbp),%rax
  lea    D179(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L39
  lea    -0x18(%rbp),%rax
  lea    D59(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
  jmp    L30
L39:
  mov    -0x10(%rbp),%rax
  lea    D195(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L66
  lea    -0x18(%rbp),%rax
  lea    D50(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
  jmp    L30
L66:
  mov    -0x10(%rbp),%rax
  lea    D16(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L50
  lea    -0x18(%rbp),%rax
  lea    D181(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
  jmp    L30
L50:
  mov    -0x10(%rbp),%rax
  lea    D46(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L89
  lea    -0x18(%rbp),%rax
  lea    D181(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
  jmp    L30
L89:
  mov    -0x10(%rbp),%rax
  lea    D162(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L104
  lea    -0x18(%rbp),%rax
  lea    D141(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
  jmp    L30
L104:
  mov    -0x10(%rbp),%rax
  lea    D145(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L121
  lea    -0x18(%rbp),%rax
  lea    D159(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
  jmp    L30
L121:
  mov    -0x10(%rbp),%rax
  lea    D80(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L126
  lea    -0x18(%rbp),%rax
  lea    D111(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
  jmp    L30
L126:
  mov    -0x10(%rbp),%rax
  lea    D167(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L154
  lea    -0x18(%rbp),%rax
  lea    D184(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
  jmp    L30
L154:
  lea    -0x18(%rbp),%rax
  lea    D13(%rip),%rdx
  lea    D63(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <asprintf@plt>
L30:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L117:
  mov    -0x18(%rbp),%rax
L96:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L174
  call   <__stack_chk_fail@plt>
L174:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D75
type: string
name: read_data
arguments: data_tag: D101
type: string
name: read_data
arguments: data_tag: D179
type: string
name: read_data
arguments: data_tag: D59
type: string
name: read_data
arguments: data_tag: D195
type: string
name: read_data
arguments: data_tag: D50
type: string
name: read_data
arguments: data_tag: D16
type: string
name: read_data
arguments: data_tag: D181
type: string
name: read_data
arguments: data_tag: D46
type: string
name: read_data
arguments: data_tag: D162
type: string
name: read_data
arguments: data_tag: D141
type: string
name: read_data
arguments: data_tag: D145
type: string
name: read_data
arguments: data_tag: D159
type: string
name: read_data
arguments: data_tag: D80
type: string
name: read_data
arguments: data_tag: D111
type: string
name: read_data
arguments: data_tag: D167
type: string
name: read_data
arguments: data_tag: D184
type: string
name: read_data
arguments: data_tag: D13
type: string
name: read_data
arguments: data_tag: D63
type: string

tool: D75: html

tool: D101: text/html

tool: D179: gif

tool: D59: image/gif

tool: D195: png

tool: D50: image/png

tool: D16: xml

tool: D181: application/xml

tool: D46: xsl

tool: D162: css

tool: D141: text/css

tool: D145: js

tool: D159: text/javascript

tool: D80: pdf

tool: D111: application/pdf

tool: D167: ogv

tool: D184: video/ogg

tool: D13: application/octet-stream

tool: D63: %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;
}
```