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

```asm
<run_tests>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%rsi
  test   %rsi,%rsi
  je     L10
  mov    %rdi,%r15
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%ebx
  mov    $0x0,%r14d
  jmp    L2
L63:
  mov    $0x0,%edx
  jmp    L111
L160:
  add    $0x1,%rbx
  cmp    %ebx,%ebp
  jle    L151
L16:
  mov    (%r12,%rbx,8),%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    (%r12,%rbx,8),%rsi
  mov    0x20(%rsp),%rax
  mov    (%rax,%rbx,8),%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L160
  mov    %r14d,%esi
  lea    D16(%rip),%rdi
  call   <printf@plt>
  add    $0x1,%r13d
  jmp    L160
L151:
  test   %r13d,%r13d
  jne    L98
L139:
  mov    %r14d,%esi
  lea    D15(%rip),%rdi
  call   <printf@plt>
  jmp    L83
L10:
  movl   $0x0,0xc(%rsp)
L7:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L190
  mov    0xc(%rsp),%eax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L115:
  call   <dupargv@plt>
  mov    %rax,%r12
  mov    $0x0,%ebp
  cmpl   $0x0,0x1c(%rsp)
  jg     L183
L51:
  lea    0x20(%rsp),%rsi
  lea    0x1c(%rsp),%rdi
  call   <expandargv@plt>
  cmp    0x1c(%rsp),%ebp
  je     L139
L196:
  mov    %r14d,%esi
  lea    D19(%rip),%rdi
  call   <printf@plt>
L98:
  addl   $0x1,0xc(%rsp)
L83:
  mov    0x20(%rsp),%rdi
  call   <freeargv@plt>
  mov    %r12,%rdi
  call   <freeargv@plt>
  mov    0x8(%rsp),%eax
  lea    0x1(%rbp,%rax,1),%ebx
  mov    %r14d,%edi
  call   <erase_test@plt>
  add    $0x1,%r14d
  movslq %ebx,%rax
  mov    (%r15,%rax,8),%rsi
  test   %rsi,%rsi
  je     L7
L2:
  add    $0x1,%ebx
  mov    %r14d,%edi
  call   <writeout_test@plt>
  movslq %ebx,%rbp
  shl    $0x3,%rbp
  lea    (%r15,%rbp,1),%r12
  mov    %r12,%rdi
  call   <dupargv@plt>
  mov    %rax,0x20(%rsp)
  movl   $0x0,0x1c(%rsp)
  cmpq   $0x0,(%r12)
  je     L63
  lea    -0x8(%r15,%rbp,1),%rcx
  mov    $0x1,%eax
L128:
  mov    %eax,%edx
  add    $0x1,%rax
  cmpq   $0x0,(%rcx,%rax,8)
  jne    L128
  mov    %edx,0x1c(%rsp)
L111:
  lea    0x1(%rdx,%rbx,1),%eax
  mov    %eax,0x8(%rsp)
  cltq
  lea    (%r15,%rax,8),%rdi
  cmpq   $0x0,(%rdi)
  je     L115
  mov    $0x1,%eax
L101:
  mov    %eax,%ebp
  add    $0x1,%rax
  cmpq   $0x0,-0x8(%rdi,%rax,8)
  jne    L101
  call   <dupargv@plt>
  mov    %rax,%r12
  cmpl   $0x0,0x1c(%rsp)
  jle    L161
L183:
  mov    $0x0,%ebx
L25:
  mov    0x20(%rsp),%rax
  mov    (%rax,%rbx,8),%rdi
  call   <run_replaces@plt>
  add    $0x1,%rbx
  cmp    %ebx,0x1c(%rsp)
  jg     L25
L161:
  test   %ebp,%ebp
  jle    L51
  mov    %r12,%rbx
  lea    -0x1(%rbp),%eax
  lea    0x8(%r12,%rax,8),%r13
L181:
  mov    (%rbx),%rdi
  call   <run_replaces@plt>
  add    $0x8,%rbx
  cmp    %rbx,%r13
  jne    L181
  lea    0x20(%rsp),%rsi
  lea    0x1c(%rsp),%rdi
  call   <expandargv@plt>
  mov    $0x0,%ebx
  mov    $0x0,%r13d
  cmp    0x1c(%rsp),%ebp
  jne    L196
  jmp    L16
L190:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D16
data_type: string
name: retrieve_data
arguments: data_tag: D15
data_type: string
name: retrieve_data
arguments: data_tag: D19
data_type: string

tool: D16: FAIL: test-expandargv-%d. Arguments don't match.


tool: D15: PASS: test-expandargv-%d.


tool: D19: FAIL: test-expandargv-%d. Number of arguments don't match.


assistant: ```c
int run_tests(const char **test_data) {
  int argc_after, argc_before;
  char **argv_before, **argv_after;
  int i, j, k, fails, failed;
  i = j = fails = 0;
  while (test_data[j]) {
    writeout_test(i, test_data[j++]);
    argv_before = dupargv((char **)&test_data[j]);
    argc_before = 0;
    argc_after = 0;
    while (test_data[j + argc_before])
      argc_before++;
    j += argc_before + 1;
    while (test_data[j + argc_after])
      argc_after++;
    argv_after = dupargv((char **)&test_data[j]);
    for (k = 0; k < argc_before; k++)
      run_replaces(argv_before[k]);
    for (k = 0; k < argc_after; k++)
      run_replaces(argv_after[k]);
    expandargv(&argc_before, &argv_before);
    failed = 0;
    if (argc_before != argc_after) {
      printf("FAIL: test-expandargv-%d. Number of arguments don't match.\n", i);
      failed++;
    } else
      for (k = 0; k < argc_after; k++)
        if (strncmp(argv_before[k], argv_after[k], strlen(argv_after[k])) != 0) {
          printf("FAIL: test-expandargv-%d. Arguments don't match.\n", i);
          failed++;
        }
    if (!failed)
      printf("PASS: test-expandargv-%d.\n", i);
    else
      fails++;
    freeargv(argv_before);
    freeargv(argv_after);
    j += argc_after + 1;
    erase_test(i);
    i++;
  }
  return fails;
}
```