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

```asm
<find_executable>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %rdi,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L198
  movzbl (%rdi),%eax
  test   %al,%al
  je     L131
  cmp    $0x2f,%al
  je     L188
L40:
  mov    %r13,%rdx
L85:
  cmp    $0x2f,%al
  je     L39
  add    $0x1,%rdx
  movzbl (%rdx),%eax
  test   %al,%al
  jne    L85
L216:
  lea    D6(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L39
  cmpb   $0x0,(%r12)
  jne    L62
L39:
  mov    %rsp,%rdi
  mov    $0x400,%esi
  call   <getcwd@plt>
  test   %rax,%rax
  je     L115
L165:
  mov    %rsp,%r14
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %eax,%ebx
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x2(%rbx,%rax,1),%edi
  call   <xmalloc@plt>
  mov    %rax,%r12
  mov    %rax,%rbp
  mov    %ebx,%edx
  mov    %r14,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movslq %ebx,%rbx
  movb   $0x2f,(%r12,%rbx,1)
  lea    0x1(%r12,%rbx,1),%rdi
  mov    %r13,%rsi
  call   <strcpy@plt>
  mov    %r12,%rdi
  call   <check_executable@plt>
  test   %rax,%rax
  jne    L222
  mov    $0x0,%ebp
  test   %r12,%r12
  jne    L220
L222:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L279
  mov    %rbp,%rax
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L188:
  call   <xstrdup@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <check_executable@plt>
  test   %rax,%rax
  jne    L222
  test   %rbp,%rbp
  je     L46
  mov    %rbp,%rdi
  call   <free@plt>
L46:
  movzbl 0x0(%r13),%eax
  test   %al,%al
  jne    L40
  jmp    L216
L174:
  mov    %rsp,%rdi
  mov    $0x400,%esi
  call   <getcwd@plt>
  test   %rax,%rax
  je     L219
L87:
  mov    %rsp,%r14
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %eax,%r12d
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x2(%r12,%rax,1),%edi
  call   <xmalloc@plt>
  mov    %rax,%rbp
  mov    %r12d,%edx
  mov    %r14,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movslq %r12d,%r12
  movb   $0x2f,0x0(%rbp,%r12,1)
  lea    0x1(%rbp,%r12,1),%rdi
  mov    %r13,%rsi
  call   <strcpy@plt>
  mov    %rbx,%r12
L272:
  mov    %rbp,%rdi
  call   <check_executable@plt>
  test   %rax,%rax
  jne    L222
  test   %rbp,%rbp
  je     L241
  mov    %rbp,%rdi
  call   <free@plt>
L241:
  cmpb   $0x0,(%r12)
  je     L39
L62:
  movzbl (%r12),%eax
  cmp    $0x3a,%al
  je     L49
  test   %al,%al
  je     L49
  mov    %r12,%rbx
L18:
  add    $0x1,%rbx
  movzbl (%rbx),%eax
  cmp    $0x3a,%al
  je     L306
  test   %al,%al
  jne    L18
L306:
  mov    %rbx,%r14
  sub    %r12,%r14
  mov    %r14,%r15
  test   %al,%al
  je     L14
L111:
  add    $0x1,%rbx
L14:
  test   %r15,%r15
  je     L174
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x2(%rax,%r14,1),%edi
  call   <xmalloc@plt>
  mov    %rax,%rbp
  mov    %r14d,%edx
  mov    %r12,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movb   $0x2f,0x0(%rbp,%r15,1)
  lea    0x1(%rbp,%r15,1),%rdi
  mov    %r13,%rsi
  call   <strcpy@plt>
  mov    %rbx,%r12
  jmp    L272
L219:
  lea    D26(%rip),%rdi
  call   <lt_fatal@plt>
  jmp    L87
L115:
  lea    D26(%rip),%rdi
  call   <lt_fatal@plt>
  jmp    L165
L220:
  mov    %r12,%rdi
  call   <free@plt>
  jmp    L222
L198:
  mov    %rdi,%rbp
  jmp    L222
L131:
  mov    $0x0,%ebp
  jmp    L222
L49:
  mov    %r12,%rbx
  test   %al,%al
  je     L174
  mov    %r12,%rbx
  mov    $0x0,%r15d
  mov    $0x0,%r14d
  jmp    L111
L279:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D6
datatype: string
name: retrieve_data
arguments: label: D26
datatype: string

tool: D6: PATH

tool: D26: getcwd failed

assistant: ```c
char *find_executable(const char *wrapper) {
  int has_slash = 0;
  const char *p;
  const char *p_next;
  char tmp[1024 + 1];
  int tmp_len;
  char *concat_name;

  ;
  if ((wrapper == NULL) || (*wrapper == '\0'))
    return NULL;
  if (((wrapper[0]) == '/')) {
    concat_name = xstrdup(wrapper);
    if (check_executable(concat_name))
      return concat_name;
    do {
      if (concat_name) {
        free((void *)concat_name);
        concat_name = 0;
      }
    } while (0);
  }
  for (p = wrapper; *p; p++)
    if (*p == '/') {
      has_slash = 1;
      break;
    }
  if (!has_slash) {
    const char *path = getenv("PATH");
    if (path != NULL) {
      for (p = path; *p; p = p_next) {
        const char *q;
        size_t p_len;
        for (q = p; *q; q++)
          if (((*q) == ':'))
            break;
        p_len = q - p;
        p_next = (*q == '\0' ? q : q + 1);
        if (p_len == 0) {
          if (getcwd(tmp, 1024) == NULL)
            lt_fatal("getcwd failed");
          tmp_len = strlen(tmp);
          concat_name = ((char *)xmalloc((tmp_len + 1 + strlen(wrapper) + 1) * sizeof(char)));
          memcpy(concat_name, tmp, tmp_len);
          concat_name[tmp_len] = '/';
          strcpy(concat_name + tmp_len + 1, wrapper);
        } else {
          concat_name = ((char *)xmalloc((p_len + 1 + strlen(wrapper) + 1) * sizeof(char)));
          memcpy(concat_name, p, p_len);
          concat_name[p_len] = '/';
          strcpy(concat_name + p_len + 1, wrapper);
        }
        if (check_executable(concat_name))
          return concat_name;
        do {
          if (concat_name) {
            free((void *)concat_name);
            concat_name = 0;
          }
        } while (0);
      }
    }
  }
  if (getcwd(tmp, 1024) == NULL)
    lt_fatal("getcwd failed");
  tmp_len = strlen(tmp);
  concat_name = ((char *)xmalloc((tmp_len + 1 + strlen(wrapper) + 1) * sizeof(char)));
  memcpy(concat_name, tmp, tmp_len);
  concat_name[tmp_len] = '/';
  strcpy(concat_name + tmp_len + 1, wrapper);
  if (check_executable(concat_name))
    return concat_name;
  do {
    if (concat_name) {
      free((void *)concat_name);
      concat_name = 0;
    }
  } while (0);
  return NULL;
}
```