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

```asm
<load_matrix>:
  endbr64
  push   %r15
  push   %r14
  lea    D19(%rip),%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  lea    D32(%rip),%r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x58,%rsp
  mov    %rdx,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  jmp    L106
  nopl   (%rax)
L33:
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <printf@plt>
L106:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L33
  lea    D20(%rip),%r12
  mov    %rax,%rdi
  xor    %eax,%eax
  lea    0x2c(%rsp),%rdx
  mov    %r12,%rsi
  lea    D37(%rip),%rbx
  call   <fscanf@plt>
  lea    0x30(%rsp),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fscanf@plt>
  lea    0x34(%rsp),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fscanf@plt>
  lea    0x38(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fscanf@plt>
  lea    0x40(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fscanf@plt>
  mov    0x2c(%rsp),%eax
  mov    %eax,0x0(%r13)
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  mov    %rax,%r13
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L95
  xor    %r12d,%r12d
  nopl   (%rax)
L141:
  mov    0x30(%rsp),%eax
  add    $0x1,%r12d
  add    $0x8,%r13
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%r13)
  mov    0x2c(%rsp),%eax
  cmp    %r12d,%eax
  jg     L141
L95:
  movq   $0x0,0x8(%rsp)
  mov    0x34(%rsp),%edi
  test   %edi,%edi
  jle    L13
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    0x2c(%rsp),%esi
  mov    %rax,0x8(%rsp)
  test   %esi,%esi
  jle    L13
  mov    %rax,%r13
  xor    %r12d,%r12d
L89:
  mov    0x34(%rsp),%eax
  add    $0x1,%r12d
  add    $0x8,%r13
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%r13)
  cmp    %r12d,0x2c(%rsp)
  jg     L89
L13:
  mov    0x10(%rsp),%rax
  sub    0x8(%rsp),%rax
  mov    %rax,(%rsp)
L136:
  mov    %rbp,%rdi
  call   <feof@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  jne    L53
L9:
  mov    0x2c(%rsp),%eax
  mov    0x8(%rsp),%r12
  test   %eax,%eax
  jle    L136
  cs nopw 0x0(%rax,%rax,1)
L70:
  mov    (%rsp),%rax
  mov    0x30(%rsp),%edx
  xor    %r15d,%r15d
  lea    (%rax,%r12,1),%r14
  test   %edx,%edx
  jle    L143
  nopl   0x0(%rax,%rax,1)
L79:
  mov    (%r14),%rax
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  lea    (%rax,%r15,8),%rdx
  xor    %eax,%eax
  add    $0x1,%r15
  call   <fscanf@plt>
  cmp    %r15d,0x30(%rsp)
  jg     L79
L143:
  mov    0x34(%rsp),%ecx
  test   %ecx,%ecx
  jle    L27
  xor    %r14d,%r14d
  nopw   0x0(%rax,%rax,1)
L107:
  mov    (%r12),%rax
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  lea    (%rax,%r14,8),%rdx
  xor    %eax,%eax
  add    $0x1,%r14
  call   <fscanf@plt>
  cmp    %r14d,0x34(%rsp)
  jg     L107
L27:
  add    $0x1,%r13d
  add    $0x8,%r12
  cmp    %r13d,0x2c(%rsp)
  jg     L70
  mov    %rbp,%rdi
  call   <feof@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  je     L9
L53:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x18(%rsp),%rax
  mov    0x10(%rsp),%rcx
  mov    %rcx,(%rax)
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L121
  mov    0x8(%rsp),%rax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L121:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D19
data_type: string
name: read_data
arguments: data_label: D32
data_type: string
name: read_data
arguments: data_label: D20
data_type: string
name: read_data
arguments: data_label: D37
data_type: string

tool: D19: File %s Not Found!!


tool: D32: r

tool: D20: %d

tool: D37: %lf

assistant: ```c
double **load_matrix(const char *file_name, int *num_inputs, double ***m_inputs) {
  FILE *fd;
  int file_found;
  double **outputs = NULL;
  double **inputs = NULL;
  int r, c_input, c_output;
  double min, max;
  int a, b;
  do {
    fd = fopen(file_name, "r");
    if (!fd) {
      printf("File %s Not Found!!\n", file_name);
      file_found = 1;
    } else
      file_found = 0;
  } while (file_found);
  fscanf(fd, "%d", &r);
  fscanf(fd, "%d", &c_input);
  fscanf(fd, "%d", &c_output);
  fscanf(fd, "%lf", &min);
  fscanf(fd, "%lf", &max);
  *num_inputs = r;
  inputs = (double **)malloc(r * sizeof(double));
  for (a = 0; a < r; a++) {
    inputs[a] = (double *)malloc(c_input * sizeof(double));
  }
  if (c_output > 0) {
    outputs = (double **)malloc(r * sizeof(double));
    for (a = 0; a < r; a++) {
      outputs[a] = (double *)malloc(c_output * sizeof(double));
    }
  }
  while (!feof(fd)) {
    for (a = 0; a < r; a++) {
      for (b = 0; b < c_input; b++) {
        fscanf(fd, "%lf", &inputs[a][b]);
      }
      for (b = 0; b < c_output; b++) {
        fscanf(fd, "%lf", &outputs[a][b]);
      }
    }
  }
  fclose(fd);
  *m_inputs = inputs;
  return outputs;
}
```