user: Converte this assembly snippet into its equivalent C code:

```asm
<matprod_mat_mat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x4c(%rbp)
  mov    %r8d,-0x50(%rbp)
  mov    %r9d,-0x54(%rbp)
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  cmpl   $0x1,-0x50(%rbp)
  jg     L24
  cmpl   $0x1,-0x50(%rbp)
  jne    L120
  mov    -0x54(%rbp),%edi
  mov    -0x4c(%rbp),%ecx
  mov    -0x48(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <matprod_outer@plt>
  jmp    L110
L120:
  mov    -0x4c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x54(%rbp),%eax
  cltq
  imul   %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <set_to_zeros@plt>
  jmp    L110
L24:
  cmpl   $0x2,-0x4c(%rbp)
  jg     L15
  cmpl   $0x2,-0x4c(%rbp)
  jne    L66
  mov    -0x54(%rbp),%edi
  mov    -0x50(%rbp),%ecx
  mov    -0x48(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <matprod_mat_mat_n2@plt>
  jmp    L59
L66:
  cmpl   $0x1,-0x4c(%rbp)
  jne    L59
  mov    -0x54(%rbp),%edi
  mov    -0x50(%rbp),%ecx
  mov    -0x48(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <matprod_vec_mat@plt>
  jmp    L59
L15:
  cmpl   $0x1,-0x54(%rbp)
  jg     L29
  cmpl   $0x1,-0x54(%rbp)
  jne    L184
  mov    -0x50(%rbp),%edi
  mov    -0x4c(%rbp),%ecx
  mov    -0x48(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <matprod_mat_vec@plt>
  jmp    L184
L29:
  cmpl   $0x3c0,-0x4c(%rbp)
  jg     L214
  cmpl   $0x20,-0x50(%rbp)
  jg     L214
  mov    -0x54(%rbp),%r9d
  mov    -0x50(%rbp),%r8d
  mov    -0x4c(%rbp),%ecx
  mov    -0x48(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  push   $0x0
  mov    -0x50(%rbp),%edi
  push   %rdi
  mov    -0x4c(%rbp),%edi
  push   %rdi
  mov    -0x4c(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <matprod_mat_mat_sub_xrowscols@plt>
  add    $0x20,%rsp
  jmp    L110
L214:
  cmpl   $0x3c0,-0x4c(%rbp)
  jle    L203
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x50(%rbp),%xmm1
  movsd  D9(%rip),%xmm0
  addsd  %xmm0,%xmm1
  movsd  D11(%rip),%xmm0
  divsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  add    $0x1,%eax
  jmp    L264
L203:
  mov    -0x54(%rbp),%eax
L264:
  mov    %eax,-0x18(%rbp)
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x24(%rbp)
L43:
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jle    L28
  mov    -0x18(%rbp),%eax
  add    %eax,%eax
  cmp    %eax,-0x24(%rbp)
  jge    L250
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  jmp    L63
L250:
  mov    -0x18(%rbp),%eax
L63:
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  add    $0x7,%eax
  and    $0xfffffff8,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L28
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L28:
  cmpl   $0x3c0,-0x20(%rbp)
  jle    L92
  jmp    L25
L181:
  mov    -0x1c(%rbp),%r9d
  mov    -0x50(%rbp),%r8d
  mov    -0x4c(%rbp),%ecx
  mov    -0x8(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x10(%rbp),%rax
  mov    -0x4c(%rbp),%edi
  push   %rdi
  push   $0x3c0
  mov    %rax,%rdi
  call   <matprod_mat_mat_sub_xrows@plt>
  add    $0x10,%rsp
  addq   $0x1e00,-0x10(%rbp)
  addq   $0x1e00,-0x8(%rbp)
  subl   $0x3c0,-0x20(%rbp)
L25:
  cmpl   $0x77f,-0x20(%rbp)
  jg     L181
  cmpl   $0x3c0,-0x20(%rbp)
  jle    L92
  mov    -0x20(%rbp),%eax
  add    $0x3,%eax
  sar    %eax
  and    $0xfffffffc,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x1c(%rbp),%r9d
  mov    -0x50(%rbp),%r8d
  mov    -0x4c(%rbp),%ecx
  mov    -0x8(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x10(%rbp),%rax
  mov    -0x4c(%rbp),%edi
  push   %rdi
  mov    -0x14(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <matprod_mat_mat_sub_xrows@plt>
  add    $0x10,%rsp
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  sub    %eax,-0x20(%rbp)
L92:
  mov    -0x1c(%rbp),%r9d
  mov    -0x50(%rbp),%r8d
  mov    -0x4c(%rbp),%ecx
  mov    -0x8(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x10(%rbp),%rax
  mov    -0x4c(%rbp),%edi
  push   %rdi
  mov    -0x20(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <matprod_mat_mat_sub_xrows@plt>
  add    $0x10,%rsp
  mov    -0x1c(%rbp),%eax
  sub    %eax,-0x24(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L40
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%eax
  cltq
  imul   %rdx,%rax
  shl    $0x3,%rax
  add    %rax,-0x40(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  imul   %rdx,%rax
  shl    $0x3,%rax
  add    %rax,-0x48(%rbp)
  jmp    L43
L59:
  nop
  jmp    L110
L184:
  nop
  jmp    L110
L40:
  nop
L110:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D9
type_infered: byte[8]
name: read_data
arguments: label: D11
type_infered: byte[8]

tool: {"D9": [0x00,0x00,0x00,0x00,0x00,0x00,0x8e,0x40]}

tool: {"D11": [0x00,0x00,0x00,0x00,0x80,0x31,0xf7,0x40]}

assistant: ```c
void matprod_mat_mat(double *restrict x, double *restrict y, double *restrict z, int n, int k, int m) {
  assert(((uintptr_t)(x) & (1 - 1)) == 0);
  assert(((uintptr_t)(y) & (1 - 1)) == 0);
  assert(((uintptr_t)(z) & (1 - 1)) == 0);
  x = (x);
  y = (y);
  z = (z);
  if (k <= 1) {
    if (k == 1) {
      matprod_outer(x, y, z, n, m);
    } else {
      set_to_zeros(z, (size_t)n * m);
    }
    return;
  }
  if (n <= 2) {
    if (n == 2) {
      matprod_mat_mat_n2(x, y, z, k, m);
    } else if (n == 1) {
      matprod_vec_mat(x, y, z, k, m);
    }
    return;
  }
  if (m <= 1) {
    if (m == 1) {
      matprod_mat_vec(x, y, z, n, k);
    }
    return;
  }
  if (n <= (1024 - 64) && k <= 32) {
    matprod_mat_mat_sub_xrowscols(x, y, z, n, k, m, n, n, k, 0);
    return;
  }
  int cachable = n <= (1024 - 64) ? m : 1 + (int)(95000 / ((1024 - 64) + (double)k));
  int mm = m;
  for (;;) {
    double *xx = x;
    double *zz = z;
    int xrows = n;
    int m1 = mm;
    if (m1 > cachable) {
      m1 = mm < 2 * cachable ? mm / 2 : cachable;
      m1 = (m1 + 7) & ~7;
      if (m1 > mm)
        m1 = mm;
    }
    if (xrows > (1024 - 64)) {
      while (xrows >= 2 * (1024 - 64)) {
        matprod_mat_mat_sub_xrows(xx, y, zz, n, k, m1, (1024 - 64), n);
        xx += (1024 - 64);
        zz += (1024 - 64);
        xrows -= (1024 - 64);
      }
      if (xrows > (1024 - 64)) {
        int nr = (((xrows + 3) >> 1) & ~3);
        matprod_mat_mat_sub_xrows(xx, y, zz, n, k, m1, nr, n);
        xx += nr;
        zz += nr;
        xrows -= nr;
      }
    }
    matprod_mat_mat_sub_xrows(xx, y, zz, n, k, m1, xrows, n);
    mm -= m1;
    if (mm == 0)
      break;
    y += (size_t)m1 * k;
    z += (size_t)m1 * n;
  }
}
```