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    L15
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x3f4,%edi
  call   <exit@plt>
L15:
  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    D49(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x10(%rbp),%rax
  lea    D48(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x10(%rbp),%rax
  mov    $0x1,%edx
  lea    D18(%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    D55(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L39
L10:
  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    D45(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  jmp    L35
L34:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rcx
  mov    $0xd,%edx
  mov    $0x1,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
L35:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  addl   $0x1,-0x14(%rbp)
L39:
  mov    -0x14(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jle    L10
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L59
  call   <__stack_chk_fail@plt>
L59:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D57
type_infered: string
name: disassemble_data
arguments: data_tag: D49
type_infered: string
name: disassemble_data
arguments: data_tag: D48
type_infered: string
name: disassemble_data
arguments: data_tag: D18
type_infered: string
name: disassemble_data
arguments: data_tag: D55
type_infered: string
name: disassemble_data
arguments: data_tag: D45
type_infered: string
name: disassemble_data
arguments: data_tag: D3
type_infered: string

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


tool: D49: %% filename: %s - %s

tool: D48: %% type: vector


tool: D18: %% rows: %d


tool: D55: %% columns: %d


tool: D45: %15d

tool: D3:    0         

assistant: ```c
void save_ivector(char filename[], int *V, int nl, int nh, const char *mode) {
  FILE *fp_v;
  int i;
  void exit();
  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;
}
```