user: Translate the below assembly code into C programming language:

```asm
<find_test>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  lea    D68(%rip),%rax
  mov    %rax,0x40(%rsp)
  lea    D54(%rip),%rax
  mov    %rax,0x48(%rsp)
  lea    D55(%rip),%rax
  mov    %rax,0x50(%rsp)
  lea    D61(%rip),%rax
  mov    %rax,0x20(%rsp)
  mov    %rdx,0x28(%rsp)
  mov    %rsi,0x30(%rsp)
  lea    0x40(%rsp),%r15
  lea    0x58(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,0x10(%rsp)
  jmp    L3
L50:
  add    $0x8,%rbp
  cmp    0x10(%rsp),%rbp
  je     L69
L46:
  mov    0x0(%rbp),%r12
  test   %r12,%r12
  je     L50
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,%r13d
  mov    0x8(%rsp),%rdi
  call   <strlen@plt>
  add    %eax,%r13d
  mov    %r14,%rdi
  call   <strlen@plt>
  lea    0x2(%r13,%rax,1),%r13d
  mov    $0x40d,%edx
  lea    D6(%rip),%rsi
  mov    %r13d,%edi
  call   <x_malloc@plt>
  mov    %rax,%rbx
  mov    %r14,%r9
  mov    0x8(%rsp),%r8
  mov    %r12,%rcx
  lea    D13(%rip),%rdx
  mov    %r13d,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %rbx,%rdi
  call   <is_valid_test@plt>
  test   %rax,%rax
  jne    L21
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L50
L69:
  add    $0x8,%r15
  cmp    0x18(%rsp),%r15
  je     L32
L3:
  mov    (%r15),%r14
  lea    0x20(%rsp),%rbp
  jmp    L46
L32:
  mov    $0x416,%edx
  lea    D6(%rip),%rsi
  mov    0x8(%rsp),%rdi
  call   <x_strdup@plt>
  mov    %rax,%rbx
L21:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L29
  mov    %rbx,%rax
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D68
data_type: string
name: unpack_data
arguments: data_label: D54
data_type: string
name: unpack_data
arguments: data_label: D55
data_type: string
name: unpack_data
arguments: data_label: D61
data_type: string
name: unpack_data
arguments: data_label: D6
data_type: string
name: unpack_data
arguments: data_label: D13
data_type: string

tool: D68: -t

tool: D54: .t

tool: 

tool: D61: .

tool: D6: /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: D13: %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;
}
```