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

```asm
<write_data>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movslq %esi,%rbx
  lea    D74(%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     L48
  mov    %rax,%r15
  mov    %rax,%rdi
  mov    %ebx,%edx
  xor    %eax,%eax
  lea    D18(%rip),%rsi
  call   <fprintf@plt>
  mov    0x14(%rsp),%r14d
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D54(%rip),%rsi
  mov    %r14d,%edx
  call   <fprintf@plt>
  mov    0x18(%rsp),%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D97(%rip),%rsi
  call   <fprintf@plt>
  mov    0x1c(%rsp),%edx
  xor    %eax,%eax
  mov    %r15,%rdi
  lea    D87(%rip),%rsi
  call   <fprintf@plt>
  test   %r14d,%r14d
  jle    L85
  movq   $0x0,0x8(%rsp)
  shl    $0x2,%rbx
  lea    D43(%rip),%rbp
  movl   $0x0,0x10(%rsp)
  nop
L0:
  mov    0x10(%rsp),%r14d
  lea    D29(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  mov    %r14d,%edx
  call   <fprintf@plt>
  mov    %r14d,%edx
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D8(%rip),%rsi
  call   <fprintf@plt>
  mov    0x18(%rsp),%r13d
  test   %r13d,%r13d
  jle    L87
  mov    0x20(%rsp),%r14
  xor    %r12d,%r12d
  add    0x8(%rsp),%r14
  nopl   0x0(%rax,%rax,1)
L75:
  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    L75
  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)
L72:
  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    L72
L6:
  mov    0x10(%rsp),%edx
  lea    D19(%rip),%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    0x1c(%rsp),%r14d
  test   %r14d,%r14d
  jle    L40
  mov    0x30(%rsp),%r13
  xor    %r12d,%r12d
  add    0x8(%rsp),%r13
L84:
  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    L84
  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
L63:
  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    L63
L52:
  addl   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%eax
  addq   $0x4,0x8(%rsp)
  cmp    %eax,0x14(%rsp)
  jne    L0
L85:
  add    $0x48,%rsp
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <fclose@plt>
  nop
L40:
  mov    %r15,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  jmp    L52
  nop
L87:
  mov    %r15,%rsi
  mov    $0xa,%edi
  call   <fputc@plt>
  jmp    L6
L48:
  add    $0x48,%rsp
  lea    D36(%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: label: D74
type: string
name: extract_symbolic_data
arguments: label: D18
type: string
name: extract_symbolic_data
arguments: label: D54
type: string
name: extract_symbolic_data
arguments: label: D97
type: string
name: extract_symbolic_data
arguments: label: D87
type: string
name: extract_symbolic_data
arguments: label: D43
type: string
name: extract_symbolic_data
arguments: label: D29
type: string
name: extract_symbolic_data
arguments: label: D8
type: string
name: extract_symbolic_data
arguments: label: D19
type: string
name: extract_symbolic_data
arguments: label: D36
type: string

tool: D74: w+

tool: D18: Total AVI Frames: %d


tool: D54: Frames Processed: %d


tool: D97: endoPoints: %d


tool: D87: epiPoints: %d

tool: D43: %d	

tool: D29: 
---Frame %d---

tool: D8: 
--endo--


tool: D19: 
--epi--


tool: D36: 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);
}
```