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

```asm
<save_ivector>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  mov    %ecx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x40(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L4
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x3f4,%edi
  call   <exit@plt>
L4:
  lea    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <time@plt>
  lea    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <ctime@plt>
  mov    %rax,%rcx
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    D38(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x10(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    $0x1,%edx
  lea    D1(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x38(%rbp),%eax
  sub    -0x34(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    -0x10(%rbp),%rax
  lea    D41(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L1
L6:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L34
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%rax
  lea    D54(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  jmp    L19
L34:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rcx
  mov    $0xd,%edx
  mov    $0x1,%esi
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
L19:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  addl   $0x1,-0x14(%rbp)
L1:
  mov    -0x14(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jle    L6
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L25
  call   <__stack_chk_fail@plt>
L25:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D37
type_infered: string
name: disassemble_data
arguments: label: D38
type_infered: string
name: disassemble_data
arguments: label: D3
type_infered: string
name: disassemble_data
arguments: label: D1
type_infered: string
name: disassemble_data
arguments: label: D41
type_infered: string
name: disassemble_data
arguments: label: D54
type_infered: string
name: disassemble_data
arguments: label: D51
type_infered: string

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


tool: D38: %% filename: %s - %s

tool: D3: %% type: vector


tool: D1: %% rows: %d


tool: D41: %% columns: %d


tool: D54: %15d

tool: D51:    0         

assistant: ```c
void save_ivector(char filename[], int *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(1012);
  }
  (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, "%15d", V[i]);
    else
      fprintf(fp_v, "   0         ");
    fprintf(fp_v, "\n");
  }
  fclose(fp_v);
  return;
}
```