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

```asm
<fileexists>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x230,%rsp
  mov    %rdi,-0x228(%rbp)
  mov    %rsi,-0x230(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x218(%rbp)
  cmpq   $0x0,-0x230(%rbp)
  je     L32
  mov    -0x230(%rbp),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x218(%rbp)
L32:
  cmpq   $0x0,-0x218(%rbp)
  je     L16
  lea    -0x220(%rbp),%rdx
  mov    -0x218(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L16
  mov    -0x218(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  jmp    L52
L16:
  cmpq   $0x0,-0x228(%rbp)
  je     L76
  lea    -0x220(%rbp),%rdx
  mov    -0x228(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L101
  mov    -0x228(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  jmp    L52
L101:
  lea    -0x210(%rbp),%rax
  lea    D4(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x228(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x220(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L42
  lea    -0x210(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  jmp    L52
L42:
  cmpq   $0x0,-0x218(%rbp)
  je     L76
  mov    -0x218(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x218(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x21c(%rbp)
  mov    -0x21c(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x218(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L13
  mov    -0x21c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x218(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2f,(%rax)
  mov    -0x21c(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x218(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L13:
  mov    -0x228(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x220(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <stat@plt>
  test   %eax,%eax
  jne    L76
  lea    -0x210(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  jmp    L52
L76:
  mov    $0x0,%eax
L52:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L72
  call   <__stack_chk_fail@plt>
L72:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D4
datatype: string

tool: D4: /usr/share/mox/

assistant: ```c
char *fileexists(char *path, char *env) {
  struct stat sbuf;
  char str[512];
  char *c;
  c = NULL;
  if (env)
    c = getenv(env);
  if (c) {
    if (!stat(c, &sbuf))
      return strdup(c);
  }
  if (path) {
    if (!stat(path, &sbuf))
      return strdup(path);
    strcpy(str, "/usr/share/mox/");
    strcat(str, path);
    if (!stat(str, &sbuf))
      return strdup(str);
    if (c) {
      int i;
      strcpy(str, c);
      i = strlen(c);
      if (c[i - 1] != '/') {
        c[i] = '/';
        c[i + 1] = 0;
      }
      strcat(str, path);
      if (!stat(str, &sbuf))
        return strdup(str);
    }
  }
  return NULL;
}
```