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

```asm
<writeMainPvd>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  lea    D75(%rip),%r12
  push   %rbp
  mov    %r12,%rdi
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <opendir@plt>
  xor    %edi,%edi
  test   %rax,%rax
  je     L84
  mov    %rax,%rbp
  xor    %ebx,%ebx
  lea    D126(%rip),%r13
  jmp    L57
  cs nopw 0x0(%rax,%rax,1)
L42:
  mov    (%rax),%edi
  lea    0x4(%rsp),%rdx
  mov    %r13,%rsi
  call   <sscanf@plt>
  cmp    $0x1,%eax
  sbb    $0xffffffff,%ebx
L57:
  mov    %rbp,%rdi
  call   <readdir@plt>
  test   %rax,%rax
  jne    L42
  lea    0x0(,%rbx,4),%edi
L84:
  call   <malloc@plt>
  mov    %r12,%rdi
  mov    %rax,%rbp
  call   <opendir@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L155
  mov    %rbp,%rbx
  mov    %rbp,%r15
  lea    D126(%rip),%r14
  xor    %r12d,%r12d
  jmp    L134
  nopw   0x0(%rax,%rax,1)
L136:
  mov    (%rax),%edi
  lea    0x4(%rsp),%rdx
  mov    %r14,%rsi
  call   <sscanf@plt>
  test   %eax,%eax
  jne    L24
L134:
  mov    %r13,%rdi
  call   <readdir@plt>
  test   %rax,%rax
  jne    L136
  lea    -0x1(%r12),%r13d
  test   %r13d,%r13d
  jle    L102
  mov    %r13d,%eax
  lea    0x4(%rbp),%r9
  nopl   (%rax)
L88:
  sub    $0x1,%eax
  mov    %rax,%r8
  lea    (%r9,%rax,4),%rdi
  mov    %rbp,%rax
  nopl   (%rax)
L0:
  mov    (%rax),%ecx
  mov    %rax,%rsi
  mov    0x4(%rax),%edx
  add    $0x4,%rax
  cmp    %edx,%ecx
  jle    L101
  mov    %ecx,(%rax)
  mov    %edx,(%rsi)
L101:
  cmp    %rax,%rdi
  jne    L0
  mov    %r8d,%eax
  test   %r8d,%r8d
  jne    L88
L102:
  lea    D112(%rip),%rsi
  lea    D64(%rip),%rdi
  call   <fopen@plt>
  mov    $0x44,%edx
  mov    $0x1,%esi
  lea    D104(%rip),%rdi
  mov    %rax,%r14
  mov    %rax,%rcx
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0xf,%edx
  mov    $0x1,%esi
  lea    D106(%rip),%rdi
  call   <fwrite@plt>
  test   %r12d,%r12d
  je     L132
  lea    0x4(%rbp,%r13,4),%r12
  lea    D59(%rip),%rbp
  nopw   0x0(%rax,%rax,1)
L119:
  mov    (%rbx),%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  mov    %edx,%ecx
  call   <fprintf@plt>
  cmp    %rbx,%r12
  jne    L119
L132:
  mov    %r14,%rcx
  mov    $0x10,%edx
  mov    $0x1,%esi
  lea    D26(%rip),%rdi
  call   <fwrite@plt>
  lea    D21(%rip),%rdi
  mov    %r14,%rcx
  mov    $0xb,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L71
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L24:
  mov    0x4(%rsp),%eax
  add    $0x1,%r12d
  add    $0x4,%r15
  mov    %eax,-0x4(%r15)
  jmp    L134
L155:
  lea    D112(%rip),%rsi
  lea    D64(%rip),%rdi
  call   <fopen@plt>
  mov    $0x44,%edx
  mov    $0x1,%esi
  lea    D104(%rip),%rdi
  mov    %rax,%r14
  mov    %rax,%rcx
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0xf,%edx
  mov    $0x1,%esi
  lea    D106(%rip),%rdi
  call   <fwrite@plt>
  jmp    L132
L71:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D75
type_guessed: string
name: disassemble_data
arguments: tag: D126
type_guessed: string
name: disassemble_data
arguments: tag: D112
type_guessed: string
name: disassemble_data
arguments: tag: D64
type_guessed: string
name: disassemble_data
arguments: tag: D104
type_guessed: string
name: disassemble_data
arguments: tag: D106
type_guessed: string
name: disassemble_data
arguments: tag: D59
type_guessed: string
name: disassemble_data
arguments: tag: D26
type_guessed: string
name: disassemble_data
arguments: tag: D21
type_guessed: string

tool: D75: .

tool: D126: %d

tool: D112: w

tool: D64: case.pvd

tool: D104: <VTKFile type="Collection" version="0.1" byte_order="LittleEndian">


tool: D106:   <Collection>


tool: D59:     <DataSet part="0"  timestep="%d" file="%d/fields.pvtu" />


tool: D26:   </Collection>


tool: D21: </VTKFile>


assistant: ```c
void writeMainPvd() {
  uint *tSteps;
  int status, aux;
  uint nt = 0;
  DIR *d;
  struct dirent *dir;
  d = opendir(".");
  if (d) {
    while ((dir = readdir(d)) != NULL) {
      status = sscanf(dir->d_name, "%d", &aux);
      if (status != 0) {
        nt++;
      }
    }
  }
  tSteps = (uint *)malloc(nt * sizeof(uint));
  nt = 0;
  d = opendir(".");
  if (d) {
    while ((dir = readdir(d)) != NULL) {
      status = sscanf(dir->d_name, "%d", &aux);
      if (status != 0) {
        tSteps[nt] = aux;
        nt++;
      }
    }
  }
  {
    int i, j, temp;
    for (i = 0; i < (nt - 1); ++i) {
      for (j = 0; j < (nt - 1) - i; ++j) {
        if (tSteps[j] > tSteps[j + 1]) {
          temp = tSteps[j + 1];
          tSteps[j + 1] = tSteps[j];
          tSteps[j] = temp;
        }
      }
    }
  }
  FILE *file = fopen("case.pvd", "w");
  fprintf(file, "<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"LittleEndian\">\n");
  fprintf(file, "  <Collection>\n");
  uint i;
  for (i = 0; i < nt; i++) {
    fprintf(file, "    <DataSet part=\"0\"  timestep=\"%d\" file=\"%d/fields.pvtu\" />\n", tSteps[i], tSteps[i]);
  }
  fprintf(file, "  </Collection>\n");
  fprintf(file, "</VTKFile>\n");
  fclose(file);
}
```