user: Converte this assembly snippet into its equivalent C code:

```asm
<mime_parse_content_type>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %rsi,%rbp
  mov    $0x2f,%esi
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x28,%rsp
  mov    %rdx,0x18(%rsp)
  mov    0x78(%rsp),%r13
  mov    %r9,0x8(%rsp)
  mov    %rdi,0x10(%rsp)
  call   <strchr@plt>
  mov    0x10(%rsp),%r11
  mov    0x18(%rsp),%r10
  test   %rax,%rax
  je     L71
  mov    %rax,%rdx
  mov    %rax,%r15
  sub    %r11,%rdx
L80:
  cmp    %rdx,%r10
  lea    -0x1(%r10),%rax
  mov    %r11,%rsi
  mov    %rbp,%rdi
  cmovbe %rax,%rdx
  mov    %rdx,0x10(%rsp)
  call   <strncpy@plt>
  mov    0x10(%rsp),%rdx
  lea    0x1(%r15),%r8
  lea    D31(%rip),%rsi
  mov    %r8,%rdi
  mov    %r8,0x10(%rsp)
  movb   $0x0,0x0(%rbp,%rdx,1)
  call   <strspn@plt>
  mov    0x10(%rsp),%rsi
  mov    %rbx,%rdi
  mov    %rax,%rbp
  lea    -0x1(%r12),%rax
  cmp    %r12,%rbp
  cmovae %rax,%rbp
  mov    %rbp,%rdx
  call   <strncpy@plt>
  movb   $0x0,(%rbx,%rbp,1)
  mov    %r15,%rdi
  mov    $0x3b,%esi
  lea    D32(%rip),%r15
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L100
  nopl   (%rax)
L5:
  cmpb   $0x0,(%rbx)
  je     L100
  lea    0x1(%rbx),%rbp
  jmp    L58
  nopw   0x0(%rax,%rax,1)
L27:
  add    $0x1,%rbp
L58:
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L27
  cmpb   $0x0,0x0(%rbp)
  je     L100
  lea    0x1(%rbp),%r12
  mov    $0x3b,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L230
L95:
  mov    $0x3d,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L100
  mov    %eax,%esi
  mov    %rbp,%rdi
  sub    %ebp,%esi
  call   <strndupa@plt>
  mov    %rbx,%rsi
  lea    0x1(%r14),%rdi
  sub    %r14,%rsi
  mov    %rax,%r12
  sub    $0x1,%esi
  call   <strndupa@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <rtrim@plt>
  cmpb   $0x22,0x0(%rbp)
  je     L97
L18:
  test   %r13,%r13
  je     L199
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L48
L199:
  cmpq   $0x0,0x68(%rsp)
  je     L206
  lea    D2(%rip),%rsi
  mov    %r12,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L138
L206:
  lea    D38(%rip),%rsi
  mov    %r12,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L141
L187:
  test   %rbx,%rbx
  jne    L5
L100:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L48:
  mov    0x80(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strncpy@plt>
  mov    0x80(%rsp),%rax
  movb   $0x0,-0x1(%r13,%rax,1)
  jmp    L187
  nopl   0x0(%rax,%rax,1)
L97:
  mov    %rbp,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x22,-0x1(%rbp,%rax,1)
  jne    L18
  mov    %rbp,%rdi
  add    $0x1,%rbp
  call   <strlen@plt>
  cltq
  movb   $0x0,-0x2(%rbp,%rax,1)
  jmp    L18
  nopl   (%rax)
L141:
  mov    0x8(%rsp),%r14
  mov    0x60(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <strncpy@plt>
  mov    0x60(%rsp),%rcx
  movb   $0x0,-0x1(%r14,%rcx,1)
  jmp    L187
  nopl   (%rax)
L230:
  xor    %esi,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  jmp    L95
  nopw   0x0(%rax,%rax,1)
L138:
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L61
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  mov    0x70(%rsp),%rdx
  mov    0x68(%rsp),%rdi
  lea    0x1(%rax),%rsi
  call   <strncpy@plt>
L29:
  mov    0x68(%rsp),%rax
  mov    0x70(%rsp),%rcx
  movb   $0x0,-0x1(%rax,%rcx,1)
  jmp    L187
L61:
  mov    0x70(%rsp),%rdx
  mov    0x68(%rsp),%rdi
  mov    %rbp,%rsi
  call   <strncpy@plt>
  jmp    L29
L71:
  mov    %r11,%r15
  xor    %edx,%edx
  jmp    L80
```

tool_calls: name: extract_symbolic_data
arguments: tag: D31
type: string
name: extract_symbolic_data
arguments: tag: D32
type: string
name: extract_symbolic_data
arguments: tag: D2
type: string
name: extract_symbolic_data
arguments: tag: D38
type: string

tool: D31: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-

tool: D32: boundary

tool: D2: name

tool: D38: charset

assistant: ```c
void mime_parse_content_type(const char *cts, char *type, size_t type_size, char *subtype, size_t subtype_size, char *charset, size_t charset_size, char *filename, size_t filename_size, char *part_delimiter, size_t part_delimiter_size) {
  const char *type_delim = strchr(cts, '/');
  size_t type_len;
  if (!type_delim)
    type_delim = cts;
  type_len = type_delim - cts;
  if (type_len >= type_size)
    type_len = type_size - 1;
  strncpy(type, cts, type_len);
  type[type_len] = 0;
  size_t subtype_len = strspn(type_delim + 1, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-");
  if (subtype_len >= subtype_size)
    subtype_len = subtype_size - 1;
  strncpy(subtype, type_delim + 1, subtype_len);
  subtype[subtype_len] = 0;
  char *arg = strchr(type_delim, ';');
  while (arg && *arg) {
    char *arg_end;
    ++arg;
    while (isspace(*arg))
      ++arg;
    if (!*arg)
      break;
    arg_end = strchr(arg + 1, ';');
    if (!arg_end)
      arg_end = strchr(arg + 1, 0);
    char *arg_delim = strchr(arg, '=');
    if (!arg_delim)
      break;
    char *key = strndupa(arg, arg_delim - arg);
    char *value = strndupa(arg_delim + 1, arg_end - arg_delim - 1);
    rtrim(value);
    if (value[0] == '"' && value[strlen(value) - 1] == '"') {
      value[strlen(value) - 1] = 0;
      ++value;
    }
    if (part_delimiter && !strcasecmp(key, "boundary")) {
      strncpy(part_delimiter, value, part_delimiter_size);
      part_delimiter[part_delimiter_size - 1] = 0;
    } else if (filename && !strcasecmp(key, "name")) {
      if (strchr(value, '/'))
        strncpy(filename, strrchr(value, '/') + 1, filename_size);
      else
        strncpy(filename, value, filename_size);
      filename[filename_size - 1] = 0;
    } else if (!strcasecmp(key, "charset")) {
      strncpy(charset, value, charset_size);
      charset[charset_size - 1] = 0;
    }
    arg = arg_end;
  }
}
```