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

```asm
<convert_statistics>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rdi,%rsi
  lea    D100(%rip),%rdi
  call   <printf@plt>
  mov    %r12,%rdi
  call   <open_file@plt>
  test   %rax,%rax
  je     L5
  mov    %rax,%rbx
  mov    %r12,%rdi
  call   <create_file@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L27
  lea    D108(%rip),%rdx
  mov    %rax,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D58(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D51(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D79(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D134(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D11(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D162(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D110(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D194(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D190(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D37(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D156(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D59(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D200(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D32(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D48(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D39(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D75(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D18(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D127(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D124(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D166(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  lea    D60(%rip),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <save_str@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r12,%rdi
  call   <rename_file@plt>
L5:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L27:
  mov    %rbx,%rdi
  call   <fclose@plt>
  jmp    L5
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D100
datatype: string
name: extract_symbolic_data
arguments: data_tag: D108
datatype: string
name: extract_symbolic_data
arguments: data_tag: D58
datatype: string
name: extract_symbolic_data
arguments: data_tag: D51
datatype: string
name: extract_symbolic_data
arguments: data_tag: D79
datatype: string
name: extract_symbolic_data
arguments: data_tag: D134
datatype: string
name: extract_symbolic_data
arguments: data_tag: D11
datatype: string
name: extract_symbolic_data
arguments: data_tag: D162
datatype: string
name: extract_symbolic_data
arguments: data_tag: D110
datatype: string
name: extract_symbolic_data
arguments: data_tag: D194
datatype: string
name: extract_symbolic_data
arguments: data_tag: D190
datatype: string
name: extract_symbolic_data
arguments: data_tag: D37
datatype: string
name: extract_symbolic_data
arguments: data_tag: D156
datatype: string
name: extract_symbolic_data
arguments: data_tag: D59
datatype: string
name: extract_symbolic_data
arguments: data_tag: D200
datatype: string
name: extract_symbolic_data
arguments: data_tag: D32
datatype: string
name: extract_symbolic_data
arguments: data_tag: D48
datatype: string
name: extract_symbolic_data
arguments: data_tag: D39
datatype: string
name: extract_symbolic_data
arguments: data_tag: D75
datatype: string
name: extract_symbolic_data
arguments: data_tag: D18
datatype: string
name: extract_symbolic_data
arguments: data_tag: D127
datatype: string
name: extract_symbolic_data
arguments: data_tag: D124
datatype: string
name: extract_symbolic_data
arguments: data_tag: D166
datatype: string
name: extract_symbolic_data
arguments: data_tag: D60
datatype: string

tool: D100: converting statistics %s


tool: D108: oldest

tool: D58: youngest

tool: D51: most_logins

tool: D79: most_xsent

tool: D134: most_xrecv

tool: D11: most_esent

tool: D162: most_erecv

tool: D110: most_posted

tool: D194: most_read

tool: D190: oldest_birth

tool: D37: youngest_birth

tool: D156: logins

tool: D59: xsent

tool: D200: xrecv

tool: D32: esent

tool: D48: erecv

tool: D39: posted

tool: D75: read

tool: D18: oldest_age

tool: D127: most_fsent

tool: D124: most_frecv

tool: D166: fsent

tool: D60: frecv

assistant: ```c
void convert_statistics(char *filename) {
  FILE *f, *f2;
  printf("converting statistics %s\n", filename);
  if ((f = open_file(filename)) == NULL)
    return;
  if ((f2 = create_file(filename)) == NULL) {
    fclose(f);
    return;
  }
  save_str(f, f2, "oldest");
  save_str(f, f2, "youngest");
  save_str(f, f2, "most_logins");
  save_str(f, f2, "most_xsent");
  save_str(f, f2, "most_xrecv");
  save_str(f, f2, "most_esent");
  save_str(f, f2, "most_erecv");
  save_str(f, f2, "most_posted");
  save_str(f, f2, "most_read");
  save_str(f, f2, "oldest_birth");
  save_str(f, f2, "youngest_birth");
  save_str(f, f2, "logins");
  save_str(f, f2, "xsent");
  save_str(f, f2, "xrecv");
  save_str(f, f2, "esent");
  save_str(f, f2, "erecv");
  save_str(f, f2, "posted");
  save_str(f, f2, "read");
  save_str(f, f2, "oldest_age");
  save_str(f, f2, "most_fsent");
  save_str(f, f2, "most_frecv");
  save_str(f, f2, "fsent");
  save_str(f, f2, "frecv");
  fclose(f);
  fclose(f2);
  rename_file(filename);
}
```