user: Converte this assembly snippet into its equivalent C code:

```asm
<run_tests>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L146
L17:
  mov    -0x28(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x28(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x2c(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <writeout_test@plt>
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <dupargv@plt>
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L45
L91:
  mov    -0x34(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x34(%rbp)
L45:
  mov    -0x34(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L91
  mov    -0x34(%rbp),%eax
  add    $0x1,%eax
  add    %eax,-0x28(%rbp)
  jmp    L124
L166:
  addl   $0x1,-0x30(%rbp)
L124:
  mov    -0x28(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L166
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <dupargv@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L46
L28:
  mov    -0x18(%rbp),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <run_replaces@plt>
  addl   $0x1,-0x24(%rbp)
L46:
  mov    -0x34(%rbp),%eax
  cmp    %eax,-0x24(%rbp)
  jl     L28
  movl   $0x0,-0x24(%rbp)
  jmp    L7
L36:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <run_replaces@plt>
  addl   $0x1,-0x24(%rbp)
L7:
  mov    -0x24(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L36
  lea    -0x18(%rbp),%rdx
  lea    -0x34(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <expandargv@plt>
  movl   $0x0,-0x1c(%rbp)
  mov    -0x34(%rbp),%eax
  cmp    %eax,-0x30(%rbp)
  je     L155
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D10(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x1c(%rbp)
  jmp    L120
L155:
  movl   $0x0,-0x24(%rbp)
  jmp    L6
L84:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x10(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x18(%rbp),%rsi
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rsi,%rax
  mov    (%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L57
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x1c(%rbp)
L57:
  addl   $0x1,-0x24(%rbp)
L6:
  mov    -0x24(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L84
L120:
  cmpl   $0x0,-0x1c(%rbp)
  jne    L153
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L37
L153:
  addl   $0x1,-0x20(%rbp)
L37:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <freeargv@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <freeargv@plt>
  mov    -0x30(%rbp),%eax
  add    $0x1,%eax
  add    %eax,-0x28(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <erase_test@plt>
  addl   $0x1,-0x2c(%rbp)
L146:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L17
  mov    -0x20(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L47
  call   <__stack_chk_fail@plt>
L47:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D10
type_guessed: string
name: extract_symbolic_data
arguments: label: D13
type_guessed: string
name: extract_symbolic_data
arguments: label: D16
type_guessed: string

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


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


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


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;
}
```