user: Please show me the C implementation that matches the assembly code listed below:

```asm
<output_data>:
  endbr64
  push   %r15
  lea    D18(%rip),%rsi
  lea    D21(%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     L67
L1:
  mov    $0x320,%edi
  call   <malloc@plt>
  mov    $0x320,%edi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  test   %r13,%r13
  je     L48
  cmpq   $0x0,0x8(%rsp)
  jne    L72
L81:
  lea    D61(%rip),%rdi
  call   <report_error@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L72:
  lea    D25(%rip),%rdi
  call   <report_error@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L47:
  mov    0x8(%rsp),%rbx
  lea    0x8(%r13),%r14
  mov    $0x1,%r15d
  lea    D77(%rip),%r12
  sub    %r13,%rbx
  nopl   0x0(%rax,%rax,1)
L76:
  pxor   %xmm0,%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  cvtsi2sd %r15d,%xmm0
  mulsd  D47(%rip),%xmm0
  add    $0x1,%r15d
  divsd  D37(%rip),%xmm0
  addsd  D76(%rip),%xmm0
  movsd  %xmm0,(%r14)
  movsd  (%rbx,%r14,1),%xmm1
  add    $0x8,%r14
  call   <fprintf@plt>
  cmp    $0x65,%r15d
  jne    L76
  test   %rbp,%rbp
  je     L75
  mov    %rbp,%rdi
  call   <fclose@plt>
  test   %rax,%rax
  jne    L83
L75:
  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
L48:
  lea    D16(%rip),%rdi
  call   <report_error@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  cmpq   $0x0,0x8(%rsp)
  jne    L47
  jmp    L81
  nopl   0x0(%rax)
L83:
  lea    D33(%rip),%rdi
  call   <report_error@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L75
L67:
  lea    D42(%rip),%rdi
  call   <report_error@plt>
  jmp    L1
```

tool_calls: name: read_data
arguments: data_label: D18
data_type: string
name: read_data
arguments: data_label: D21
data_type: string
name: read_data
arguments: data_label: D61
data_type: string
name: read_data
arguments: data_label: D25
data_type: string
name: read_data
arguments: data_label: D77
data_type: string
name: read_data
arguments: data_label: D47
data_type: byte[8]
name: read_data
arguments: data_label: D37
data_type: byte[8]
name: read_data
arguments: data_label: D76
data_type: byte[8]
name: read_data
arguments: data_label: D16
data_type: string
name: read_data
arguments: data_label: D33
data_type: string
name: read_data
arguments: data_label: D42
data_type: string

tool: D18: w

tool: D21: out.csv

tool: D61: Cannot allocate memory for y

tool: D25: Failed to allocate memory.

tool: D77: %f,%f


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

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

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

tool: D16: Cannot allocate memory for x

tool: D33: Failed to close file.

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