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

```asm
<parsename>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8d,-0x34(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x20(%rbp),%rax
  lea    D6(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L45
  mov    $0x0,%eax
  jmp    L88
L45:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <skipspace@plt>
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  je     L6
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <event_error@plt>
  jmp    L81
L6:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <skipspace@plt>
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L125
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  addl   $0x1,-0x4(%rbp)
  jmp    L31
L44:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  addl   $0x1,-0x4(%rbp)
L31:
  mov    -0x4(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jge    L124
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L124
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L44
L124:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L9
L37:
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  addl   $0x1,-0x4(%rbp)
L125:
  mov    -0x4(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jge    L10
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L10
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L37
L10:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L9:
  mov    -0x28(%rbp),%rax
  movl   $0x1,(%rax)
L81:
  mov    $0x1,%eax
L88:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_label: D6
type: string
name: parse_data
arguments: data_label: D16
type: string

tool: D6: name

tool: D16: name must be followed by '='

assistant: ```c
int parsename(s, word, gotname, namestring, maxsize)
char **s;
char *word;
int *gotname;
char namestring[];
int maxsize;
{
  int i;
  i = 0;
  if (strcasecmp(word, "name") != 0)
    return 0;
  skipspace(s);
  if (**s != '=') {
    event_error("name must be followed by '='");
  } else {
    *s = *s + 1;
    skipspace(s);
    if (**s == '"') {
      namestring[i] = (char)**s;
      *s = *s + 1;
      i++;
      while (i < maxsize && **s != '"' && **s != '\0') {
        namestring[i] = (char)**s;
        *s = *s + 1;
        i++;
      }
      namestring[i] = (char)**s;
      i++;
      namestring[i] = '\0';
    } else {
      while (i < maxsize && **s != ' ' && **s != '\0') {
        namestring[i] = (char)**s;
        *s = *s + 1;
        i++;
      }
      namestring[i] = '\0';
    }
    *gotname = 1;
  }
  return 1;
}
```