user: Translate the below assembly code into C programming language:

```asm
<load_matrix_int>:
  endbr64
  push   %r15
  lea    D25(%rip),%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  lea    D39(%rip),%r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x38,%rsp
  mov    %rsi,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movl   $0x0,(%rsi)
  mov    %r15,%rsi
  movl   $0x0,(%rdx)
  call   <fopen@plt>
  mov    %rax,%r13
  jmp    L85
  cs nopw 0x0(%rax,%rax,1)
L36:
  mov    %r12,%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  add    $0x1,%ebp
  call   <fscanf@plt>
L85:
  mov    %r13,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L36
  mov    %r13,%rdi
  lea    D1(%rip),%r12
  call   <fclose@plt>
  mov    0x10(%rsp),%rax
  mov    %r14,%rdi
  mov    %r15,%rsi
  mov    %ebp,(%rax)
  xor    %ebp,%ebp
  call   <fopen@plt>
  mov    %rax,%rdi
  jmp    L17
  nopl   0x0(%rax)
L8:
  lea    0x24(%rsp),%r13
  mov    %r12,%rsi
  xor    %eax,%eax
  mov    %rdi,0x8(%rsp)
  mov    %r13,%rdx
  add    $0x1,%ebp
  call   <fscanf@plt>
  mov    0x8(%rsp),%rdi
L17:
  mov    %rdi,0x8(%rsp)
  call   <feof@plt>
  mov    0x8(%rsp),%rdi
  test   %eax,%eax
  je     L8
  call   <fclose@plt>
  mov    0x10(%rsp),%r12
  mov    %ebp,%eax
  mov    %r15,%rsi
  cltd
  mov    %r14,%rdi
  idivl  (%r12)
  mov    %eax,(%rbx)
  call   <fopen@plt>
  mov    %rax,%rbp
  mov    (%r12),%eax
  lea    0x0(,%rax,8),%edi
  mov    %eax,0x8(%rsp)
  call   <malloc@plt>
  mov    (%r12),%edx
  mov    %rax,0x18(%rsp)
  test   %edx,%edx
  jle    L68
  movl   $0x0,0x8(%rsp)
  mov    (%rbx),%edi
  mov    %rax,%r15
  lea    D1(%rip),%r12
L31:
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    (%rbx),%edi
  mov    %rax,(%r15)
  test   %edi,%edi
  jle    L1
  xor    %r14d,%r14d
  lea    0x24(%rsp),%r13
  nopl   0x0(%rax)
L12:
  mov    %r13,%rdx
  mov    %rbp,%rdi
  mov    %r12,%rsi
  xor    %eax,%eax
  call   <fscanf@plt>
  mov    (%r15),%rax
  mov    0x24(%rsp),%edx
  mov    %edx,(%rax,%r14,4)
  mov    (%rbx),%edi
  add    $0x1,%r14
  cmp    %r14d,%edi
  jg     L12
L1:
  mov    0x10(%rsp),%rcx
  addl   $0x1,0x8(%rsp)
  add    $0x8,%r15
  mov    0x8(%rsp),%eax
  cmp    %eax,(%rcx)
  jg     L31
L68:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L54
  mov    0x18(%rsp),%rax
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L54:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D25
datatype: string
name: retrieve_data
arguments: label: D39
datatype: string
name: retrieve_data
arguments: label: D1
datatype: string

tool: D25: r

tool: D39: %*[^
]%*[
]

tool: D1: %d

assistant: ```c
int **load_matrix_int(char *fname, int *N, int *dim) {
  FILE *f;
  int **x;
  int i, j, k;
  int tmp;
  *N = 0;
  *dim = 0;
  k = 0;
  f = fopen(fname, "r");
  while (!feof(f)) {
    i = fscanf(f, "%*[^\n]%*[\n]");
    k++;
  }
  fclose(f);
  *N = k;
  k = 0;
  f = fopen(fname, "r");
  while (!feof(f)) {
    i = fscanf(f, "%d", &tmp);
    k++;
  }
  fclose(f);
  *dim = (k / *N);
  f = fopen(fname, "r");
  x = malloc(*N * sizeof(double *));
  for (i = 0; i < *N; i++) {
    x[i] = malloc(*dim * sizeof(double));
    for (j = 0; j < *dim; j++) {
      k = fscanf(f, "%d", &tmp);
      x[i][j] = tmp;
    }
  }
  fclose(f);
  return x;
}
```