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

```asm
<mime_to_ext>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  movzbl (%rdi),%eax
  cmp    $0x69,%al
  je     L102
  cmp    $0x76,%al
  je     L143
  cmp    $0x61,%al
  je     L140
L166:
  lea    D324(%rip),%rsi
L30:
  add    $0x8,%rsp
  mov    %r12,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1080 <strcpy@plt>
  nopw   0x0(%rax,%rax,1)
L102:
  add    $0x6,%rbp
  lea    D160(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D249(%rip),%rsi
  test   %eax,%eax
  je     L30
  lea    D196(%rip),%r13
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L166
L128:
  mov    %r13,%rsi
  jmp    L30
  nopl   0x0(%rax)
L140:
  lea    0x6(%rdi),%r13
  lea    D113(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  lea    D207(%rip),%rsi
  test   %eax,%eax
  je     L30
  lea    D26(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  lea    D170(%rip),%rsi
  test   %eax,%eax
  je     L30
  lea    D346(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  lea    D69(%rip),%rsi
  test   %eax,%eax
  je     L30
  lea    D21(%rip),%rsi
  mov    %r13,%rdi
  lea    D381(%rip),%r14
  call   <strcmp@plt>
  test   %eax,%eax
  je     L219
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L219
  lea    D342(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  lea    D206(%rip),%rsi
  test   %eax,%eax
  je     L30
  lea    D74(%rip),%rsi
  mov    $0x3,%edx
  mov    %r13,%rdi
  call   <strncmp@plt>
  lea    D47(%rip),%rsi
  test   %eax,%eax
  je     L30
  lea    D337(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L236
  lea    D378(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D59(%rip),%rsi
  test   %eax,%eax
  je     L30
  jmp    L166
  xchg   %ax,%ax
L143:
  add    $0x6,%rbp
  lea    D79(%rip),%r13
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L128
  lea    D361(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L128
  lea    D305(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L128
  lea    D113(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L99
  lea    D26(%rip),%r13
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L128
  lea    D247(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D202(%rip),%rsi
  test   %eax,%eax
  je     L30
  lea    D323(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L14
  lea    D151(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L14
  lea    D41(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D221(%rip),%rsi
  test   %eax,%eax
  je     L30
  lea    D158(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L99
  lea    D81(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D186(%rip),%rsi
  test   %eax,%eax
  je     L30
  lea    D337(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L236
  lea    D43(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D389(%rip),%rsi
  test   %eax,%eax
  je     L30
  jmp    L166
  xchg   %ax,%ax
L219:
  mov    %r14,%rsi
  jmp    L30
  nopl   0x0(%rax,%rax,1)
L99:
  lea    D184(%rip),%rsi
  jmp    L30
  nopl   0x0(%rax)
L14:
  lea    D22(%rip),%rsi
  jmp    L30
L236:
  lea    D271(%rip),%rsi
  jmp    L30
```

tool_calls: name: read_data
arguments: data_label: D324
data_type: string
name: read_data
arguments: data_label: D160
data_type: string
name: read_data
arguments: data_label: D249
data_type: string
name: read_data
arguments: data_label: D196
data_type: string
name: read_data
arguments: data_label: D113
data_type: string
name: read_data
arguments: data_label: D207
data_type: string
name: read_data
arguments: data_label: D26
data_type: string
name: read_data
arguments: data_label: D170
data_type: string
name: read_data
arguments: data_label: D346
data_type: string
name: read_data
arguments: data_label: D69
data_type: string
name: read_data
arguments: data_label: D21
data_type: string
name: read_data
arguments: data_label: D381
data_type: string
name: read_data
arguments: data_label: D342
data_type: string
name: read_data
arguments: data_label: D206
data_type: string
name: read_data
arguments: data_label: D74
data_type: string
name: read_data
arguments: data_label: D47
data_type: string
name: read_data
arguments: data_label: D337
data_type: string
name: read_data
arguments: data_label: D378
data_type: string
name: read_data
arguments: data_label: D59
data_type: string
name: read_data
arguments: data_label: D79
data_type: string
name: read_data
arguments: data_label: D361
data_type: string
name: read_data
arguments: data_label: D305
data_type: string
name: read_data
arguments: data_label: D247
data_type: string
name: read_data
arguments: data_label: D202
data_type: string
name: read_data
arguments: data_label: D323
data_type: string
name: read_data
arguments: data_label: D151
data_type: string
name: read_data
arguments: data_label: D41
data_type: string
name: read_data
arguments: data_label: D221
data_type: string
name: read_data
arguments: data_label: D158
data_type: string
name: read_data
arguments: data_label: D81
data_type: string
name: read_data
arguments: data_label: D186
data_type: string
name: read_data
arguments: data_label: D43
data_type: string
name: read_data
arguments: data_label: D389
data_type: string
name: read_data
arguments: data_label: D184
data_type: string
name: read_data
arguments: data_label: D22
data_type: string
name: read_data
arguments: data_label: D271
data_type: string

