user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<UTIL_createFileList>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  mov    %rdi,%rbx
  mov    $0x2000,%edi
  sub    $0x38,%rsp
  mov    %rdx,(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  test   %rax,%rax
  je     L116
  movq   $0x0,0x10(%rsp)
  test   %ebp,%ebp
  je     L39
  lea    -0x1(%rbp),%eax
  mov    $0x2000,%r15d
  lea    0x20(%rsp),%r13
  xor    %ebp,%ebp
  lea    0x8(%rbx,%rax,8),%r12
  jmp    L62
L133:
  mov    (%rbx),%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%edx
  mov    0x10(%rsp),%rax
  movslq %edx,%r14
  add    %r14,%rax
  cmp    %r15,%rax
  jae    L104
L33:
  xor    %edi,%edi
  cmp    %rax,%r15
  seta   %dil
  add    $0x8,%rbx
  add    $0x1,%ebp
  call   <assert@plt>
  mov    -0x8(%rbx),%rsi
  mov    0x10(%rsp),%rdi
  mov    %r14,%rdx
  add    0x18(%rsp),%rdi
  call   <memcpy@plt>
  add    %r14,0x10(%rsp)
  cmp    %rbx,%r12
  je     L17
L62:
  mov    (%rbx),%rdi
  call   <UTIL_isDirectory@plt>
  test   %eax,%eax
  je     L133
  mov    0x18(%rsp),%rcx
  mov    (%rbx),%rdi
  lea    0x10(%rsp),%rdx
  lea    0x18(%rsp),%rsi
  add    %r15,%rcx
  mov    %rcx,0x20(%rsp)
  mov    %r13,%rcx
  call   <UTIL_prepareFileList@plt>
  mov    0x18(%rsp),%r14
  add    %eax,%ebp
  test   %r14,%r14
  je     L61
  xor    %edi,%edi
  cmp    0x20(%rsp),%r14
  setb   %dil
  add    $0x8,%rbx
  call   <assert@plt>
  mov    0x20(%rsp),%rcx
  sub    0x18(%rsp),%rcx
  mov    %rcx,%r15
  cmp    %rbx,%r12
  jne    L62
L17:
  test   %ebp,%ebp
  je     L131
  mov    %ebp,%ebx
  lea    0x8(,%rbx,8),%rdi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L143
  movq   $0x0,0x10(%rsp)
  mov    %rax,%r12
  lea    (%rax,%rbx,8),%rbx
  xor    %edi,%edi
  nopl   (%rax)
L121:
  add    0x18(%rsp),%rdi
  add    $0x8,%r12
  mov    %rdi,-0x8(%r12)
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  movslq %edi,%rdi
  add    0x10(%rsp),%rdi
  mov    %rdi,0x10(%rsp)
  cmp    %r12,%rbx
  jne    L121
  mov    0x18(%rsp),%r9
  cmp    %r15,%rdi
  ja     L154
  mov    (%rsp),%rax
  mov    %r9,(%rax)
  mov    0x8(%rsp),%rax
  mov    %ebp,(%rax)
L61:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L167
  add    $0x38,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L104:
  add    $0x2000,%r15
  cmp    %r15,%rax
  jae    L104
  mov    0x18(%rsp),%rdi
  mov    %r15,%rsi
  call   <UTIL_realloc@plt>
  mov    %rax,0x18(%rsp)
  test   %rax,%rax
  je     L116
  mov    0x10(%rsp),%rax
  add    %r14,%rax
  jmp    L33
L131:
  mov    0x18(%rsp),%rax
L39:
  mov    %rax,%rdi
  call   <free@plt>
L116:
  xor    %r14d,%r14d
  jmp    L61
L143:
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  jmp    L61
L154:
  mov    %r9,%rdi
  call   <free@plt>
  mov    %r14,%rdi
  xor    %r14d,%r14d
  call   <free@plt>
  jmp    L61
L167:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
__attribute__((unused)) const char **UTIL_createFileList(const char **inputNames, unsigned inputNamesNb, char **allocatedBuffer, unsigned *allocatedNamesNb) {
  size_t pos;
  unsigned i, nbFiles;
  char *buf = (char *)malloc((8 * 1024));
  size_t bufSize = (8 * 1024);
  const char **fileTable;
  if (!buf)
    return NULL;
  for (i = 0, pos = 0, nbFiles = 0; i < inputNamesNb; i++) {
    if (!UTIL_isDirectory(inputNames[i])) {
      size_t const len = strlen(inputNames[i]) + 1;
      if (pos + len >= bufSize) {
        while (pos + len >= bufSize)
          bufSize += (8 * 1024);
        buf = (char *)UTIL_realloc(buf, bufSize);
        if (!buf)
          return NULL;
      }
      assert(pos + len < bufSize);
      memcpy(buf + pos, inputNames[i], len);
      pos += len;
      nbFiles++;
    } else {
      char *bufend = buf + bufSize;
      nbFiles += (unsigned)UTIL_prepareFileList(inputNames[i], &buf, &pos, &bufend);
      if (buf == NULL)
        return NULL;
      assert(bufend > buf);
      bufSize = (size_t)(bufend - buf);
    }
  }
  if (nbFiles == 0) {
    free(buf);
    return NULL;
  }
  fileTable = (const char **)malloc(((size_t)nbFiles + 1) * sizeof(const char *));
  if (!fileTable) {
    free(buf);
    return NULL;
  }
  for (i = 0, pos = 0; i < nbFiles; i++) {
    fileTable[i] = buf + pos;
    pos += strlen(fileTable[i]) + 1;
  }
  if (pos > bufSize) {
    free(buf);
    free((void *)fileTable);
    return NULL;
  }
  *allocatedBuffer = buf;
  *allocatedNamesNb = nbFiles;
  return fileTable;
}
```