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

```asm
<matmul>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  mov    %edi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %edi,%ebx
  shr    $0x1f,%ebx
  add    %edi,%ebx
  sub    $0x48,%rsp
  sar    %ebx
  mov    %edi,0x2c(%rsp)
  imul   %edi,%edi
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x10(%rsp)
  shl    $0x3,%edi
  call   <malloc@plt>
  mov    %r15,%rsi
  mov    %r14d,%edi
  mov    %rax,%rdx
  mov    %rax,%r12
  call   <transpose@plt>
  cmp    $0x1,%r14d
  jle    L186
  movslq %r14d,%rdi
  movl   $0x0,0x18(%rsp)
  lea    (%r14,%r14,1),%r15d
  xor    %r14d,%r14d
  mov    %rbp,0x20(%rsp)
  lea    0x0(,%rdi,8),%rsi
  movslq %r15d,%r15
  mov    %rdi,0x30(%rsp)
  lea    0x8(%rsi),%rdi
  nopl   0x0(%rax,%rax,1)
L20:
  mov    0x20(%rsp),%rax
  lea    0x0(,%r14,8),%r13
  xor    %ebp,%ebp
  xor    %r11d,%r11d
  lea    (%rax,%r13,1),%rdx
  add    0x8(%rsp),%r13
  nopl   0x0(%rax,%rax,1)
L91:
  lea    (%r12,%rbp,8),%rcx
  mov    %r13,%rax
  xor    %r8d,%r8d
  nopw   0x0(%rax,%rax,1)
L170:
  movsd  (%rax),%xmm0
  mulsd  (%rcx),%xmm0
  lea    (%rsi,%rcx,1),%r10
  lea    (%rdi,%rcx,1),%r9
  movsd  0x8(%rax),%xmm1
  add    $0x1,%r8d
  add    $0x10,%rax
  add    $0x10,%rcx
  mulsd  -0x8(%rcx),%xmm1
  addsd  %xmm1,%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  movsd  -0x10(%rax),%xmm0
  movsd  -0x8(%rax),%xmm1
  mulsd  (%r10),%xmm0
  mulsd  (%r9),%xmm1
  addsd  %xmm1,%xmm0
  addsd  0x8(%rdx),%xmm0
  movsd  %xmm0,0x8(%rdx)
  movsd  -0x10(%rax,%rsi,1),%xmm0
  mulsd  -0x10(%rcx),%xmm0
  movsd  -0x10(%rax,%rdi,1),%xmm1
  mulsd  -0x8(%rcx),%xmm1
  addsd  %xmm1,%xmm0
  addsd  (%rdx,%rsi,1),%xmm0
  movsd  %xmm0,(%rdx,%rsi,1)
  movsd  -0x10(%rax,%rsi,1),%xmm0
  mulsd  (%r10),%xmm0
  movsd  -0x10(%rax,%rdi,1),%xmm1
  mulsd  (%r9),%xmm1
  addsd  %xmm1,%xmm0
  addsd  (%rdx,%rdi,1),%xmm0
  movsd  %xmm0,(%rdx,%rdi,1)
  cmp    %r8d,%ebx
  jg     L170
  add    $0x1,%r11d
  add    %r15,%rbp
  add    $0x10,%rdx
  cmp    %r11d,%ebx
  jg     L91
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  add    %r15,%r14
  cmp    %eax,%ebx
  jg     L20
  mov    0x20(%rsp),%rbp
  testb  $0x1,0x2c(%rsp)
  je     L81
  mov    0x2c(%rsp),%eax
  lea    -0x1(%rax),%ebx
  mov    %eax,%r10d
L5:
  mov    %r10d,%esi
  mov    0x30(%rsp),%r14
  mov    0x8(%rsp),%rdi
  mov    %ebx,%ecx
  imul   %ebx,%esi
  mov    0x10(%rsp),%r12
  mov    %rbp,%rax
  xor    %r13d,%r13d
  lea    0x0(,%rcx,8),%r15
  shl    $0x3,%r14
  lea    (%rdi,%r14,1),%rdx
  mov    %r15,0x18(%rsp)
  mov    %r10d,%r15d
  movslq %esi,%rcx
  lea    0x8(,%rcx,8),%rdi
  lea    (%r12,%rdi,1),%r8
  lea    -0x8(%r12,%rdi,1),%r9
  mov    %ebx,%edi
  mov    %r8,0x20(%rsp)
  mov    %ebx,%r8d
  shr    %edi
  and    $0xfffffffe,%r8d
  sub    $0x1,%edi
  add    %r8d,%esi
  add    $0x1,%rdi
  movslq %esi,%rsi
  shl    $0x4,%rdi
  lea    (%r12,%rsi,8),%r11
  lea    (%r12,%rcx,8),%rsi
  lea    -0x2(%r10),%ecx
  mov    %rsi,0x30(%rsp)
  xor    %esi,%esi
  lea    0x8(,%rcx,8),%rcx
  mov    %rcx,0x38(%rsp)
L54:
  mov    0x18(%rsp),%rcx
  lea    -0x8(%rdx),%r10
  add    %rax,%rcx
  cmp    %rcx,%r10
  setae  %r10b
  cmp    %rax,%rdx
  setbe  %cl
  or     %r10b,%cl
  je     L162
  cmp    %rax,0x20(%rsp)
  setne  %r10b
  cmp    $0x2,%r15d
  setne  %cl
  test   %cl,%r10b
  je     L162
  movsd  -0x8(%rdx),%xmm1
  xor    %ecx,%ecx
  unpcklpd %xmm1,%xmm1
  nop
L46:
  movupd (%r9,%rcx,1),%xmm0
  movupd (%rax,%rcx,1),%xmm2
  mulpd  %xmm1,%xmm0
  addpd  %xmm2,%xmm0
  movups %xmm0,(%rax,%rcx,1)
  add    $0x10,%rcx
  cmp    %rcx,%rdi
  jne    L46
  cmp    %ebx,%r8d
  je     L90
  lea    (%rsi,%r8,1),%ecx
  movsd  (%r11),%xmm0
  mulsd  -0x8(%rdx),%xmm0
  movslq %ecx,%rcx
  lea    0x0(%rbp,%rcx,8),%rcx
  addsd  (%rcx),%xmm0
  movsd  %xmm0,(%rcx)
L90:
  add    $0x1,%r13d
  add    %r14,%rax
  add    %r14,%rdx
  add    %r15d,%esi
  cmp    %ebx,%r13d
  jne    L54
L126:
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L81
  cmp    $0x1,%eax
  jne    L120
  mov    0x10(%rsp),%rax
  movsd  (%rax),%xmm0
  mov    0x8(%rsp),%rax
  mulsd  (%rax),%xmm0
  addsd  0x0(%rbp),%xmm0
  movsd  %xmm0,0x0(%rbp)
L178:
  test   %ebx,%ebx
  jle    L81
  movslq 0x2c(%rsp),%rcx
  mov    0x8(%rsp),%rsi
  movslq %ebx,%rdx
  xor    %edi,%edi
  mov    0x10(%rsp),%r8
  mov    %ecx,%eax
  shl    $0x3,%rcx
  imul   %ebx,%eax
  cltq
  lea    0x0(,%rax,8),%r9
  add    %rdx,%rax
  add    %r9,%rbp
  add    %rsi,%r9
  lea    0x8(%rsi,%rax,8),%rsi
L143:
  movsd  0x0(%rbp),%xmm1
  mov    %r8,%rdx
  mov    %r9,%rax
  xchg   %ax,%ax
L179:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rcx,%rdx
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%rbp)
  cmp    %rsi,%rax
  jne    L179
  add    $0x1,%edi
  add    $0x8,%rbp
  add    $0x8,%r8
  cmp    %edi,%ebx
  jne    L143
L81:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L162:
  mov    0x38(%rsp),%rcx
  mov    0x30(%rsp),%r10
  lea    (%rcx,%rax,1),%r12
  mov    %rax,%rcx
  nopl   0x0(%rax)
L147:
  movsd  (%r10),%xmm0
  mulsd  -0x8(%rdx),%xmm0
  add    $0x8,%rcx
  add    $0x8,%r10
  addsd  -0x8(%rcx),%xmm0
  movsd  %xmm0,-0x8(%rcx)
  cmp    %r12,%rcx
  jne    L147
  jmp    L90
L120:
  movslq 0x2c(%rsp),%rcx
  mov    0x8(%rsp),%rsi
  mov    %ebx,%eax
  xor    %r9d,%r9d
  mov    0x10(%rsp),%rdx
  shl    $0x3,%rax
  mov    $0xfffffffffffffff8,%r8
  shl    $0x3,%rcx
  lea    0x8(%rsi,%rax,1),%rsi
  sub    %rax,%r8
  lea    0x0(%rbp,%rcx,1),%rdi
  lea    (%rdx,%rcx,1),%r10
L200:
  movsd  -0x8(%rdi),%xmm1
  lea    (%r8,%rsi,1),%rax
  mov    %r10,%rdx
  cs nopw 0x0(%rax,%rax,1)
L119:
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rdx),%xmm0
  add    $0x8,%rax
  add    %rcx,%rdx
  addsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rdi)
  cmp    %rax,%rsi
  jne    L119
  add    $0x1,%r9d
  add    %rcx,%rdi
  add    %rcx,%rsi
  cmp    %r9d,0x2c(%rsp)
  jne    L200
  jmp    L178
L186:
  movslq 0x2c(%rsp),%rax
  test   $0x1,%al
  je     L81
  lea    -0x1(%rax),%ebx
  test   %ebx,%ebx
  jle    L126
  mov    %rax,0x30(%rsp)
  mov    0x2c(%rsp),%r10d
  jmp    L5
```

