user: 请将以下的汇编代码转换成C语言代码：

```asm
<write_data>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movslq %esi,%rbx
  lea    D52(%rip),%rsi
  sub    $0x48,%rsp
  mov    0x80(%rsp),%eax
  mov    %edx,0x14(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %eax,0x1c(%rsp)
  mov    0x88(%rsp),%rax
  mov    %r8,0x20(%rsp)
  mov    %rax,0x30(%rsp)
  mov    0x90(%rsp),%rax
  mov    %r9,0x28(%rsp)
  mov    %rax,0x38(%rsp)
  call   <fopen@plt>
  test   %rax,%rax
  je     L104
  mov    %rax,%r15
  mov    %rax,%rdi
  mov    %ebx,%edx
  xor    %eax,%eax
  lea    D23(%rip),%rsi
  call   <fprintf@plt>
  mov    0x14(%rsp),%r14d
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D85(%rip),%rsi
  mov    %r14d,%edx
  call   <fprintf@plt>
  mov    0x18(%rsp),%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D26(%rip),%rsi
  call   <fprintf@plt>
  mov    0x1c(%rsp),%edx
  xor    %eax,%eax
  mov    %r15,%rdi
  lea    D43(%rip),%rsi
  call   <fprintf@plt>
  test   %r14d,%r14d
  jle    L105
  movq   $0x0,0x8(%rsp)
  shl    $0x2,%rbx
  lea    D82(%rip),%rbp
  movl   $0x0,0x10(%rsp)
  nop
L6:
  mov    0x10(%rsp),%r14d
  lea    D10(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  mov    %r14d,%edx
  call   <fprintf@plt>
  mov    %r14d,%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D63(%rip),%rsi
  call   <fprintf@plt>
  mov    0x18(%rsp),%r13d
  test   %r13d,%r13d
  jle    L34
  mov    0x20(%rsp),%r14
  xor    %r12d,%r12d
  add    0x8(%rsp),%r14
  nopl   0x0(%rax,%rax,1)
L13:
  mov    (%r14),%edx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  add    %rbx,%r14
  call   <fprintf@plt>
  mov    %r12d,%eax
  lea    0x1(%r12),%r12d
  cmp    %r12d,%r13d
  jne    L13
  mov    %r15,%rsi
  mov    $0xa,%edi
  mov    %eax,%r13d
  xor    %r14d,%r14d
  call   <fputc@plt>
  mov    0x28(%rsp),%r12
  add    0x8(%rsp),%r12
  nopl   (%rax)
L1:
  mov    (%r12),%edx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  add    %rbx,%r12
  call   <fprintf@plt>
  mov    %r14d,%eax
  add    $0x1,%r14d
  cmp    %eax,%r13d
  jne    L1
L0:
  mov    0x10(%rsp),%edx
  lea    D93(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    0x1c(%rsp),%r14d
  test   %r14d,%r14d
  jle    L5
  mov    0x30(%rsp),%r13
  xor    %r12d,%r12d
  add    0x8(%rsp),%r13
L68:
  mov    0x0(%r13),%edx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  add    %rbx,%r13
  call   <fprintf@plt>
  mov    %r12d,%eax
  lea    0x1(%r12),%r12d
  cmp    %r12d,%r14d
  jne    L68
  mov    %r15,%rsi
  mov    $0xa,%edi
  mov    %eax,%r14d
  xor    %r12d,%r12d
  call   <fputc@plt>
  mov    0x38(%rsp),%r13
  add    0x8(%rsp),%r13
  xchg   %ax,%ax
L56:
  mov    0x0(%r13),%edx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  add    %rbx,%r13
  call   <fprintf@plt>
  mov    %r12d,%eax
  add    $0x1,%r12d
  cmp    %eax,%r14d
  jne    L56
L37:
  addl   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%eax
  addq   $0x4,0x8(%rsp)
  cmp    %eax,0x14(%rsp)
  jne    L6
L105:
  add    $0x48,%rsp
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <fclose@plt>
  nop
L5:
  mov    %r15,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  jmp    L37
  nop
L34:
  mov    %r15,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  jmp    L0
L104:
  add    $0x48,%rsp
  lea    D57(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <printf@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D52
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D23
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D85
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D26
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D43
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D82
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D10
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D63
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D93
type_guessed: string
name: extract_symbolic_data
arguments: data_tag: D57
type_guessed: string

tool: D52: w+

tool: D23: Total AVI Frames: %d


tool: D85: Frames Processed: %d


tool: D26: endoPoints: %d


tool: D43: epiPoints: %d

tool: D82: %d	

tool: D10: 
---Frame %d---

tool: D63: 
--endo--


tool: D93: 
--epi--


tool: D57: The file was not opened for writing


assistant: ```c
void write_data(char *filename, int frameNo, int frames_processed, int endoPoints, int *input_a, int *input_b, int epiPoints, int *input_2a, int *input_2b) {
  FILE *fid;
  int i, j;
  char c;
  fid = fopen(filename, "w+");
  if (fid == NULL) {
    printf("The file was not opened for writing\n");
    return;
  }
  fprintf(fid, "Total AVI Frames: %d\n", frameNo);
  fprintf(fid, "Frames Processed: %d\n", frames_processed);
  fprintf(fid, "endoPoints: %d\n", endoPoints);
  fprintf(fid, "epiPoints: %d", epiPoints);
  for (j = 0; j < frames_processed; j++) {
    fprintf(fid, "\n---Frame %d---", j);
    fprintf(fid, "\n--endo--\n", j);
    for (i = 0; i < endoPoints; i++) {
      fprintf(fid, "%d\t", input_a[j + i * frameNo]);
    }
    fprintf(fid, "\n");
    for (i = 0; i < endoPoints; i++) {
      fprintf(fid, "%d\t", input_b[j + i * frameNo]);
    }
    fprintf(fid, "\n--epi--\n", j);
    for (i = 0; i < epiPoints; i++) {
      fprintf(fid, "%d\t", input_2a[j + i * frameNo]);
    }
    fprintf(fid, "\n");
    for (i = 0; i < epiPoints; i++) {
      fprintf(fid, "%d\t", input_2b[j + i * frameNo]);
    }
  }
  fclose(fid);
}
```