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

```asm
<hcfg_parse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movq   $0x0,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  movq   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  movq   $0x0,(%rax)
  jmp    L274
L211:
  addq   $0x1,-0x18(%rbp)
L274:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L150
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L211
L150:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L245
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  je     L245
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %rax,%rax
  jne    L249
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L249
  mov    $0x0,%eax
  jmp    L110
L249:
  mov    -0x20(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  jmp    L343
L278:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    -0x18(%rbp),%rdx
  mov    %al,(%rdx)
  addq   $0x1,-0x18(%rbp)
L343:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isalnum@plt>
  test   %rax,%rax
  jne    L278
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  je     L278
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  jmp    L275
L66:
  addq   $0x1,-0x18(%rbp)
L275:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L345
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L66
L345:
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  je     L156
  mov    $0x0,%eax
  jmp    L110
L90:
  addq   $0x1,-0x18(%rbp)
L156:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L151
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L90
  jmp    L151
L104:
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x0,(%rax)
L151:
  mov    -0x8(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jb     L104
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L184
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L184
  mov    -0x28(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  jmp    L227
L228:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x23,%al
  je     L60
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L250
  addq   $0x1,-0x18(%rbp)
L250:
  mov    -0x18(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x8(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L227:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L155
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L228
L155:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L134
  mov    -0x28(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,(%rax)
  jmp    L62
L245:
  nop
  jmp    L62
L184:
  nop
  jmp    L62
L60:
  nop
  jmp    L62
L134:
  nop
L62:
  mov    -0x18(%rbp),%rax
  lea    D8(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcspn@plt>
  cltq
  add    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L82
  addq   $0x1,-0x18(%rbp)
L82:
  cmpq   $0x0,-0x8(%rbp)
  je     L183
L310:
  mov    -0x8(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x8(%rbp)
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L310
L183:
  mov    -0x18(%rbp),%rax
L110:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D8
type_guessed: string

tool: D8: 


assistant: ```c
char *hcfg_parse(char *buf, char **key, char **val) {
  char *ptr = NULL;
  *key = NULL;
  *val = NULL;
  while (isspace(*buf) && *buf != '\n')
    ++buf;
  if (*buf == '\n' || *buf == '#')
    goto endline;
  if (!isalnum(*buf) && *buf != '_')
    return NULL;
  *key = buf;
  while (isalnum(*buf) || *buf == '_') {
    *buf = toupper(*buf);
    ++buf;
  }
  ptr = buf;
  while (isspace(*buf) && *buf != '\n')
    ++buf;
  if (*(buf++) != '=')
    return NULL;
  while (isspace(*buf) && *buf != '\n')
    ++buf;
  while (ptr < buf)
    *(ptr++) = '\0';
  if (*buf == '\n' || *buf == '\0')
    goto endline;
  *val = buf;
  while (*buf && *buf != '\n') {
    if (*buf == '#')
      goto endline;
    if (*buf == '\\')
      ++buf;
    *(ptr++) = *(buf++);
  }
  if (**val == '\\')
    ++(*val);
endline:
  buf += strcspn(buf, "\n");
  if (*buf == '\n')
    ++buf;
  if (ptr) {
    do
      *(ptr--) = '\0';
    while (isspace(*ptr));
  }
  return buf;
}
```