user: 请将以下的汇编代码转换成C语言代码:

```asm
<matmul>:
  endbr64
  push   %r15
  mov    %edi,%r15d
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  shr    $0x1f,%ebx
  add    %edi,%ebx
  sub    $0x38,%rsp
  sar    %ebx
  mov    %edi,0x1c(%rsp)
  imul   %edi,%edi
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x28(%rsp)
  shl    $0x3,%edi
  mov    %rcx,0x10(%rsp)
  call   <malloc@plt>
  mov    %r14,%rsi
  mov    %r15d,%edi
  mov    %rax,%rdx
  mov    %rax,%r12
  call   <transpose@plt>
  cmp    $0x1,%r15d
  jle    L12
  movslq %r15d,%rdi
  movl   $0x0,0x18(%rsp)
  lea    (%r15,%r15,1),%r14d
  xor    %r15d,%r15d
  lea    0x0(,%rdi,8),%rsi
  mov    %rdi,0x20(%rsp)
  movslq %r14d,%r14
  lea    0x8(%rsi),%rdi
L166:
  mov    0x10(%rsp),%rax
  lea    0x0(,%r15,8),%r13
  xor    %ebp,%ebp
  xor    %r11d,%r11d
  lea    (%rax,%r13,1),%rdx
  add    0x8(%rsp),%r13
  nopl   0x0(%rax,%rax,1)
L195:
  lea    (%r12,%rbp,8),%rcx
  mov    %r13,%rax
  xor    %r8d,%r8d
  nopw   0x0(%rax,%rax,1)
L16:
  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     L16
  add    $0x1,%r11d
  add    %r14,%rbp
  add    $0x10,%rdx
  cmp    %r11d,%ebx
  jg     L195
  addl   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%eax
  add    %r14,%r15
  cmp    %eax,%ebx
  jg     L166
  testb  $0x1,0x1c(%rsp)
  je     L90
  mov    0x1c(%rsp),%eax
  lea    -0x1(%rax),%r8d
L7:
  mov    0x20(%rsp),%rax
  mov    0x1c(%rsp),%ebx
  mov    $0xfffffffffffffff8,%r10
  mov    0x10(%rsp),%rdi
  lea    0x0(,%rax,8),%r9
  mov    0x8(%rsp),%rax
  lea    (%rax,%r9,1),%rsi
  lea    -0x2(%rbx),%eax
  imul   %r8d,%ebx
  shl    $0x3,%rax
  lea    0x8(%rdi,%rax,1),%rcx
  sub    %rax,%r10
  xor    %edi,%edi
  movslq %ebx,%rdx
  mov    0x28(%rsp),%rbx
  lea    (%rbx,%rdx,8),%r11
L92:
  lea    (%r10,%rcx,1),%rax
  mov    %r11,%rdx
  xchg   %ax,%ax
L161:
  movsd  -0x8(%rsi),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    $0x8,%rdx
  addsd  -0x8(%rax),%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rcx
  jne    L161
  add    $0x1,%edi
  add    %r9,%rsi
  add    %r9,%rcx
  cmp    %edi,%r8d
  jne    L92
  mov    0x1c(%rsp),%eax
  test   %eax,%eax
  jle    L35
L47:
  mov    0x20(%rsp),%rax
  mov    0x8(%rsp),%rbx
  mov    $0xfffffffffffffff8,%r11
  xor    %r10d,%r10d
  mov    0x1c(%rsp),%ebp
  lea    0x0(,%rax,8),%rdi
  mov    0x10(%rsp),%rax
  lea    0x8(%rbx),%r9
  mov    0x28(%rsp),%rbx
  lea    (%rax,%rdi,1),%rsi
  mov    %r8d,%eax
  add    %rdi,%rbx
  shl    $0x3,%rax
  lea    (%r9,%rax,1),%rcx
  sub    %rax,%r11
L144:
  movsd  -0x8(%rsi),%xmm1
  lea    (%r11,%rcx,1),%rax
  mov    %rbx,%rdx
  nopl   0x0(%rax)
L19:
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rdx),%xmm0
  add    $0x8,%rax
  add    %rdi,%rdx
  addsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rsi)
  cmp    %rax,%rcx
  jne    L19
  add    $0x1,%r10d
  add    %rdi,%rsi
  add    %rdi,%rcx
  cmp    %r10d,%ebp
  jne    L144
  test   %r8d,%r8d
  jle    L90
L56:
  mov    0x1c(%rsp),%ebp
  mov    0x8(%rsp),%rax
  mov    0x20(%rsp),%rdi
  mov    0x28(%rsp),%r10
  mov    %ebp,%r11d
  mov    0x10(%rsp),%r12
  imul   %r8d,%r11d
  shl    $0x3,%rdi
  movslq %r11d,%rdx
  lea    (%rax,%rdx,8),%rbx
  movslq %r8d,%rax
  add    %rdx,%rax
  lea    (%r9,%rax,8),%rsi
  xor    %r9d,%r9d
L189:
  test   %ebp,%ebp
  jle    L26
  lea    (%r9,%r11,1),%eax
  mov    %r10,%rdx
  cltq
  lea    (%r12,%rax,8),%rcx
  mov    %rbx,%rax
  movsd  (%rcx),%xmm1
  nopl   0x0(%rax)
L74:
  movsd  (%rax),%xmm0
  mulsd  (%rdx),%xmm0
  add    $0x8,%rax
  add    %rdi,%rdx
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx)
  cmp    %rsi,%rax
  jne    L74
L26:
  add    $0x1,%r9d
  add    $0x8,%r10
  cmp    %r9d,%r8d
  jne    L189
L90:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L12:
  movslq 0x1c(%rsp),%rax
  test   $0x1,%al
  je     L90
  lea    -0x1(%rax),%r8d
  test   %r8d,%r8d
  jg     L173
  movslq 0x1c(%rsp),%rbx
  mov    %rbx,0x20(%rsp)
  test   %ebx,%ebx
  jg     L47
  jmp    L90
L35:
  mov    0x8(%rsp),%rax
  lea    0x8(%rax),%r9
  jmp    L56
L173:
  mov    %rax,0x20(%rsp)
  jmp    L7
```

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];
}
```