user: 请从给定的汇编指令推导出C源代码：

```asm
<namesInDev>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  lea    D4(%rip),%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rbp,%rdi
  call   <opendir@plt>
  mov    %rax,%r13
  nopl   0x0(%rax)
L74:
  mov    %r13,%rdi
  mov    %r12d,%r14d
  add    $0x1,%r12d
  call   <readdir@plt>
  test   %rax,%rax
  jne    L74
  lea    0x0(,%r12,8),%edi
  call   <malloc@plt>
  mov    %r13,%rdi
  xor    %r13d,%r13d
  mov    %rax,%rbx
  mov    %rax,0x10(%rsp)
  movslq %r14d,%rax
  movq   $0x0,(%rbx,%rax,8)
  call   <closedir@plt>
  mov    %rbp,%rdi
  mov    %rbx,%rbp
  call   <opendir@plt>
  mov    %rax,%r15
  jmp    L26
  nop
L60:
  test   %rax,%rax
  je     L39
  mov    (%rdx),%rdi
  mov    %rdx,0x8(%rsp)
  add    $0x1,%r13d
  add    $0x8,%rbp
  call   <strlen@plt>
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    0x8(%rsp),%rdx
  mov    %rax,-0x8(%rbp)
  mov    %rax,%rdi
  mov    (%rdx),%rsi
  call   <strcpy@plt>
  mov    %rax,-0x8(%rbp)
L26:
  mov    %r15,%rdi
  call   <readdir@plt>
  mov    %rax,%rdx
  cmp    %r14d,%r13d
  jne    L60
L39:
  mov    %r15,%rdi
  lea    D3(%rip),%r13
  call   <closedir@plt>
  mov    0x10(%rsp),%rcx
  mov    %r14d,%eax
  lea    (%rcx,%rax,8),%rbp
  test   %r14d,%r14d
  jne    L10
  jmp    L66
  nop
L1:
  movl   $0x7665642f,(%rax)
  mov    $0x2f,%eax
  mov    %ax,0x4(%r14)
  mov    (%rbx),%rdi
  call   <strlen@plt>
  mov    (%rbx),%rsi
  mov    %r14,%rdi
  mov    %eax,%edx
L21:
  call   <strncat@plt>
  add    $0x8,%rbx
  mov    %rax,-0x8(%rbx)
  cmp    %rbx,%rbp
  je     L66
L10:
  mov    (%rbx),%rdi
  call   <strlen@plt>
  lea    0x6(%rax),%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  jne    L1
  mov    %r13,%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  mov    $0x2f,%edx
  movl   $0x7665642f,0x0
  mov    %dx,0x4
  mov    (%rbx),%rdi
  call   <strlen@plt>
  mov    (%rbx),%rsi
  xor    %edi,%edi
  mov    %eax,%edx
  jmp    L21
  nopl   (%rax)
L66:
  mov    0x18(%rsp),%rax
  mov    %r12d,(%rax)
  mov    0x10(%rsp),%rax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: parse_data
arguments: label: D4
type_infered: string
name: parse_data
arguments: label: D3
type_infered: string

tool: D4: /dev/

tool: D3: JNI: Ran out of memory!


assistant: ```c
char **namesInDev(int *siz) {
  DIR *dir;
  struct dirent *ent;
  int i = 0, size = 0;
  char **files = NULL;
  dir = opendir("/dev/");
  while ((ent = readdir(dir)) != NULL) {
    size++;
  }
  files = (char **)malloc((size + 1) * sizeof(char *));
  files[size++] = NULL;
  closedir(dir);
  dir = opendir("/dev/");
  while ((ent = readdir(dir)) != NULL) {
    if (i == (size - 1)) {
      break;
    }
    files[i] = (char *)malloc((strlen(ent->d_name) + 1) * sizeof(char));
    files[i] = strcpy(files[i], ent->d_name);
    i++;
  }
  closedir(dir);
  char *tmp = NULL;
  for (i = 0; i < (size - 1); i++) {
    tmp = (char *)malloc((strlen(files[i]) + 6) * sizeof(char));
    if (tmp == NULL) {
      printf("JNI: Ran out of memory!\n");
      exit(1);
    }
    tmp[0] = '/';
    tmp[1] = 'd';
    tmp[2] = 'e';
    tmp[3] = 'v';
    tmp[4] = '/';
    tmp[5] = '\0';
    files[i] = strncat(tmp, files[i], strlen(files[i]));
  }
  *siz = size;
  return files;
}
```