user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<readxyz_ex>:
  endbr64
  push   %r15
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  mov    %r8,%r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %rdi,0x18(%rsp)
  mov    0x150(%rsp),%r13d
  mov    %rdx,(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %r9,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsi)
  lea    D1(%rip),%rsi
  movq   $0x0,(%rdx)
  movq   $0x0,(%rcx)
  movl   $0x0,(%r8)
  call   <fopen@plt>
  test   %rax,%rax
  je     L300
  mov    %rax,%rbp
  lea    0x40(%rsp),%rbx
  lea    0x20(%rsp),%r15
  test   %r13d,%r13d
  jne    L310
  nopl   0x0(%rax)
L81:
  mov    %rbp,%rdx
  mov    $0xc7,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L75
  mov    %rbx,%rdi
  call   <clean_line@plt>
  mov    $0x3,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <string_read_doubles@plt>
  cmp    $0x3,%eax
  jne    L81
  addl   $0x1,(%r12)
  jmp    L81
  nopl   0x0(%rax)
L298:
  addl   $0x1,(%r12)
L310:
  mov    %rbp,%rdx
  mov    $0xc7,%esi
  mov    %rbx,%rdi
  call   <get_line_cf@plt>
  test   %rax,%rax
  je     L75
  mov    %rbx,%rdi
  call   <clean_line@plt>
  mov    $0x3,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <string_read_doubles@plt>
  cmp    $0x3,%eax
  jne    L310
  jmp    L298
  nopl   0x0(%rax)
L75:
  mov    %rbp,%rdi
  call   <fclose@plt>
  movslq (%r12),%r15
  test   %r15d,%r15d
  jne    L274
  cmpq   $0x0,0x10(%rsp)
  je     L244
  mov    0x18(%rsp),%rdx
  mov    0x10(%rsp),%rdi
  lea    D44(%rip),%rsi
  call   <fprintf@plt>
  jmp    L24
  nopl   0x0(%rax)
L124:
  mov    %rbp,%rdi
  call   <fclose@plt>
  cmp    %r13d,(%r12)
  jne    L69
L244:
  xor    %r15d,%r15d
L24:
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L281
  add    $0x118,%rsp
  mov    %r15d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L274:
  lea    (%r15,%r15,2),%rsi
  lea    D29(%rip),%rdx
  mov    %r14,%rdi
  shl    $0x3,%rsi
  call   <willus_mem_alloc@plt>
  test   %eax,%eax
  je     L200
  movslq (%r12),%rdx
  mov    (%r14),%rax
  lea    D1(%rip),%rsi
  mov    (%rsp),%rcx
  mov    0x18(%rsp),%rdi
  shl    $0x3,%rdx
  add    %rdx,%rax
  mov    %rax,(%rcx)
  mov    0x8(%rsp),%rcx
  add    %rdx,%rax
  mov    %rax,(%rcx)
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L69
  test   %r13d,%r13d
  jne    L13
  lea    0x20(%rsp),%r15
  nopw   0x0(%rax,%rax,1)
L254:
  mov    %rbp,%rdx
  mov    $0xc7,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L124
  mov    %rbx,%rdi
  call   <clean_line@plt>
  mov    $0x3,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <string_read_doubles@plt>
  cmp    $0x3,%eax
  jne    L254
  cmp    (%r12),%r13d
  jge    L292
  mov    (%r14),%rdx
  movsd  0x20(%rsp),%xmm0
  movslq %r13d,%rax
  add    $0x1,%r13d
  mov    (%rsp),%rcx
  movsd  %xmm0,(%rdx,%rax,8)
  movsd  0x28(%rsp),%xmm0
  mov    (%rcx),%rdx
  mov    0x8(%rsp),%rcx
  movsd  %xmm0,(%rdx,%rax,8)
  mov    (%rcx),%rdx
  movsd  0x30(%rsp),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  jmp    L254
  nopl   0x0(%rax)
L13:
  xor    %r13d,%r13d
  lea    0x20(%rsp),%r15
  nopl   0x0(%rax,%rax,1)
L127:
  mov    %rbp,%rdx
  mov    $0xc7,%esi
  mov    %rbx,%rdi
  call   <get_line_cf@plt>
  test   %rax,%rax
  je     L124
  mov    %rbx,%rdi
  call   <clean_line@plt>
  mov    $0x3,%edx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <string_read_doubles@plt>
  cmp    $0x3,%eax
  jne    L127
  cmp    %r13d,(%r12)
  jle    L292
  mov    (%r14),%rdx
  movsd  0x20(%rsp),%xmm0
  movslq %r13d,%rax
  add    $0x1,%r13d
  mov    (%rsp),%rcx
  movsd  %xmm0,(%rdx,%rax,8)
  movsd  0x28(%rsp),%xmm0
  mov    (%rcx),%rdx
  mov    0x8(%rsp),%rcx
  movsd  %xmm0,(%rdx,%rax,8)
  mov    (%rcx),%rdx
  movsd  0x30(%rsp),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  jmp    L127
  nopl   0x0(%rax,%rax,1)
