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

```asm
<load_matrix>:
  endbr64
  push   %r15
  push   %r14
  lea    D16(%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    L94
  nopl   (%rax)
L62:
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <printf@plt>
L94:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L62
  lea    D17(%rip),%r12
  mov    %rax,%rdi
  xor    %eax,%eax
  lea    0x2c(%rsp),%rdx
  mov    %r12,%rsi
  lea    D20(%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    L129
  xor    %r12d,%r12d
  nopl   (%rax)
L79:
  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     L79
L129:
  movq   $0x0,0x8(%rsp)
  mov    0x34(%rsp),%edi
  test   %edi,%edi
  jle    L135
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    0x2c(%rsp),%esi
  mov    %rax,0x8(%rsp)
  test   %esi,%esi
  jle    L135
  mov    %rax,%r13
  xor    %r12d,%r12d
L53:
  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     L53
L135:
  mov    0x10(%rsp),%rax
  sub    0x8(%rsp),%rax
  mov    %rax,(%rsp)
L119:
  mov    %rbp,%rdi
  call   <feof@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  jne    L76
L78:
  mov    0x2c(%rsp),%eax
  mov    0x8(%rsp),%r12
  test   %eax,%eax
  jle    L119
  cs nopw 0x0(%rax,%rax,1)
L84:
  mov    (%rsp),%rax
  mov    0x30(%rsp),%edx
  xor    %r15d,%r15d
  lea    (%rax,%r12,1),%r14
  test   %edx,%edx
  jle    L8
  nopl   0x0(%rax,%rax,1)
L6:
  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     L6
L8:
  mov    0x34(%rsp),%ecx
  test   %ecx,%ecx
  jle    L17
  xor    %r14d,%r14d
  nopw   0x0(%rax,%rax,1)
L82:
  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     L82
L17:
  add    $0x1,%r13d
  add    $0x8,%r12
  cmp    %r13d,0x2c(%rsp)
  jg     L84
  mov    %rbp,%rdi
  call   <feof@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  je     L78
L76:
  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    L21
  mov    0x8(%rsp),%rax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L21:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D16
data_type: string
name: disassemble_data
arguments: label: D32
data_type: string
name: disassemble_data
arguments: label: D17
data_type: string
name: disassemble_data
arguments: label: D20
data_type: string

tool: D16: File %s Not Found!!


tool: D32: r

tool: D17: %d

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