tool: D324: dat

tool: D160: jpeg

tool: D249: jpg

tool: D196: png

tool: D113: mpeg

tool: D207: mp3

tool: D26: mp4

tool: D170: m4a

tool: D346: x-ms-wma

tool: D69: wma

tool: D21: x-flac

tool: D381: flac

tool: D342: x-wav

tool: D206: wav

tool: D74: L16

tool: D47: pcm

tool: D337: 3gpp

tool: D378: application/ogg

tool: D59: ogg

tool: D79: avi

tool: D361: divx

tool: D305: x-msvideo

tool: D247: x-ms-wmv

tool: D202: wmv

tool: D323: x-matroska

tool: D151: x-mkv

tool: D41: x-flv

tool: D221: flv

tool: D158: vnd.dlna.mpeg-tts

tool: D81: quicktime

tool: D186: mov

tool: D43: x-tivo-mpeg

tool: D389: TiVo

tool: D184: mpg

tool: D22: mkv

tool: D271: 3gp

assistant: ```c
void mime_to_ext(const char *mime, char *buf) {
  switch (*mime) {
  case 'a':
    if (strcmp(mime + 6, "mpeg") == 0)
      strcpy(buf, "mp3");
    else if (strcmp(mime + 6, "mp4") == 0)
      strcpy(buf, "m4a");
    else if (strcmp(mime + 6, "x-ms-wma") == 0)
      strcpy(buf, "wma");
    else if (strcmp(mime + 6, "x-flac") == 0)
      strcpy(buf, "flac");
    else if (strcmp(mime + 6, "flac") == 0)
      strcpy(buf, "flac");
    else if (strcmp(mime + 6, "x-wav") == 0)
      strcpy(buf, "wav");
    else if (strncmp(mime + 6, "L16", 3) == 0)
      strcpy(buf, "pcm");
    else if (strcmp(mime + 6, "3gpp") == 0)
      strcpy(buf, "3gp");
    else if (strcmp(mime, "application/ogg") == 0)
      strcpy(buf, "ogg");
    else
      strcpy(buf, "dat");
    break;
  case 'v':
    if (strcmp(mime + 6, "avi") == 0)
      strcpy(buf, "avi");
    else if (strcmp(mime + 6, "divx") == 0)
      strcpy(buf, "avi");
    else if (strcmp(mime + 6, "x-msvideo") == 0)
      strcpy(buf, "avi");
    else if (strcmp(mime + 6, "mpeg") == 0)
      strcpy(buf, "mpg");
    else if (strcmp(mime + 6, "mp4") == 0)
      strcpy(buf, "mp4");
    else if (strcmp(mime + 6, "x-ms-wmv") == 0)
      strcpy(buf, "wmv");
    else if (strcmp(mime + 6, "x-matroska") == 0)
      strcpy(buf, "mkv");
    else if (strcmp(mime + 6, "x-mkv") == 0)
      strcpy(buf, "mkv");
    else if (strcmp(mime + 6, "x-flv") == 0)
      strcpy(buf, "flv");
    else if (strcmp(mime + 6, "vnd.dlna.mpeg-tts") == 0)
      strcpy(buf, "mpg");
    else if (strcmp(mime + 6, "quicktime") == 0)
      strcpy(buf, "mov");
    else if (strcmp(mime + 6, "3gpp") == 0)
      strcpy(buf, "3gp");
    else if (strcmp(mime + 6, "x-tivo-mpeg") == 0)
      strcpy(buf, "TiVo");
    else
      strcpy(buf, "dat");
    break;
  case 'i':
    if (strcmp(mime + 6, "jpeg") == 0)
      strcpy(buf, "jpg");
    else if (strcmp(mime + 6, "png") == 0)
      strcpy(buf, "png");
    else
      strcpy(buf, "dat");
    break;
  default:
    strcpy(buf, "dat");
    break;
  }
}
```