user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<matrix_multiply>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,%r14
  mov    %rsi,0x38(%rsp)
  mov    %rdx,%r13
  mov    %ecx,%ebx
  mov    %ecx,0x28(%rsp)
  mov    %r8d,%ebp
  mov    %r9d,%r15d
  mov    %ecx,%edx
  imul   %r8d,%edx
  shl    $0x3,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    %ebp,%eax
  or     %r15d,%eax
  or     %ebx,%eax
  and    $0x1f,%eax
  mov    %eax,0x40(%rsp)
  jne    L114
  test   %r15d,%r15d
  je     L54
  mov    %ebp,%eax
  shl    $0x5,%eax
  mov    %eax,0x2c(%rsp)
  mov    %r15d,%eax
  shl    $0x5,%eax
  mov    %eax,0x44(%rsp)
  mov    0x40(%rsp),%eax
  mov    %eax,0x4c(%rsp)
  mov    %eax,0x48(%rsp)
  mov    %r15d,%r12d
L152:
  mov    0x4c(%rsp),%eax
  mov    %rax,0x10(%rsp)
  cmpl   $0x0,0x28(%rsp)
  je     L21
  mov    0x40(%rsp),%eax
  mov    %eax,0x20(%rsp)
  mov    %eax,0x24(%rsp)
  mov    %eax,0x1c(%rsp)
  mov    0x48(%rsp),%eax
  mov    %rax,0x30(%rsp)
L74:
  mov    0x24(%rsp),%eax
  add    0x30(%rsp),%rax
  mov    0x38(%rsp),%rbx
  lea    (%rbx,%rax,8),%r15
  mov    0x20(%rsp),%eax
  mov    %rax,0x8(%rsp)
  test   %ebp,%ebp
  je     L101
  mov    0x40(%rsp),%ebx
L43:
  mov    %ebx,%eax
  mov    0x10(%rsp),%rcx
  lea    (%rcx,%rax,1),%rdx
  lea    0x0(%r13,%rdx,8),%rdx
  add    0x8(%rsp),%rax
  lea    (%r14,%rax,8),%rdi
  mov    %ebp,%r9d
  mov    %r12d,%r8d
  mov    %ebp,%ecx
  mov    %r15,%rsi
  call   <matrix_multiply_block@plt>
  add    $0x20,%ebx
  cmp    %ebx,%ebp
  ja     L43
L101:
  addl   $0x20,0x1c(%rsp)
  mov    0x1c(%rsp),%eax
  mov    0x44(%rsp),%esi
  add    %esi,0x24(%rsp)
  mov    0x2c(%rsp),%ebx
  add    %ebx,0x20(%rsp)
  cmp    %eax,0x28(%rsp)
  ja     L74
L21:
  addl   $0x20,0x48(%rsp)
  mov    0x48(%rsp),%eax
  mov    0x2c(%rsp),%ebx
  add    %ebx,0x4c(%rsp)
  cmp    %eax,%r12d
  ja     L152
L54:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L114:
  mov    $0x0,%ebx
  mov    $0x0,%r11d
  test   %r15d,%r15d
  je     L54
  mov    %ebx,0x8(%rsp)
  mov    0x38(%rsp),%r12
  mov    0x28(%rsp),%ebx
  jmp    L23
L147:
  mov    %esi,%eax
  sub    %ebp,%eax
  mov    %r10d,%edx
  lea    (%r12,%rdx,8),%rcx
L136:
  mov    %eax,%edx
  lea    (%r14,%rdx,8),%rdx
  lea    (%rdi,%rax,1),%r8d
  movsd  0x0(%r13,%r8,8),%xmm0
  mulsd  (%rcx),%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x1,%eax
  cmp    %eax,%esi
  jne    L136
L98:
  add    $0x1,%r9d
  sub    %ebp,%edi
  add    %ebp,%esi
  add    %r15d,%r10d
  cmp    %r9d,%ebx
  je     L4
L95:
  test   %ebp,%ebp
  jne    L147
  jmp    L98
L4:
  add    $0x1,%r11d
  add    %ebp,0x8(%rsp)
  cmp    %r11d,%r15d
  je     L54
L23:
  test   %ebx,%ebx
  je     L4
  mov    %r11d,%r10d
  mov    %ebp,%esi
  mov    0x8(%rsp),%edi
  mov    $0x0,%r9d
  jmp    L95
```

assistant: ```c
void matrix_multiply(double C[], const double A[], const double B[], const unsigned int m, const unsigned int n, const unsigned int q) {
  unsigned int i, j, k;
  memset(C, 0, m * n * sizeof(double));
  if (m % 32 || n % 32 || q % 32) {
    for (k = 0; k < q; ++k) {
      for (i = 0; i < m; ++i) {
        for (j = 0; j < n; ++j) {
          C[i * n + j] += A[i * q + k] * B[k * n + j];
        }
      }
    }
    return;
  }
  for (k = 0; k < q; k += 32) {
    const double *B_k = B + k * n;
    for (i = 0; i < m; i += 32) {
      const double *A_i_k = A + i * q + k;
      double *C_i = C + i * n;
      for (j = 0; j < n; j += 32) {
        matrix_multiply_block(C_i + j, A_i_k, B_k + j, n, q, n);
      }
    }
  }
}
```