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

```asm
<_XcursorThemeInherits>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x40,%rsp
  mov    %rdi,-0x2038(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x2030(%rbp)
  cmpq   $0x0,-0x2038(%rbp)
  jne    L216
  mov    $0x0,%eax
  jmp    L296
L216:
  mov    -0x2038(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x2018(%rbp)
  cmpq   $0x0,-0x2018(%rbp)
  je     L4
  jmp    L190
L24:
  lea    -0x2010(%rbp),%rax
  mov    $0x8,%edx
  lea    D8(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L190
  lea    -0x2010(%rbp),%rax
  add    $0x8,%rax
  mov    %rax,-0x2028(%rbp)
  jmp    L303
L229:
  addq   $0x1,-0x2028(%rbp)
L303:
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L229
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3d,%al
  je     L27
  jmp    L190
L27:
  addq   $0x1,-0x2028(%rbp)
  jmp    L276
L33:
  addq   $0x1,-0x2028(%rbp)
L276:
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L33
  mov    -0x2028(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x1,%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x2030(%rbp)
  cmpq   $0x0,-0x2030(%rbp)
  je     L184
  mov    -0x2030(%rbp),%rax
  mov    %rax,-0x2020(%rbp)
  jmp    L34
L123:
  addq   $0x1,-0x2028(%rbp)
L259:
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3b,%al
  je     L123
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  je     L123
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L123
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L123
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L123
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L240
  mov    -0x2020(%rbp),%rax
  cmp    -0x2030(%rbp),%rax
  je     L85
  mov    -0x2020(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x2020(%rbp)
  movb   $0x3a,(%rax)
  jmp    L85
L146:
  mov    -0x2028(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x2028(%rbp)
  mov    -0x2020(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x2020(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L85:
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L34
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L34
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L34
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  je     L34
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3b,%al
  je     L34
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2c,%al
  jne    L146
L34:
  mov    -0x2028(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L259
  jmp    L166
L240:
  nop
L166:
  mov    -0x2020(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x2020(%rbp)
  movb   $0x0,(%rax)
  jmp    L184
L190:
  mov    -0x2018(%rbp),%rdx
  lea    -0x2010(%rbp),%rax
  mov    $0x2000,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L24
  jmp    L177
L184:
  nop
L177:
  mov    -0x2018(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
L4:
  mov    -0x2030(%rbp),%rax
L296:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L195
  call   <__stack_chk_fail@plt>
L195:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D3
type_infered: string
name: unpack_data
arguments: data_label: D8
type_infered: string

tool: D3: r

tool: D8: Inherits

assistant: ```c
char *_XcursorThemeInherits(const char *full) {
  char line[8192];
  char *result = NULL;
  FILE *f;
  if (!full)
    return NULL;
  f = fopen(full, "r");
  if (f) {
    while (fgets(line, sizeof(line), f)) {
      if (!strncmp(line, "Inherits", 8)) {
        char *l = line + 8;
        char *r;
        while (*l == ' ')
          l++;
        if (*l != '=')
          continue;
        l++;
        while (*l == ' ')
          l++;
        result = malloc(strlen(l) + 1);
        if (result) {
          r = result;
          while (*l) {
            while (((*l) == ';' || (*l) == ',') || ((*l) == ' ' || (*l) == '\t' || (*l) == '\n'))
              l++;
            if (!*l)
              break;
            if (r != result)
              *r++ = ':';
            while (*l && !((*l) == ' ' || (*l) == '\t' || (*l) == '\n') && !((*l) == ';' || (*l) == ','))
              *r++ = *l++;
          }
          *r++ = '\0';
        }
        break;
      }
    }
    fclose(f);
  }
  return result;
}
```