user: What is the c source code of the assembly code below:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%edi
  jne    L82
  mov    0x8(%rbx),%rdi
  lea    0x4(%rsp),%rsi
  call   <lstat@plt>
  test   %rax,%rax
  js     L124
  mov    0x4(%rsp),%edi
  call   <S_ISDIR@plt>
  test   %rax,%rax
  je     L126
  mov    0x8(%rbx),%rdi
  call   <opendir@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L49
  lea    D9(%rip),%r12
  lea    D66(%rip),%r13
  lea    D58(%rip),%r14
  nopl   0x0(%rax)
L15:
  mov    %rbp,%rdi
  call   <readdir@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L48
  mov    (%rbx),%rdi
  mov    %r12,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L15
  mov    (%rbx),%rdi
  mov    %r13,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L15
  mov    (%rbx),%rdi
  mov    %r14,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L15
  mov    (%rbx),%rdi
  lea    D99(%rip),%rsi
  call   <strstr@plt>
  cmp    (%rbx),%rax
  jne    L15
  lea    D94(%rip),%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    (%rbx),%rbx
  mov    %rax,%r15
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    -0x4(%rbx,%rax,1),%rax
  cmp    %rax,%r15
  jne    L15
  mov    %rbx,%rsi
  lea    D6(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L15
  nopl   (%rax)
L48:
  mov    %rbp,%rdi
  call   <closedir@plt>
  test   %rax,%rax
  js     L172
  xor    %eax,%eax
L144:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L179
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L82:
  mov    (%rsi),%rsi
  lea    D52(%rip),%rdi
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L144
L126:
  mov    0x8(%rbx),%rsi
  lea    D69(%rip),%rdi
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L144
L124:
  mov    0x8(%rbx),%rsi
  lea    D82(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  or     $0xffffffff,%eax
  jmp    L144
L172:
  lea    D85(%rip),%rdi
  call   <puts@plt>
  or     $0xffffffff,%eax
  jmp    L144
L49:
  lea    D56(%rip),%rdi
  call   <puts@plt>
  or     $0xffffffff,%eax
  jmp    L144
L179:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D9
type: string
name: retrieve_data
arguments: data_label: D66
type: string
name: retrieve_data
arguments: data_label: D58
type: string
name: retrieve_data
arguments: data_label: D99
type: string
name: retrieve_data
arguments: data_label: D94
type: string
name: retrieve_data
arguments: data_label: D6
type: string
name: retrieve_data
arguments: data_label: D52
type: string
name: retrieve_data
arguments: data_label: D69
type: string
name: retrieve_data
arguments: data_label: D82
type: string
name: retrieve_data
arguments: data_label: D85
type: string
name: retrieve_data
arguments: data_label: D56
type: string

tool: D9: .

tool: D66: ..

tool: D58: server_config.xml

tool: D99: server_

tool: D94: .xml

tool: D6: %s


tool: D52: Usage: %s <path to xml files>


tool: D69: %s not a directory


tool: D82: Unable to stat %s


tool: D85: Unable to close directory

tool: D56: Unable to read directory

assistant: ```c
int main(int argc, char **argv) {
  struct stat statbuf;
  struct dirent *dirp;
  DIR *dp;
  int len;
  if (argc != 2) {
    printf("Usage: %s <path to xml files>\n", argv[0]);
    return -1;
  }
  if (lstat(argv[1], &statbuf) < 0) {
    printf("Unable to stat %s\n", argv[1]);
    return -1;
  }
  if (S_ISDIR(statbuf.st_mode) == 0) {
    printf("%s not a directory\n", argv[1]);
    return -1;
  }
  if ((dp = opendir(argv[1])) == NULL) {
    printf("Unable to read directory\n");
    return -1;
  }
  while ((dirp = readdir(dp)) != NULL) {
    if (strcmp(dirp->d_name, ".") == 0 || strcmp(dirp->d_name, "..") == 0 || strcmp(dirp->d_name, "server_config.xml") == 0 || strstr(dirp->d_name, "server_") != dirp->d_name)
      continue;
    if (strstr(dirp->d_name, ".xml") != dirp->d_name + strlen(dirp->d_name) - strlen(".xml"))
      continue;
    printf("%s\n", dirp->d_name);
  }
  if (closedir(dp) < 0) {
    printf("Unable to close directory\n");
    return -1;
  }
  return 0;
}
```