L292:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r14,%rdi
  call   <freexyz@plt>
  mov    0x10(%rsp),%rdi
  test   %rdi,%rdi
  je     L275
  mov    0x18(%rsp),%rdx
  lea    D31(%rip),%rsi
  call   <fprintf@plt>
L275:
  mov    $0xfffffffd,%r15d
  jmp    L24
L69:
  mov    %r14,%rdi
  mov    $0xfffffffd,%r15d
  call   <freexyz@plt>
  mov    0x10(%rsp),%rdi
  test   %rdi,%rdi
  je     L24
  mov    0x18(%rsp),%rdx
  lea    D31(%rip),%rsi
  call   <fprintf@plt>
  jmp    L24
L200:
  mov    0x10(%rsp),%rdi
  mov    $0xffffffff,%r15d
  test   %rdi,%rdi
  je     L24
  mov    0x18(%rsp),%rdx
  lea    D33(%rip),%rsi
  call   <fprintf@plt>
  jmp    L24
L300:
  mov    0x10(%rsp),%rdi
  mov    $0xfffffffe,%r15d
  test   %rdi,%rdi
  je     L24
  mov    0x18(%rsp),%rdx
  lea    D30(%rip),%rsi
  call   <fprintf@plt>
  jmp    L24
L281:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D1
data_type: string
name: read_data
arguments: tag: D44
data_type: string
name: read_data
arguments: tag: D29
data_type: string
name: read_data
arguments: tag: D31
data_type: string
name: read_data
arguments: tag: D33
data_type: string
name: read_data
arguments: tag: D30
data_type: string

tool: D1: r

tool: D44: There are no array triplets in file %s.


tool: D29: readxyz

tool: D31: Internal error re-reading file %s.


tool: D33: There is not enough memory to read in file %s.


tool: D30: Cannot open file %s for reading array triplets.


assistant: ```c
int readxyz_ex(char *filename, double **x, double **y, double **z, int *n, FILE *output, int ignore_after_semicolon) {
  FILE *f;
  static char *notenough = "There is not enough memory to read in file %s.\n";
  static char *internal = "Internal error re-reading file %s.\n";
  char buf[200];
  long memsize;
  int i;
  size_t memsizest;
  static char *funcname = "readxyz";
  (*x) = NULL;
  (*y) = NULL;
  (*z) = NULL;
  (*n) = 0;
  f = fopen(filename, "r");
  if (f == NULL) {
    if (output != NULL)
      fprintf(output, "Cannot open file %s for reading array triplets.\n", filename);
    return (-2);
  }
  while (1) {
    void *ptr;
    double v[3];
    if (ignore_after_semicolon)
      ptr = get_line_cf(buf, 199, f);
    else
      ptr = fgets(buf, 199, f);
    if (ptr == NULL)
      break;
    clean_line(buf);
    if (string_read_doubles(buf, v, 3) == 3)
      (*n)++;
  }
  fclose(f);
  if ((*n) == 0) {
    if (output != NULL)
      fprintf(output, "There are no array triplets in file %s.\n", filename);
    return (0);
  }
  memsize = (long)sizeof(double) * (*n) * 3L;
  memsizest = (size_t)memsize;
  if (memsize != memsizest) {
    if (output != NULL)
      fprintf(output, notenough, filename);
    return (-1);
  }
  if (!willus_mem_alloc(x, memsizest, funcname)) {
    if (output != NULL)
      fprintf(output, notenough, filename);
    return (-1);
  }
  (*y) = &(*x)[(*n)];
  (*z) = &(*y)[(*n)];
  i = 0;
  f = fopen(filename, "r");
  if (f == NULL) {
    freexyz(x);
    if (output != NULL)
      fprintf(output, internal, filename);
    return (-3);
  }
  while (1) {
    double v[3];
    void *ptr;
    if (ignore_after_semicolon)
      ptr = get_line_cf(buf, 199, f);
    else
      ptr = fgets(buf, 199, f);
    if (ptr == NULL)
      break;
    clean_line(buf);
    if (string_read_doubles(buf, v, 3) == 3) {
      if (i >= (*n)) {
        fclose(f);
        freexyz(x);
        if (output != NULL)
          fprintf(output, internal, filename);
        return (-3);
      }
      (*x)[i] = v[0];
      (*y)[i] = v[1];
      (*z)[i] = v[2];
      i++;
    }
  }
  fclose(f);
  if (i != (*n)) {
    freexyz(x);
    if (output != NULL)
      fprintf(output, internal, filename);
    return (-3);
  }
  return (0);
}
```