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

```asm
<mime_parse_content_disposition>:
  endbr64
  test   %rdi,%rdi
  je     L13
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  lea    D1(%rip),%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  nopl   0x0(%rax,%rax,1)
L159:
  cmpb   $0x0,(%r14)
  je     L149
  lea    0x1(%r14),%rbp
  jmp    L138
L60:
  add    $0x1,%rbp
L138:
  movsbl 0x0(%rbp),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L60
  cmpb   $0x0,0x0(%rbp)
  je     L149
  lea    0x1(%rbp),%r15
  mov    $0x3b,%esi
  mov    %r15,%rdi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L11
L69:
  mov    $0x3d,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L149
  mov    %eax,%esi
  mov    %rbp,%rdi
  sub    %ebp,%esi
  call   <strndupa@plt>
  mov    %r14,%rsi
  lea    0x1(%r15),%rdi
  sub    %r15,%rsi
  mov    %rax,%rbp
  sub    $0x1,%esi
  call   <strndupa@plt>
  mov    %rax,%r15
  mov    %rax,%rdi
  call   <rtrim@plt>
  cmpb   $0x22,(%r15)
  je     L62
L22:
  test   %rbx,%rbx
  je     L167
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L161
L167:
  test   %r14,%r14
  jne    L159
L149:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L161:
  mov    $0x2f,%esi
  mov    %r15,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L158
  mov    $0x2f,%esi
  mov    %r15,%rdi
  call   <strrchr@plt>
  mov    %r13,%rdx
  mov    %rbx,%rdi
  lea    0x1(%rax),%rsi
  call   <strncpy@plt>
L160:
  movb   $0x0,-0x1(%rbx,%r13,1)
  jmp    L167
  cs nopw 0x0(%rax,%rax,1)
L62:
  mov    %r15,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x22,-0x1(%r15,%rax,1)
  jne    L22
  mov    %r15,%rdi
  add    $0x1,%r15
  call   <strlen@plt>
  cltq
  movb   $0x0,-0x2(%r15,%rax,1)
  jmp    L22
  nop
L11:
  xor    %esi,%esi
  mov    %r15,%rdi
  call   <strchr@plt>
  mov    %rax,%r14
  jmp    L69
L158:
  mov    %r13,%rdx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <strncpy@plt>
  jmp    L160
L13:
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D1
type_infered: string

tool: D1: filename

assistant: ```c
void mime_parse_content_disposition(const char *arg, char *filename, size_t filename_size) {
  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 (filename && !strcasecmp(key, "filename")) {
      if (strchr(value, '/'))
        strncpy(filename, strrchr(value, '/') + 1, filename_size);
      else
        strncpy(filename, value, filename_size);
      filename[filename_size - 1] = 0;
    }
    arg = arg_end;
  }
}
```