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

```asm
<load_matrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,%rbx
  mov    %rsi,%r14
  mov    %rdx,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    D36(%rip),%r12
  lea    D48(%rip),%r13
L109:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  jne    L66
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <printf@plt>
  jmp    L109
L66:
  lea    0x2c(%rsp),%rdx
  lea    D16(%rip),%rbx
  mov    %rbx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  lea    0x30(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  lea    0x34(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  lea    0x38(%rsp),%rdx
  lea    D21(%rip),%rbx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  lea    0x40(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  mov    0x2c(%rsp),%eax
  mov    %eax,(%r14)
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    %rax,0x10(%rsp)
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L16
  mov    $0x0,%ebx
L53:
  mov    0x30(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,(%r12)
  add    $0x1,%ebx
  mov    0x2c(%rsp),%eax
  add    $0x8,%r12
  cmp    %ebx,%eax
  jg     L53
L16:
  movq   $0x0,0x8(%rsp)
  cmpl   $0x0,0x34(%rsp)
  jle    L140
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    %rax,0x8(%rsp)
  cmpl   $0x0,0x2c(%rsp)
  jle    L140
  mov    $0x0,%r12d
L84:
  mov    0x34(%rsp),%eax
  lea    0x0(,%rax,8),%edi
  call   <malloc@plt>
  mov    %rax,(%rbx)
  add    $0x1,%r12d
  add    $0x8,%rbx
  cmp    %r12d,0x2c(%rsp)
  jg     L84
L140:
  lea    D21(%rip),%r12
  mov    0x10(%rsp),%rax
  sub    0x8(%rsp),%rax
  mov    %rax,(%rsp)
L59:
  mov    %rbp,%rdi
  call   <feof@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jne    L60
  mov    0x8(%rsp),%r13
  cmpl   $0x0,0x2c(%rsp)
  jg     L4
  jmp    L59
L67:
  mov    (%r14),%rax
  lea    (%rax,%rbx,8),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  add    $0x1,%rbx
  cmp    %ebx,0x30(%rsp)
  jg     L67
L69:
  cmpl   $0x0,0x34(%rsp)
  jle    L73
  mov    $0x0,%ebx
L92:
  mov    0x0(%r13),%rax
  lea    (%rax,%rbx,8),%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <fscanf@plt>
  add    $0x1,%rbx
  cmp    %ebx,0x34(%rsp)
  jg     L92
L73:
  add    $0x1,%r15d
  add    $0x8,%r13
  cmp    %r15d,0x2c(%rsp)
  jle    L59
L4:
  mov    (%rsp),%rax
  lea    (%rax,%r13,1),%r14
  mov    $0x0,%ebx
  cmpl   $0x0,0x30(%rsp)
  jg     L67
  jmp    L69
L60:
  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    L120
  mov    0x8(%rsp),%rax
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L120:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D36
data_type: string
name: extract_symbolic_data
arguments: tag: D48
data_type: string
name: extract_symbolic_data
arguments: tag: D16
data_type: string
name: extract_symbolic_data
arguments: tag: D21
data_type: string

tool: D36: r

tool: D48: File %s Not Found!!


tool: D16: %d

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