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

```asm
<output_data>:
  endbr64
  push   %r15
  lea    D104(%rip),%rsi
  lea    D50(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L9
L95:
  mov    $0x320,%edi
  call   <malloc@plt>
  mov    $0x320,%edi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %r13,%r13
  je     L43
  cmpq   $0x0,0x8(%rsp)
  jne    L16
L86:
  lea    D25(%rip),%rdi
  call   <report_error@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L16:
  lea    D43(%rip),%rdi
  call   <report_error@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L44:
  mov    0x8(%rsp),%rbx
  lea    0x8(%r13),%r14
  mov    $0x1,%r15d
  lea    D83(%rip),%r12
  sub    %r13,%rbx
  nopl   0x0(%rax,%rax,1)
L98:
  pxor   %xmm0,%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  cvtsi2sd %r15d,%xmm0
  mulsd  D96(%rip),%xmm0
  add    $0x1,%r15d
  divsd  D74(%rip),%xmm0
  addsd  D40(%rip),%xmm0
  movsd  %xmm0,(%r14)
  movsd  (%rbx,%r14,1),%xmm1
  add    $0x8,%r14
  call   <fprintf@plt>
  cmp    $0x65,%r15d
  jne    L98
  test   %rbp,%rbp
  je     L85
  mov    %rbp,%rdi
  call   <fclose@plt>
  test   %rax,%rax
  jne    L67
L85:
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L43:
  lea    D49(%rip),%rdi
  call   <report_error@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  cmpq   $0x0,0x8(%rsp)
  jne    L44
  jmp    L86
  nopl   0x0(%rax)
L67:
  lea    D61(%rip),%rdi
  call   <report_error@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L85
L9:
  lea    D101(%rip),%rdi
  call   <report_error@plt>
  jmp    L95
```

tool_calls: name: retrieve_data
arguments: data_tag: D104
data_type: string
name: retrieve_data
arguments: data_tag: D50
data_type: string
name: retrieve_data
arguments: data_tag: D25
data_type: string
name: retrieve_data
arguments: data_tag: D43
data_type: string
name: retrieve_data
arguments: data_tag: D83
data_type: string
name: retrieve_data
arguments: data_tag: D96
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D74
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D40
data_type: byte[8]
name: retrieve_data
arguments: data_tag: D49
data_type: string
name: retrieve_data
arguments: data_tag: D61
data_type: string
name: retrieve_data
arguments: data_tag: D101
data_type: string

tool: D104: w

tool: D50: out.csv

tool: D25: Cannot allocate memory for y

tool: D43: Failed to allocate memory.

tool: D83: %f,%f


tool: {"D96": [0x00,0x00,0x00,0x00,0x00,0x80,0x66,0x40]}

tool: {"D74": [0x00,0x00,0x00,0x00,0x00,0x00,0x59,0x40]}

tool: {"D40": [0x00,0x00,0x00,0x00,0x00,0xc0,0x72,0x40]}

tool: D49: Cannot allocate memory for x

tool: D61: Failed to close file.

tool: D101: Failed to open file for writing.

assistant: ```c
int output_data() {
  double min, max;
  int points, i;
  const char *file = "out.csv";
  FILE *fp;
  double *x, *y;
  min = 0;
  max = 0;
  points = 0;
  i = 0;
  fp = NULL;
  x = NULL;
  y = NULL;
  fp = fopen(file, "w");
  if (!fp) {
    report_error("Failed to open file for writing.");
  }
  min = 300;
  max = 480;
  points = 100;
  x = (double *)malloc(sizeof(double) * points);
  y = (double *)malloc(sizeof(double) * points);
  if (x == NULL) {
    report_error("Cannot allocate memory for x");
    exit(1);
  }
  if (y == NULL) {
    report_error("Cannot allocate memory for y");
    exit(1);
  }
  if (x || y == NULL) {
    report_error("Failed to allocate memory.");
    exit(1);
  }
  for (i = 1; i <= points; i++) {
    x[i] = min + (max - min) * i / points;
    fprintf(fp, "%f,%f\n", x[i], y[i]);
  }
  if (fp) {
    if (fclose(fp) != 0) {
      report_error("Failed to close file.");
      exit(1);
    }
  }
  free(x);
  free(y);
  return 0;
}
```