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

```asm
<readx>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xe8,%rsp
  mov    %rdi,(%rsp)
  mov    %rsi,%r13
  mov    %rdx,%r12
  mov    %rcx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsi)
  movl   $0x0,(%rdx)
  lea    D76(%rip),%rsi
  call   <fopen@plt>
  test   %rax,%rax
  je     L91
  mov    %rax,%rbp
  lea    0x10(%rsp),%rbx
L128:
  mov    %rbp,%rdx
  mov    $0xc7,%esi
  mov    %rbx,%rdi
  call   <get_line_cf@plt>
  test   %rax,%rax
  je     L195
  mov    %rbx,%rdi
  call   <clean_line@plt>
  mov    %rbx,%rdi
  call   <is_a_number@plt>
  test   %rax,%rax
  je     L128
  addl   $0x1,(%r12)
  jmp    L128
L91:
  mov    $0xfffffffe,%ebx
  mov    0x8(%rsp),%rdi
  test   %rdi,%rdi
  je     L138
  mov    (%rsp),%rdx
  lea    D64(%rip),%rsi
  call   <fprintf@plt>
  jmp    L138
L195:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    (%r12),%ebx
  test   %ebx,%ebx
  jne    L108
  mov    0x8(%rsp),%rdi
  test   %rdi,%rdi
  je     L138
  mov    (%rsp),%rdx
  lea    D51(%rip),%rsi
  call   <fprintf@plt>
  jmp    L138
L108:
  movslq %ebx,%rsi
  shl    $0x3,%rsi
  lea    D74(%rip),%rdx
  mov    %r13,%rdi
  call   <willus_mem_alloc@plt>
  test   %eax,%eax
  je     L123
  lea    D76(%rip),%rsi
  mov    (%rsp),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L39
  mov    $0x0,%r14d
  lea    0x10(%rsp),%rbx
L245:
  mov    %r14d,%r15d
L177:
  mov    %rbp,%rdx
  mov    $0xc7,%esi
  mov    %rbx,%rdi
  call   <get_line_cf@plt>
  test   %rax,%rax
  je     L160
  mov    %rbx,%rdi
  call   <clean_line@plt>
  mov    %rbx,%rdi
  call   <is_a_number@plt>
  test   %rax,%rax
  je     L177
  cmp    %r14d,(%r12)
  jle    L103
  mov    0x0(%r13),%rax
  lea    (%rax,%r14,8),%r15
  mov    %rbx,%rdi
  call   <atof@plt>
  movsd  %xmm0,(%r15)
  add    $0x1,%r14
  jmp    L245
L123:
  mov    $0xffffffff,%ebx
  mov    0x8(%rsp),%rdi
  test   %rdi,%rdi
  je     L138
  mov    (%rsp),%rdx
  lea    D23(%rip),%rsi
  call   <fprintf@plt>
  jmp    L138
L39:
  mov    %r13,%rdi
  call   <freex@plt>
  mov    $0xfffffffd,%ebx
  mov    0x8(%rsp),%rdi
  test   %rdi,%rdi
  je     L138
  mov    (%rsp),%rdx
  lea    D10(%rip),%rsi
  call   <fprintf@plt>
  jmp    L138
L103:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r13,%rdi
  call   <freex@plt>
  mov    $0xfffffffd,%ebx
  mov    0x8(%rsp),%rdi
  test   %rdi,%rdi
  je     L138
  mov    (%rsp),%rdx
  lea    D10(%rip),%rsi
  call   <fprintf@plt>
  jmp    L138
L160:
  mov    %rbp,%rdi
  call   <fclose@plt>
  cmp    (%r12),%r15d
  jne    L174
  mov    $0x0,%ebx
L138:
  mov    0xd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L16
  mov    %ebx,%eax
  add    $0xe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L174:
  mov    %r13,%rdi
  call   <freexy@plt>
  mov    $0xfffffffd,%ebx
  mov    0x8(%rsp),%rdi
  test   %rdi,%rdi
  je     L138
  mov    (%rsp),%rdx
  lea    D10(%rip),%rsi
  call   <fprintf@plt>
  jmp    L138
L16:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D76
data_type: string
name: unpack_data
arguments: tag: D64
data_type: string
name: unpack_data
arguments: tag: D51
data_type: string
name: unpack_data
arguments: tag: D74
data_type: string
name: unpack_data
arguments: tag: D23
data_type: string
name: unpack_data
arguments: tag: D10
data_type: string

tool: D76: r

tool: D64: Cannot open file %s for reading array pairs.


tool: D51: There are no array pairs in file %s.


tool: D74: readx

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


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


assistant: ```c
int readx(char *filename, double **x, int *n, FILE *output) {
  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 = "readx";
  (*x) = NULL;
  (*n) = 0;
  f = fopen(filename, "r");
  if (f == NULL) {
    if (output != NULL)
      fprintf(output, "Cannot open file %s for reading array pairs.\n", filename);
    return (-2);
  }
  while (get_line_cf(buf, 199, f) != NULL) {
    clean_line(buf);
    if (is_a_number(buf))
      (*n)++;
  }
  fclose(f);
  if ((*n) == 0) {
    if (output != NULL)
      fprintf(output, "There are no array pairs in file %s.\n", filename);
    return (0);
  }
  memsize = (long)sizeof(double) * (*n);
  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);
  }
  i = 0;
  f = fopen(filename, "r");
  if (f == NULL) {
    freex(x);
    if (output != NULL)
      fprintf(output, internal, filename);
    return (-3);
  }
  while (get_line_cf(buf, 199, f) != NULL) {
    clean_line(buf);
    if (is_a_number(buf)) {
      if (i >= (*n)) {
        fclose(f);
        freex(x);
        if (output != NULL)
          fprintf(output, internal, filename);
        return (-3);
      }
      (*x)[i] = atof(buf);
      i++;
    }
  }
  fclose(f);
  if (i != (*n)) {
    freexy(x);
    if (output != NULL)
      fprintf(output, internal, filename);
    return (-3);
  }
  return (0);
}
```