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

```asm
<read_n_columns>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  mov    $0x3a,%edx
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  lea    0x18(%rsp),%rsi
  call   <str_parseline@plt>
  mov    %eax,0x0(%rbp)
  cmp    $0x1,%eax
  jle    L12
  sub    $0x1,%eax
  mov    $0xffffffff,%r12d
  mov    %eax,0x0(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdi
  xor    %eax,%eax
  call   <xmalloc@plt>
  cltq
  mov    %rax,0x0(%r13)
  mov    0x0(%rbp),%eax
  test   %eax,%eax
  jle    L17
  mov    0x18(%rsp),%rax
  lea    0x20(%rsp),%r14
  xor    %ebx,%ebx
  mov    $0x8,%r15d
  mov    0x8(%rax),%rdi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    %r14,%rdx
  mov    %eax,%esi
  mov    0x18(%rsp),%rax
  mov    (%rax),%rdi
  xor    %eax,%eax
  call   <read_column@plt>
  mov    %eax,%r12d
  jmp    L47
  nopw   0x0(%rax,%rax,1)
L42:
  mov    0x18(%rsp),%rax
  add    $0x8,%r15
  mov    (%rax,%r15,1),%rdi
  xor    %eax,%eax
  call   <atoi@plt>
  mov    %r14,%rdx
  mov    %eax,%esi
  mov    0x18(%rsp),%rax
  mov    (%rax),%rdi
  xor    %eax,%eax
  call   <read_column@plt>
  mov    %eax,%edx
  cmp    $0x1,%ebx
  jle    L33
  cmp    %r12d,%eax
  je     L33
  mov    %eax,0xc(%rsp)
  lea    D5(%rip),%rdi
  xor    %eax,%eax
  call   <error1@plt>
  mov    0xc(%rsp),%edx
L33:
  mov    %edx,%r12d
L47:
  mov    0x0(%r13),%rax
  mov    0x20(%rsp),%rdx
  add    $0x1,%ebx
  mov    %rdx,-0x8(%rax,%r15,1)
  mov    0x18(%rsp),%rax
  mov    (%rax,%r15,1),%rdi
  call   <free@plt>
  cmp    %ebx,0x0(%rbp)
  jg     L42
L17:
  mov    0x18(%rsp),%rax
  mov    (%rax),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
L63:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L24
  add    $0x38,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L12:
  mov    %r12,%rsi
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  mov    $0xffffffff,%r12d
  call   <warning1@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  jmp    L63
L24:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D5
datatype: string
name: parse_data
arguments: label: D12
datatype: string

tool: D5: different number of rows for different columns


tool: D12: invalid file:column1[:column2[:...]] specification '%s'


assistant: ```c
int read_n_columns(char *arg, int *n, double ***data) {
  char **L;
  int i, nr, nrec, ncol;
  double *dp;
  *n = str_parseline(arg, &L, ':');
  if (*n <= 1)
    goto invalid_format;
  (*n)--;
  *data = xmalloc(sizeof(double *) * (*n));
  nrec = -1;
  for (i = 0; i < (*n); i++) {
    ncol = atoi(L[i + 1]);
    nr = read_column(L[0], ncol, &dp);
    if (i > 1 && nr != nrec)
      error1("different number of rows for different columns\n");
    nrec = nr;
    (*data)[i] = dp;
    free(L[i + 1]);
  }
  free(L[0]);
  free(L);
  return nrec;
invalid_format:
  warning1("invalid file:column1[:column2[:...]] specification '%s'\n", arg);
  free(L);
  return -1;
}
```