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

```asm
<MatMulC>:
  endbr64
  push   %r15
  movslq %esi,%r15
  push   %r14
  push   %r13
  mov    %r8,%r13
  push   %r12
  mov    %rcx,%r12
  push   %rbp
  mov    %edi,%ebp
  lea    0x0(,%r15,8),%edi
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x18,%rsp
  call   <malloc@plt>
  mov    %rax,%rdi
  test   %r15d,%r15d
  jle    L105
  cmp    $0x1,%ebp
  jne    L57
  lea    0x8(%r12),%rax
  mov    %r15,%r14
  cmp    %rax,%rdi
  je     L33
  lea    -0x1(%r15),%eax
  cmp    $0x2,%eax
  jbe    L33
  mov    %r15d,%edx
  xor    %eax,%eax
  shr    %edx
  shl    $0x4,%rdx
L134:
  movupd (%r12,%rax,1),%xmm5
  movups %xmm5,(%rdi,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L134
  mov    %r14d,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%r14d
  je     L90
  movsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
L90:
  mov    %ebp,%edx
  lea    -0x1(%rbp),%eax
  movslq %ebp,%r14
  mov    %ebp,%r12d
  shr    %edx
  shl    $0x3,%rax
  mov    %rbx,%r9
  and    $0xfffffffe,%r12d
  lea    -0x1(%rdx),%r10d
  shl    $0x3,%r14
  lea    0x8(%r13,%rax,1),%r13
  xor    %r8d,%r8d
  mov    $0xfffffffffffffff8,%rdx
  add    $0x1,%r10
  pxor   %xmm3,%xmm3
  xor    %r15d,%r15d
  sub    %rax,%rdx
  shl    $0x4,%r10
  mov    %rdx,0x8(%rsp)
  nopl   0x0(%rax,%rax,1)
L132:
  mov    0x8(%rsp),%rax
  mov    %rdi,%rsi
  xor    %ecx,%ecx
  lea    (%rax,%r13,1),%r11
  xchg   %ax,%ax
L13:
  cmp    $0x1,%ebp
  je     L169
  xor    %eax,%eax
  movapd %xmm3,%xmm0
  nop
L114:
  movupd (%rsi,%rax,1),%xmm2
  movupd (%r9,%rax,1),%xmm4
  add    $0x10,%rax
  mulpd  %xmm4,%xmm2
  addsd  %xmm2,%xmm0
  unpckhpd %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  cmp    %rax,%r10
  jne    L114
  mov    %r12d,%eax
  cmp    %r12d,%ebp
  je     L108
L94:
  lea    (%rcx,%rax,1),%edx
  add    %r8d,%eax
  movslq %edx,%rdx
  cltq
  movsd  (%rdi,%rdx,8),%xmm1
  mulsd  (%rbx,%rax,8),%xmm1
  addsd  %xmm1,%xmm0
L108:
  movsd  %xmm0,(%r11)
  add    $0x8,%r11
  add    %ebp,%ecx
  add    %r14,%rsi
  cmp    %r11,%r13
  jne    L13
  add    $0x1,%r15d
  add    %ebp,%r8d
  add    %r14,%r13
  add    %r14,%r9
  cmp    %r15d,%ebp
  jne    L132
L6:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <free@plt>
  nopl   0x0(%rax)
L169:
  movapd %xmm3,%xmm0
  xor    %eax,%eax
  jmp    L94
L57:
  xor    %ecx,%ecx
L50:
  mov    %ecx,%eax
  cltd
  idiv   %ebp
  imul   %ebp,%edx
  add    %eax,%edx
  movslq %edx,%rax
  movsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%rdi,%rcx,8)
  add    $0x1,%rcx
  cmp    %r15,%rcx
  jne    L50
L105:
  test   %ebp,%ebp
  jg     L90
  jmp    L6
L33:
  mov    %r14d,%r14d
  xor    %eax,%eax
L151:
  movsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%rdi,%rax,8)
  add    $0x1,%rax
  cmp    %r14,%rax
  jne    L151
  jmp    L90
```

assistant: ```c
void MatMulC(int rows, int len, double *a, double *bin, double *c) {
  int i, j, k;
  double *b = malloc(len * sizeof(double));
  for (int n = 0; n < len; n++) {
    b[n] = bin[rows * (n % rows) + (n / rows)];
  }
  for (i = 0; i < rows; i++) {
    for (j = 0; j < rows; j++) {
      double sum = 0.0;
      for (k = 0; k < rows; k++) {
        sum += a[i * rows + k] * b[j * rows + k];
      }
      c[i * rows + j] = sum;
    }
  }
  free(b);
}
```