user: 请从给定的汇编指令推导出C源代码:

```asm
<dump_velocity_c>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x228,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    %edx,%ebp
  mov    %ecx,%r14d
  mov    %r8d,0x4(%rsp)
  mov    %r9,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  lea    0x110(%rsp),%rbx
  mov    %rsi,%r8
  mov    %rdi,%rcx
  lea    D42(%rip),%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  lea    D1(%rip),%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  test   %rax,%rax
  je     L60
  mov    %rax,%rbx
  lea    0x110(%rsp),%r15
  mov    %r12,%rcx
  lea    D104(%rip),%rdx
  mov    $0x100,%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %rbx,%rcx
  mov    $0x13,%edx
  mov    $0x1,%esi
  lea    D135(%rip),%rdi
  call   <fwrite@plt>
  mov    %r15,%rdx
  lea    D98(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    0x4(%rsp),%r8d
  mov    %r14d,%ecx
  mov    %ebp,%edx
  lea    D18(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    %rbx,%rcx
  mov    $0x13,%edx
  mov    $0x1,%esi
  lea    D53(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D26(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x14,%edx
  mov    $0x1,%esi
  lea    D99(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    %r12,%r8
  mov    %r13,%rcx
  lea    D48(%rip),%rdx
  mov    $0x100,%esi
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  lea    D1(%rip),%rsi
  mov    %r15,%rdi
  call   <fopen@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L42
  imul   %r14d,%ebp
  imul   0x4(%rsp),%ebp
  lea    0x0(%rbp,%rbp,2),%r12d
  lea    0x0(,%r12,8),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L28
  test   %r12d,%r12d
  jle    L47
  mov    %r12d,%edx
  lea    (%rax,%rdx,8),%rcx
  mov    %rax,%rdx
  neg    %rdx
  mov    0x8(%rsp),%rsi
  lea    (%rsi,%rdx,2),%rdx
L71:
  movsd  (%rdx,%rax,2),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L71
L47:
  mov    %rbx,%rcx
  mov    %r12d,%edx
  mov    $0x8,%esi
  mov    %rbp,%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
L1:
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L57
  add    $0x228,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L60:
  lea    0x110(%rsp),%rcx
  lea    0x10(%rsp),%rbx
  lea    D56(%rip),%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %rbx,%rdi
  call   <perror@plt>
  jmp    L1
L42:
  mov    %r15,%rcx
  lea    0x10(%rsp),%rbx
  lea    D7(%rip),%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %rbx,%rdi
  call   <perror@plt>
  jmp    L1
L28:
  lea    0x10(%rsp),%rbx
  lea    D6(%rip),%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %rbx,%rdi
  call   <perror@plt>
  jmp    L1
L57:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D42
type: string
name: parse_data
arguments: data_label: D1
type: string
name: parse_data
arguments: data_label: D104
type: string
name: parse_data
arguments: data_label: D135
type: string
name: parse_data
arguments: data_label: D98
type: string
name: parse_data
arguments: data_label: D18
type: string
name: parse_data
arguments: data_label: D53
type: string
name: parse_data
arguments: data_label: D26
type: string
name: parse_data
arguments: data_label: D99
type: string
name: parse_data
arguments: data_label: D48
type: string
name: parse_data
arguments: data_label: D56
type: string
name: parse_data
arguments: data_label: D7
type: string
name: parse_data
arguments: data_label: D6
type: string

tool: D42: %s/%s.bov

tool: D1: wb

tool: D104: %s.dat

tool: D135: VARIABLE: velocity


tool: D98: DATA_FILE: %s


tool: D18: DATA_SIZE: %d %d %d


tool: D53: DATA_COMPONENTS: 3


tool: D26: DATA_FORMAT: DOUBLE


tool: D99: DATA_ENDIAN: LITTLE


tool: D48: %s/%s.dat

tool: D56: WARNING: Unable to create BOV file (%s)

tool: D7: WARNING: Unable to create DAT file (%s)

tool: D6: WARNING: Unable to allocate write buffer

assistant: ```c
void dump_velocity_c(char *dname, char *fname, int nx, int ny, int nz, double *array) {
  int i, j, k;
  FILE *fp;
  char errmsg[256];
  char buf[256];
  double *wbuf;
  snprintf(buf, 256, "%s/%s.bov", dname, fname);
  fp = fopen(buf, "wb");
  if (fp == NULL) {
    snprintf(errmsg, 256, "WARNING: Unable to create BOV file (%s)", buf);
    perror(errmsg);
    return;
  }
  snprintf(buf, 256, "%s.dat", fname);
  fprintf(fp, "VARIABLE: velocity\n");
  fprintf(fp, "DATA_FILE: %s\n", buf);
  fprintf(fp, "DATA_SIZE: %d %d %d\n", nx, ny, nz);
  fprintf(fp, "DATA_COMPONENTS: 3\n");
  fprintf(fp, "DATA_FORMAT: DOUBLE\n");
  fprintf(fp, "DATA_ENDIAN: LITTLE\n");
  fclose(fp);
  snprintf(buf, 256, "%s/%s.dat", dname, fname);
  fp = fopen(buf, "wb");
  if (fp == NULL) {
    snprintf(errmsg, 256, "WARNING: Unable to create DAT file (%s)", buf);
    perror(errmsg);
    return;
  }
  wbuf = (double *)malloc(3 * nx * ny * nz * sizeof(double));
  if (wbuf == NULL) {
    snprintf(errmsg, 256, "WARNING: Unable to allocate write buffer");
    perror(errmsg);
    return;
  }
  for (i = 0; i < 3 * nx * ny * nz; i++)
    wbuf[i] = array[2 * i];
  fwrite(wbuf, sizeof(double), 3 * nx * ny * nz, fp);
  free(wbuf);
  fclose(fp);
}
```