user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<find_executable>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L296
  movzbl (%rdi),%eax
  mov    %rdi,%r12
  test   %al,%al
  je     L296
  cmp    $0x2f,%al
  je     L25
L50:
  mov    %r12,%rdx
  jmp    L44
  nopl   0x0(%rax)
L232:
  movzbl 0x1(%rdx),%eax
  add    $0x1,%rdx
  test   %al,%al
  je     L250
L44:
  cmp    $0x2f,%al
  jne    L232
L64:
  mov    %rsp,%r15
  mov    $0x400,%esi
  mov    %r15,%rdi
  call   <getcwd@plt>
  test   %rax,%rax
  je     L86
L73:
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %r12,%rdi
  movslq %eax,%rbx
  call   <strlen@plt>
  lea    0x2(%rbx,%rax,1),%edi
  call   <xmalloc@plt>
  mov    %ebx,%edx
  mov    %r15,%rsi
  mov    %rax,%r14
  mov    %rax,%rdi
  call   <memcpy@plt>
  movb   $0x2f,(%r14,%rbx,1)
  lea    0x1(%r14,%rbx,1),%rdi
  mov    %r12,%rsi
  call   <strcpy@plt>
  mov    %r14,%rdi
  call   <check_executable@plt>
  test   %rax,%rax
  jne    L167
  test   %r14,%r14
  jne    L245
L296:
  xor    %r14d,%r14d
L167:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L268
  add    $0x418,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L25:
  call   <xstrdup@plt>
  mov    %rax,%rdi
  mov    %rax,%r14
  call   <check_executable@plt>
  test   %rax,%rax
  jne    L167
  test   %r14,%r14
  je     L14
  mov    %r14,%rdi
  call   <free@plt>
L14:
  movzbl (%r12),%eax
  test   %al,%al
  jne    L50
  nop
L250:
  lea    D10(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L64
  movzbl (%rax),%eax
  lea    D17(%rip),%r13
  test   %al,%al
  je     L64
  nopw   0x0(%rax,%rax,1)
L121:
  mov    %r15,%rbx
  jmp    L2
  nopl   (%rax)
L147:
  movzbl (%rbx),%eax
  test   %al,%al
  je     L249
L2:
  mov    %rbx,%rdx
  add    $0x1,%rbx
  cmp    $0x3a,%al
  jne    L147
  sub    %r15,%rdx
  mov    %rdx,%rbp
L11:
  test   %rbp,%rbp
  je     L273
L205:
  mov    %r12,%rdi
  call   <strlen@plt>
  lea    0x2(%rax,%rbp,1),%edi
  call   <xmalloc@plt>
  mov    %ebp,%edx
  mov    %r15,%rsi
  mov    %rax,%r14
  mov    %rax,%rdi
  call   <memcpy@plt>
  movb   $0x2f,(%r14,%rbp,1)
  lea    0x1(%r14,%rbp,1),%rdi
  mov    %r12,%rsi
  call   <strcpy@plt>
  mov    %r14,%rdi
  call   <check_executable@plt>
  test   %rax,%rax
  jne    L167
  test   %r14,%r14
  je     L300
  mov    %r14,%rdi
  call   <free@plt>
  movzbl (%rbx),%eax
  test   %al,%al
  je     L64
L194:
  mov    %rbx,%r15
  jmp    L121
  nopl   (%rax)
L273:
  mov    %rsp,%r15
  mov    $0x400,%esi
  mov    %r15,%rdi
  call   <getcwd@plt>
  test   %rax,%rax
  je     L203
L0:
  mov    %r15,%rdi
  call   <strlen@plt>
  movslq %eax,%rbp
  jmp    L205
  nopl   (%rax)
L249:
  mov    %rbx,%rbp
  sub    %r15,%rbp
  jmp    L11
  nopl   0x0(%rax,%rax,1)
L300:
  movzbl (%rbx),%eax
  test   %al,%al
  jne    L194
  jmp    L64
L245:
  mov    %r14,%rdi
  xor    %r14d,%r14d
  call   <free@plt>
  jmp    L167
L86:
  lea    D17(%rip),%rdi
  call   <lt_fatal@plt>
  jmp    L73
L203:
  mov    %r13,%rdi
  call   <lt_fatal@plt>
  jmp    L0
L268:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D10
datatype: string
name: disassemble_data
arguments: data_tag: D17
datatype: string

tool: D10: PATH

tool: D17: 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;
}
```