user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<save_ivector>:
  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>
  test   %rax,%rax
  je     L45
  lea    0x4(%rsp),%r15
  mov    %rax,%rbp
  mov    %r15,%rdi
  call   <time@plt>
  mov    %r15,%rdi
  call   <ctime@plt>
  mov    %r14,%rdx
  lea    D49(%rip),%rsi
  mov    %rbp,%rdi
  mov    %rax,%rcx
  xor    %eax,%eax
  call   <fprintf@plt>
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    $0x1,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D29(%rip),%rsi
  call   <fprintf@plt>
  mov    %r12d,%edx
  xor    %eax,%eax
  mov    %rbp,%rdi
  sub    %ebx,%edx
  lea    D41(%rip),%rsi
  add    $0x1,%edx
  call   <fprintf@plt>
  cmp    %ebx,%r12d
  jl     L61
  lea    D14(%rip),%r15
  lea    D10(%rip),%r14
  jmp    L39
  nopl   0x0(%rax,%rax,1)
L19:
  mov    %r14,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
L54:
  mov    %rbp,%rsi
  mov    $0xa,%edi
  add    $0x1,%rbx
  call   <fputc@plt>
  cmp    %ebx,%r12d
  jl     L61
L39:
  mov    0x0(%r13,%rbx,4),%edx
  test   %edx,%edx
  jne    L19
  mov    %rbp,%rcx
  mov    $0xd,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  jmp    L54
  nopl   0x0(%rax,%rax,1)
L61:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L13
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L45:
  lea    D19(%rip),%rdi
  mov    %r14,%rsi
  call   <printf@plt>
  mov    $0x3f4,%edi
  call   <exit@plt>
L13:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D49
type_infered: string
name: extract_symbolic_data
arguments: tag: D5
type_infered: string
name: extract_symbolic_data
arguments: tag: D29
type_infered: string
name: extract_symbolic_data
arguments: tag: D41
type_infered: string
name: extract_symbolic_data
arguments: tag: D14
type_infered: string
name: extract_symbolic_data
arguments: tag: D10
type_infered: string
name: extract_symbolic_data
arguments: tag: D19
type_infered: string

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

tool: D5: %% type: vector


tool: D29: %% rows: %d


tool: D41: %% columns: %d


tool: D14:    0         

tool: D10: %15d

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


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;
}
```