user: Please show me the C implementation that matches the assembly code listed below:

```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     L87
  cmp    $0x76,%al
  je     L62
  cmp    $0x61,%al
  je     L154
L102:
  lea    D364(%rip),%rsi
L205:
  add    $0x8,%rsp
  mov    %r12,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1080 <strcpy@plt>
  nopw   0x0(%rax,%rax,1)
L87:
  add    $0x6,%rbp
  lea    D378(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D117(%rip),%rsi
  test   %eax,%eax
  je     L205
  lea    D255(%rip),%r13
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L102
L231:
  mov    %r13,%rsi
  jmp    L205
  nopl   0x0(%rax)
L154:
  lea    0x6(%rdi),%r13
  lea    D231(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  lea    D16(%rip),%rsi
  test   %eax,%eax
  je     L205
  lea    D153(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  lea    D129(%rip),%rsi
  test   %eax,%eax
  je     L205
  lea    D316(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  lea    D71(%rip),%rsi
  test   %eax,%eax
  je     L205
  lea    D39(%rip),%rsi
  mov    %r13,%rdi
  lea    D7(%rip),%r14
  call   <strcmp@plt>
  test   %eax,%eax
  je     L6
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L6
  lea    D201(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  lea    D11(%rip),%rsi
  test   %eax,%eax
  je     L205
  lea    D64(%rip),%rsi
  mov    $0x3,%edx
  mov    %r13,%rdi
  call   <strncmp@plt>
  lea    D224(%rip),%rsi
  test   %eax,%eax
  je     L205
  lea    D268(%rip),%rsi
  mov    %r13,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L195
  lea    D351(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D363(%rip),%rsi
  test   %eax,%eax
  je     L205
  jmp    L102
  xchg   %ax,%ax
L62:
  add    $0x6,%rbp
  lea    D174(%rip),%r13
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L231
  lea    D220(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L231
  lea    D152(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L231
  lea    D231(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L45
  lea    D153(%rip),%r13
  mov    %rbp,%rdi
  mov    %r13,%rsi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L231
  lea    D105(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D354(%rip),%rsi
  test   %eax,%eax
  je     L205
  lea    D89(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L289
  lea    D265(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L289
  lea    D80(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D183(%rip),%rsi
  test   %eax,%eax
  je     L205
  lea    D28(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L45
  lea    D375(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D382(%rip),%rsi
  test   %eax,%eax
  je     L205
  lea    D268(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L195
  lea    D30(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  lea    D240(%rip),%rsi
  test   %eax,%eax
  je     L205
  jmp    L102
  xchg   %ax,%ax
L6:
  mov    %r14,%rsi
  jmp    L205
  nopl   0x0(%rax,%rax,1)
L45:
  lea    D204(%rip),%rsi
  jmp    L205
  nopl   0x0(%rax)
L289:
  lea    D23(%rip),%rsi
  jmp    L205
L195:
  lea    D138(%rip),%rsi
  jmp    L205
```

tool_calls: name: read_data
arguments: label: D364
type_guessed: string
name: read_data
arguments: label: D378
type_guessed: string
name: read_data
arguments: label: D117
type_guessed: string
name: read_data
arguments: label: D255
type_guessed: string
name: read_data
arguments: label: D231
type_guessed: string
name: read_data
arguments: label: D16
type_guessed: string
name: read_data
arguments: label: D153
type_guessed: string
name: read_data
arguments: label: D129
type_guessed: string
name: read_data
arguments: label: D316
type_guessed: string
name: read_data
arguments: label: D71
type_guessed: string
name: read_data
arguments: label: D39
type_guessed: string
name: read_data
arguments: label: D7
type_guessed: string
name: read_data
arguments: label: D201
type_guessed: string
name: read_data
arguments: label: D11
type_guessed: string
name: read_data
arguments: label: D64
type_guessed: string
name: read_data
arguments: label: D224
type_guessed: string
name: read_data
arguments: label: D268
type_guessed: string
name: read_data
arguments: label: D351
type_guessed: string
name: read_data
arguments: label: D363
type_guessed: string
name: read_data
arguments: label: D174
type_guessed: string
name: read_data
arguments: label: D220
type_guessed: string
name: read_data
arguments: label: D152
type_guessed: string
name: read_data
arguments: label: D105
type_guessed: string
name: read_data
arguments: label: D354
type_guessed: string
name: read_data
arguments: label: D89
type_guessed: string
name: read_data
arguments: label: D265
type_guessed: string
name: read_data
arguments: label: D80
type_guessed: string
name: read_data
arguments: label: D183
type_guessed: string
name: read_data
arguments: label: D28
type_guessed: string
name: read_data
arguments: label: D375
type_guessed: string
name: read_data
arguments: label: D382
type_guessed: string
name: read_data
arguments: label: D30
type_guessed: string
name: read_data
arguments: label: D240
type_guessed: string
name: read_data
arguments: label: D204
type_guessed: string
name: read_data
arguments: label: D23
type_guessed: string
name: read_data
arguments: label: D138
type_guessed: string

tool: D364: dat

tool: D378: jpeg

tool: D117: jpg

tool: D255: png

tool: D231: mpeg

tool: D16: mp3

tool: D153: mp4

tool: D129: m4a

tool: D316: x-ms-wma

tool: D71: wma

tool: D39: x-flac

tool: D7: flac

tool: D201: x-wav

tool: D11: wav

tool: D64: L16

tool: D224: pcm

tool: D268: 3gpp

tool: D351: application/ogg

tool: D363: ogg

tool: D174: avi

tool: D220: divx

tool: D152: x-msvideo

tool: D105: x-ms-wmv

tool: D354: wmv

tool: D89: x-matroska

tool: D265: x-mkv

tool: D80: x-flv

tool: D183: flv

tool: D28: vnd.dlna.mpeg-tts

tool: D375: quicktime

tool: D382: mov

tool: D30: x-tivo-mpeg

tool: D240: TiVo

tool: D204: mpg

tool: D23: mkv

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