user: 请将以下的汇编代码转换成C语言代码：

```asm
<XcursorScanTheme>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x20(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  je     L149
  cmpq   $0x0,-0x40(%rbp)
  jne    L123
L149:
  mov    $0x0,%eax
  jmp    L84
L123:
  mov    $0x0,%eax
  call   <XcursorLibraryPath@plt>
  mov    %rax,-0x28(%rbp)
  jmp    L114
L50:
  mov    -0x38(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <_XcursorBuildThemeDir@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L68
  mov    -0x40(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    D2(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <_XcursorBuildFullname@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L91
  mov    -0x8(%rbp),%rax
  lea    D26(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x30(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L91:
  cmpq   $0x0,-0x30(%rbp)
  jne    L169
  cmpq   $0x0,-0x20(%rbp)
  jne    L169
  mov    -0x10(%rbp),%rax
  lea    D37(%rip),%rdx
  lea    D7(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <_XcursorBuildFullname@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L169
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <_XcursorThemeInherits@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L169:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L68:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <_XcursorNextPath@plt>
  mov    %rax,-0x28(%rbp)
L114:
  cmpq   $0x0,-0x28(%rbp)
  je     L79
  cmpq   $0x0,-0x30(%rbp)
  je     L50
L79:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L111
L138:
  mov    -0x38(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L167
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <XcursorScanTheme>
  mov    %rax,-0x30(%rbp)
  jmp    L104
L167:
  mov    -0x40(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D44(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L104:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <_XcursorNextPath@plt>
  mov    %rax,-0x18(%rbp)
L111:
  cmpq   $0x0,-0x18(%rbp)
  je     L120
  cmpq   $0x0,-0x30(%rbp)
  je     L138
L120:
  cmpq   $0x0,-0x20(%rbp)
  je     L162
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L162:
  mov    -0x30(%rbp),%rax
L84:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D2
type: string
name: disassemble_data
arguments: label: D26
type: string
name: disassemble_data
arguments: label: D37
type: string
name: disassemble_data
arguments: label: D7
type: string
name: disassemble_data
arguments: label: D44
type: string

tool: D2: cursors

tool: D26: r

tool: D37: index.theme

tool: 

tool: D44: Not calling XcursorScanTheme because of circular dependency: %s. %s

assistant: ```c
FILE *XcursorScanTheme(const char *theme, const char *name) {
  FILE *f = NULL;
  char *full;
  char *dir;
  const char *path;
  char *inherits = NULL;
  const char *i;
  if (!theme || !name)
    return NULL;
  for (path = XcursorLibraryPath(); path && f == NULL; path = _XcursorNextPath(path)) {
    dir = _XcursorBuildThemeDir(path, theme);
    if (dir) {
      full = _XcursorBuildFullname(dir, "cursors", name);
      if (full) {
        f = fopen(full, "r");
        free(full);
      }
      if (!f && !inherits) {
        full = _XcursorBuildFullname(dir, "", "index.theme");
        if (full) {
          inherits = _XcursorThemeInherits(full);
          free(full);
        }
      }
      free(dir);
    }
  }
  for (i = inherits; i && f == NULL; i = _XcursorNextPath(i)) {
    if (strcmp(i, theme) != 0)
      f = XcursorScanTheme(i, name);
    else
      printf("Not calling XcursorScanTheme because of circular dependency: %s. %s", i, name);
  }
  if (inherits != NULL)
    free(inherits);
  return f;
}
```