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

```asm
<find_test>:
  endbr64
  push   %r15
  lea    D28(%rip),%rcx
  push   %r14
  movq   %rcx,%xmm0
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  lea    D25(%rip),%rax
  mov    %rdx,0x28(%rsp)
  lea    0x40(%rsp),%r13
  mov    %rsi,0x30(%rsp)
  movq   %rax,%xmm1
  lea    D45(%rip),%rax
  mov    %rax,0x50(%rsp)
  lea    D22(%rip),%rax
  punpcklqdq %xmm1,%xmm0
  mov    %rax,0x20(%rsp)
  lea    0x58(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x20(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,(%rsp)
  movaps %xmm0,0x40(%rsp)
L49:
  mov    0x0(%r13),%r12
  mov    0x10(%rsp),%r14
  mov    %r13,0x8(%rsp)
L47:
  mov    (%r14),%r13
  test   %r13,%r13
  je     L43
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %eax,%r15d
  call   <strlen@plt>
  mov    %r12,%rdi
  add    %eax,%r15d
  call   <strlen@plt>
  mov    $0x40d,%edx
  lea    D58(%rip),%rsi
  lea    0x2(%r15,%rax,1),%ebx
  mov    %ebx,%edi
  call   <x_malloc@plt>
  mov    %r12,%r9
  mov    %rbp,%r8
  mov    %r13,%rcx
  mov    %rax,%r15
  mov    %rax,%rdi
  lea    D40(%rip),%rdx
  mov    %ebx,%esi
  call   <snprintf@plt>
  mov    %r15,%rdi
  call   <is_valid_test@plt>
  test   %rax,%rax
  jne    L59
  mov    %r15,%rdi
  call   <free@plt>
L43:
  add    $0x8,%r14
  cmp    (%rsp),%r14
  jne    L47
  mov    0x8(%rsp),%r13
  add    $0x8,%r13
  cmp    0x18(%rsp),%r13
  jne    L49
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x68,%rsp
  mov    %rbp,%rdi
  mov    $0x416,%edx
  pop    %rbx
  lea    D58(%rip),%rsi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1110 <x_strdup@plt>
  cs nopw 0x0(%rax,%rax,1)
L59:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L7
  add    $0x68,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L7:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D28
type: string
name: retrieve_data
arguments: label: D25
type: string
name: retrieve_data
arguments: label: D45
type: string
name: retrieve_data
arguments: label: D22
type: string
name: retrieve_data
arguments: label: D58
type: string
name: retrieve_data
arguments: label: D40
type: string

tool: D28: -t

tool: D25: .t

tool: 

tool: D22: .

tool: D58: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dnstap/knot/refs/heads/branches/dnstap/libtap/runtests.c

tool: D40: %s/%s%s

assistant: ```c
char *find_test(const char *name, const char *source, const char *build) {
  char *path;
  const char *bases[3], *suffix, *base;
  unsigned int i, j;
  const char *suffixes[3] = {"-t", ".t", ""};
  bases[0] = ".";
  bases[1] = build;
  bases[2] = source;
  for (i = 0; i < (sizeof(suffixes) / sizeof((suffixes)[0])); i++) {
    suffix = suffixes[i];
    for (j = 0; j < (sizeof(bases) / sizeof((bases)[0])); j++) {
      unsigned int path_len;
      base = bases[j];
      if (base == NULL)
        continue;
      path_len = strlen(base) + strlen(name) + strlen(suffix) + 2;
      path = x_malloc((path_len), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dnstap/knot/refs/heads/branches/dnstap/libtap/runtests.c", 1037);
      snprintf(path, path_len, "%s/%s%s", base, name, suffix);
      if (is_valid_test(path))
        return path;
      free(path);
      path = NULL;
    }
  }
  if (path == NULL)
    path = x_strdup((name), "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dnstap/knot/refs/heads/branches/dnstap/libtap/runtests.c", 1046);
  return path;
}
```