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

```asm
<save_dvector>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rsi,%r13
  mov    %r8,%rsi
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  push   %rbx
  movslq %edx,%rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L66
L5:
  lea    0x4(%rsp),%r15
  mov    %r15,%rdi
  call   <time@plt>
  mov    %r15,%rdi
  call   <ctime@plt>
  mov    %r14,%rdx
  lea    D1(%rip),%rsi
  mov    %rbp,%rdi
  mov    %rax,%rcx
  xor    %eax,%eax
  call   <fprintf@plt>
  lea    D28(%rip),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    $0x1,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D60(%rip),%rsi
  call   <fprintf@plt>
  mov    %r12d,%edx
  xor    %eax,%eax
  mov    %rbp,%rdi
  sub    %ebx,%edx
  lea    D31(%rip),%rsi
  add    $0x1,%edx
  call   <fprintf@plt>
  cmp    %ebx,%r12d
  jl     L17
  lea    D14(%rip),%r15
  lea    D64(%rip),%r14
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L63:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
L71:
  mov    %rbp,%rsi
  mov    $0xa,%edi
  add    $0x1,%rbx
  call   <fputc@plt>
  cmp    %ebx,%r12d
  jl     L17
L9:
  movsd  0x0(%r13,%rbx,8),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm1,%xmm0
  jp     L63
  jne    L63
  mov    %rbp,%rcx
  mov    $0x15,%edx
  mov    $0x1,%esi
  mov    %r14,%rdi
  call   <fwrite@plt>
  jmp    L71
  nopl   0x0(%rax,%rax,1)
L17:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L66:
  mov    %r14,%rsi
  lea    D7(%rip),%rdi
  call   <printf@plt>
  mov    $0x3f3,%edi
  call   <exit@plt>
  jmp    L5
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D1
type: string
name: retrieve_data
arguments: data_label: D28
type: string
name: retrieve_data
arguments: data_label: D60
type: string
name: retrieve_data
arguments: data_label: D31
type: string
name: retrieve_data
arguments: data_label: D14
type: string
name: retrieve_data
arguments: data_label: D64
type: string
name: retrieve_data
arguments: data_label: D7
type: string

tool: D1: %% filename: %s - %s

tool: D28: %% type: vector


tool: D60: %% rows: %d


tool: D31: %% columns: %d


tool: D14: %21.12e

tool: D64:     0                

tool: D7:  error: cannot open file: '%s' 


assistant: ```c
void save_dvector(char filename[], double *V, int nl, int nh, const char *mode) {
  FILE *fp_v;
  int i;
  time_t now;
  if ((fp_v = fopen(filename, mode)) == NULL) {
    printf(" error: cannot open file: '%s' \n", filename);
    exit(1011);
  }
  (void)time(&now);
  fprintf(fp_v, "%% filename: %s - %s", filename, ctime(&now));
  fprintf(fp_v, "%% type: vector\n");
  fprintf(fp_v, "%% rows: %d\n", 1);
  fprintf(fp_v, "%% columns: %d\n", nh - nl + 1);
  for (i = nl; i <= nh; i++) {
    if (V[i] != 0)
      fprintf(fp_v, "%21.12e", V[i]);
    else
      fprintf(fp_v, "    0                ");
    fprintf(fp_v, "\n");
  }
  fclose(fp_v);
  return;
}
```