assistant: ```c
void matmul(int i_matdim, const double *pd_A, const double *pd_B, double *pd_C) {
  int i, j, k;
  int n = 2;
  int N = i_matdim;
  int Ntiles = N / n;
  double *A = pd_A;
  double *B = (double *)malloc(i_matdim * i_matdim * sizeof(double));
  double *C = pd_C;
  transpose(i_matdim, pd_B, B);
  for (i = 0; i < Ntiles; i++)
    for (j = 0; j < Ntiles; j++)
      for (k = 0; k < Ntiles; k++) {
        double *bA = A + i * n * N + k * n;
        double *bB = B + j * n * N + k * n;
        double *bC = C + i * n * N + j * n;
        bC[0] += bA[0] * bB[0] + bA[1] * bB[1];
        bC[1] += bA[0] * bB[N] + bA[1] * bB[N + 1];
        bC[N] += bA[N] * bB[0] + bA[N + 1] * bB[1];
        bC[N + 1] += bA[N] * bB[N] + bA[N + 1] * bB[N + 1];
      }
  if ((i_matdim & 1) == 0)
    return;
  for (i = 0; i < N - 1; i++)
    for (j = 0; j < N - 1; j++) {
      C[i * N + j] += A[i * N + N - 1] * pd_B[(N - 1) * N + j];
    }
  for (i = 0; i < N; i++)
    for (k = 0; k < N; k++)
      C[i * N + N - 1] += A[i * N + k] * pd_B[k * N + N - 1];
  for (i = 0; i < N - 1; i++)
    for (k = 0; k < N; k++)
      C[(N - 1) * N + i] += A[(N - 1) * N + k] * pd_B[k * N + i];
}
```