user: 请将以下的汇编代码转换成C语言代码：

```asm
<my_searchenv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %ecx,0x4(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movb   $0x0,(%rdx)
  cmpb   $0x2f,(%rdi)
  je     L95
  mov    %rsi,%rdi
  call   <getenv@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L92
  call   <strdup@plt>
  lea    D11(%rip),%rbx
  lea    D17(%rip),%r14
  mov    %rax,0x8(%rsp)
  mov    %rax,%rdi
  jmp    L59
  nopl   0x0(%rax)
L47:
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <strlen@plt>
  lea    0x2(%r13,%rax,1),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L2
  mov    %r15,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2f,-0x1(%r13,%rax,1)
  je     L22
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
L22:
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  lea    0x14(%rsp),%rsi
  mov    %r13,%rdi
  call   <stat@plt>
  test   %eax,%eax
  je     L25
  xor    %edi,%edi
L59:
  mov    %rbx,%rsi
  call   <strtok@plt>
  mov    %rax,%r15
  test   %rax,%rax
  jne    L47
L2:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  mov    0x8(%rsp),%rdi
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1100 <free@plt>
  nopw   0x0(%rax,%rax,1)
L25:
  mov    0x4(%rsp),%ebx
  mov    %r13,%rsi
  mov    %r12,%rdi
  lea    -0x1(%rbx),%edx
  movslq %ebx,%r13
  call   <strncpy@plt>
  movb   $0x0,-0x1(%r12,%r13,1)
  mov    0x8(%rsp),%rdi
  call   <free@plt>
L92:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L95:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  mov    0x4(%rsp),%edx
  add    $0x28,%rsp
  mov    %rdi,%rsi
  mov    %r12,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1110 <strncpy@plt>
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D11
data_type: string
name: parse_data
arguments: tag: D17
data_type: string

tool: D11: :

tool: D17: /

assistant: ```c
void my_searchenv(char *name, char *envname, char *hitfile, int hitlen) {
  char *env;
  char *envcopy;
  char *cp;
  char *p_envcopy;
  *hitfile = 0;
  if (name[0] == '/') {
    strncpy(hitfile, name, hitlen);
    return;
  }
  env = getenv(envname);
  if (env == NULL)
    return;
  envcopy = strdup(env);
  p_envcopy = envcopy;
  while ((cp = strtok(p_envcopy, ":")) != NULL) {
    p_envcopy = NULL;
    struct stat info;
    char *concat = malloc(strlen(cp) + strlen(name) + 2);
    if (concat == NULL) {
      free(envcopy);
      return;
    }
    strcpy(concat, cp);
    if (concat[strlen(concat) - 1] != '/')
      strcat(concat, "/");
    strcat(concat, name);
    if (!stat(concat, &info)) {
      strncpy(hitfile, concat, hitlen - 1);
      hitfile[hitlen - 1] = 0;
      free(envcopy);
      return;
    }
  }
  free(envcopy);
}
```