user: Please show me the C implementation that matches the assembly code listed below:

```asm
<find_test>:
  endbr64
  push   %r15
  lea    D9(%rip),%rcx
  push   %r14
  movq   %rcx,%xmm0
  lea    D46(%rip),%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  lea    D54(%rip),%rax
  mov    %rdx,0x28(%rsp)
  lea    0x40(%rsp),%rbx
  mov    %rsi,0x30(%rsp)
  movq   %rax,%xmm1
  lea    D39(%rip),%rax
  mov    %rax,0x50(%rsp)
  lea    D49(%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,0x8(%rsp)
  movaps %xmm0,0x40(%rsp)
L31:
  mov    (%rbx),%r13
  mov    0x10(%rsp),%r12
L35:
  mov    (%r12),%rdi
  test   %rdi,%rdi
  je     L26
  xor    %r8d,%r8d
  mov    %r13,%rcx
  mov    %rbp,%rdx
  mov    %r14,%rsi
  call   <concat@plt>
  mov    %rax,%rdi
  mov    %rax,%r15
  call   <is_valid_test@plt>
  test   %rax,%rax
  jne    L46
  mov    %r15,%rdi
  call   <free@plt>
L26:
  add    $0x8,%r12
  cmp    0x8(%rsp),%r12
  jne    L35
  add    $0x8,%rbx
  cmp    0x18(%rsp),%rbx
  jne    L31
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L58
  add    $0x68,%rsp
  mov    %rbp,%rdi
  mov    $0x4b3,%edx
  pop    %rbx
  lea    D51(%rip),%rsi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10d0 <x_strdup@plt>
  nopw   0x0(%rax,%rax,1)
L46:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L58
  add    $0x68,%rsp
  mov    %r15,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L58:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D9
type_guessed: string
name: unpack_data
arguments: tag: D46
type_guessed: string
name: unpack_data
arguments: tag: D54
type_guessed: string
name: unpack_data
arguments: tag: D39
type_guessed: string
name: unpack_data
arguments: tag: D49
type_guessed: string
name: unpack_data
arguments: tag: D51
type_guessed: string

tool: D9: -t

tool: D46: /

tool: D54: .t

tool: 

tool: D49: .

tool: D51: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Mkaysi/charybdis/refs/heads/master/tests/runtests.c

assistant: ```c
char *find_test(const char *name, const char *source, const char *build) {
  char *path = NULL;
  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++) {
      base = bases[j];
      if (base == NULL)
        continue;
      path = concat(base, "/", name, suffix, (const char *)0);
      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/Mkaysi/charybdis/refs/heads/master/tests/runtests.c", 1203);
  return path;
}
```