user: What is the c source code of the assembly code below:

```asm
<mat_prod>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8d,-0x3c(%rbp)
  mov    %r9d,-0x40(%rbp)
  mov    -0x30(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  je     L53
  lea    D16(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L53:
  cmpq   $0x0,-0x28(%rbp)
  je     L93
  cmpq   $0x0,-0x38(%rbp)
  jne    L56
L93:
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L56:
  mov    -0x2c(%rbp),%eax
  imul   -0x40(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L78
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <die@plt>
L78:
  movl   $0x0,-0x14(%rbp)
  jmp    L44
L17:
  movl   $0x0,-0x10(%rbp)
  jmp    L37
L98:
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  movl   $0x0,-0xc(%rbp)
  jmp    L6
L23:
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x14(%rbp),%eax
  imul   -0x30(%rbp),%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xc(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%esi
  mov    -0x10(%rbp),%eax
  add    %esi,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x38(%rbp),%rax
  add    %rsi,%rax
  mov    (%rax),%eax
  imul   %eax,%edx
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%esi
  mov    -0x10(%rbp),%eax
  add    %esi,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x8(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rax,%rcx
  movslq %edx,%rax
  imul   $0x3ee4f99d,%rax,%rax
  shr    $0x20,%rax
  sar    $0x7,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  imul   $0x209,%eax,%esi
  mov    %edx,%eax
  sub    %esi,%eax
  mov    %eax,(%rcx)
  addl   $0x1,-0xc(%rbp)
L6:
  mov    -0xc(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L23
  addl   $0x1,-0x10(%rbp)
L37:
  mov    -0x10(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L98
  addl   $0x1,-0x14(%rbp)
L44:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L17
  mov    -0x8(%rbp),%rax
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D16
type_guessed: string
name: retrieve_data
arguments: tag: D9
type_guessed: string
name: retrieve_data
arguments: tag: D12
type_guessed: string

tool: D16: tried to multiply matrices with mismatched dimensions.

tool: D9: tried to matrix-multiply a null pointer.

tool: D12: malloc fail.

assistant: ```c
int *mat_prod(int x[], int xrows, int xcols, int y[], int yrows, int ycols) {
  int i;
  int j;
  int k;
  int *z;
  if (xcols != yrows) {
    die("tried to multiply matrices with mismatched dimensions.");
  }
  if ((x == NULL) || (y == NULL)) {
    die("tried to matrix-multiply a null pointer.");
  }
  z = malloc(xrows * ycols * sizeof(int));
  if (z == NULL) {
    die("malloc fail.");
  }
  for (i = 0; i < xrows; i++) {
    for (j = 0; j < ycols; j++) {
      z[i * ycols + j] = 0;
      for (k = 0; k < xcols; k++) {
        z[i * ycols + j] += x[i * xcols + k] * y[k * ycols + j];
        z[i * ycols + j] %= 521;
      }
    }
  }
  return z;
}
```