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

```asm
<s_cvt_tran_mat2pmat>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edi,%ebx
  mov    %esi,%ecx
  mov    %r8,%rbp
  mov    %r9d,-0x4(%rsp)
  mov    %edx,%eax
  sar    $0x1f,%eax
  shr    $0x1d,%eax
  add    %eax,%edx
  and    $0x7,%edx
  sub    %edx,%eax
  lea    0x8(%rax),%eax
  cltd
  shr    $0x1d,%edx
  lea    (%rax,%rdx,1),%edi
  and    $0x7,%edi
  sub    %edx,%edi
  cmp    %esi,%edi
  cmovg  %esi,%edi
  sub    %edi,%ecx
  mov    %ecx,-0x8(%rsp)
  test   %edi,%edi
  jle    L63
  mov    %r9d,%esi
  test   %ebx,%ebx
  jle    L173
  mov    %r8,%r9
  lea    -0x1(%rdi),%eax
  mov    0x38(%rsp),%rcx
  lea    0x4(%rcx,%rax,4),%rcx
  movslq %esi,%rsi
  shl    $0x2,%rsi
  mov    $0x0,%r8d
  mov    %edi,%r10d
  neg    %r10
  shl    $0x2,%r10
L47:
  lea    (%r10,%rcx,1),%rax
  mov    %r9,%rdx
L136:
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rax)
  add    %rsi,%rdx
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L136
  add    $0x1,%r8d
  add    $0x4,%r9
  add    $0x20,%rcx
  cmp    %r8d,%ebx
  jne    L47
L173:
  mov    -0x4(%rsp),%eax
  imul   %edi,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rbp
  mov    0x40(%rsp),%eax
  lea    -0x8(%rdi,%rax,8),%eax
  cltq
  mov    0x38(%rsp),%rdi
  lea    (%rdi,%rax,4),%rax
  mov    %rax,0x38(%rsp)
L63:
  mov    -0x8(%rsp),%eax
  sub    $0x7,%eax
  mov    %eax,-0x28(%rsp)
  test   %eax,%eax
  jle    L186
  mov    -0x4(%rsp),%edi
  mov    %edi,-0x40(%rsp)
  lea    0x0(,%rdi,8),%esi
  mov    %esi,-0x24(%rsp)
  mov    0x40(%rsp),%eax
  shl    $0x3,%eax
  mov    %eax,-0x20(%rsp)
  lea    (%rdi,%rdi,1),%r13d
  lea    0x0(%r13,%rdi,1),%eax
  mov    %eax,-0x3c(%rsp)
  lea    0x0(,%rdi,4),%r12d
  lea    (%r12,%rdi,1),%r14d
  add    %eax,%eax
  mov    %eax,-0x38(%rsp)
  sub    %edi,%esi
  mov    %esi,-0x34(%rsp)
  lea    -0x8(%rbx),%eax
  shr    $0x3,%eax
  mov    %eax,%edx
  shl    $0x6,%rdx
  mov    %rdx,-0x18(%rsp)
  lea    0x8(,%rax,8),%eax
  mov    %eax,-0x1c(%rsp)
  movl   $0x0,-0x44(%rsp)
  movl   $0x0,-0x48(%rsp)
  movl   $0x0,-0x4c(%rsp)
  mov    0x38(%rsp),%rax
  add    $0x100,%rax
  mov    %rax,-0x10(%rsp)
  jmp    L101
L25:
  addl   $0x8,-0x4c(%rsp)
  mov    -0x4c(%rsp),%edi
  mov    -0x24(%rsp),%eax
  add    %eax,-0x48(%rsp)
  mov    -0x20(%rsp),%ecx
  add    %ecx,-0x44(%rsp)
  add    %eax,-0x40(%rsp)
  add    %eax,%r13d
  add    %eax,-0x3c(%rsp)
  add    %eax,%r12d
  add    %eax,%r14d
  add    %eax,-0x38(%rsp)
  add    %eax,-0x34(%rsp)
  cmp    -0x28(%rsp),%edi
  jge    L178
L101:
  mov    $0x0,%edx
  cmp    $0x7,%ebx
  jle    L53
  movslq -0x48(%rsp),%rax
  lea    0x0(%rbp,%rax,4),%r11
  movslq -0x44(%rsp),%r15
  mov    0x38(%rsp),%rax
  lea    (%rax,%r15,4),%rax
  mov    %rax,-0x30(%rsp)
  movslq -0x40(%rsp),%rdx
  lea    0x0(%rbp,%rdx,4),%r10
  movslq %r13d,%rdx
  lea    0x0(%rbp,%rdx,4),%r9
  movslq -0x3c(%rsp),%rdx
  lea    0x0(%rbp,%rdx,4),%r8
  movslq %r12d,%rdx
  lea    0x0(%rbp,%rdx,4),%rdi
  movslq %r14d,%rdx
  lea    0x0(%rbp,%rdx,4),%rsi
  movslq -0x38(%rsp),%rdx
  lea    0x0(%rbp,%rdx,4),%rcx
  movslq -0x34(%rsp),%rdx
  lea    0x0(%rbp,%rdx,4),%rdx
  add    -0x18(%rsp),%r15
  mov    -0x10(%rsp),%rax
  lea    (%rax,%r15,4),%r15
  mov    -0x30(%rsp),%rax
L67:
  movss  (%r11),%xmm0
  movss  %xmm0,(%rax)
  movss  (%r10),%xmm0
  movss  %xmm0,0x4(%rax)
  movss  (%r9),%xmm0
  movss  %xmm0,0x8(%rax)
  movss  (%r8),%xmm0
  movss  %xmm0,0xc(%rax)
  movss  (%rdi),%xmm0
  movss  %xmm0,0x10(%rax)
  movss  (%rsi),%xmm0
  movss  %xmm0,0x14(%rax)
  movss  (%rcx),%xmm0
  movss  %xmm0,0x18(%rax)
  movss  (%rdx),%xmm0
  movss  %xmm0,0x1c(%rax)
  movss  0x4(%r11),%xmm0
  movss  %xmm0,0x20(%rax)
  movss  0x4(%r10),%xmm0
  movss  %xmm0,0x24(%rax)
  movss  0x4(%r9),%xmm0
  movss  %xmm0,0x28(%rax)
  movss  0x4(%r8),%xmm0
  movss  %xmm0,0x2c(%rax)
  movss  0x4(%rdi),%xmm0
  movss  %xmm0,0x30(%rax)
  movss  0x4(%rsi),%xmm0
  movss  %xmm0,0x34(%rax)
  movss  0x4(%rcx),%xmm0
  movss  %xmm0,0x38(%rax)
  movss  0x4(%rdx),%xmm0
  movss  %xmm0,0x3c(%rax)
  movss  0x8(%r11),%xmm0
  movss  %xmm0,0x40(%rax)
  movss  0x8(%r10),%xmm0
  movss  %xmm0,0x44(%rax)
  movss  0x8(%r9),%xmm0
  movss  %xmm0,0x48(%rax)
  movss  0x8(%r8),%xmm0
  movss  %xmm0,0x4c(%rax)
  movss  0x8(%rdi),%xmm0
  movss  %xmm0,0x50(%rax)
  movss  0x8(%rsi),%xmm0
  movss  %xmm0,0x54(%rax)
  movss  0x8(%rcx),%xmm0
  movss  %xmm0,0x58(%rax)
  movss  0x8(%rdx),%xmm0
  movss  %xmm0,0x5c(%rax)
  movss  0xc(%r11),%xmm0
  movss  %xmm0,0x60(%rax)
  movss  0xc(%r10),%xmm0
  movss  %xmm0,0x64(%rax)
  movss  0xc(%r9),%xmm0
  movss  %xmm0,0x68(%rax)
  movss  0xc(%r8),%xmm0
  movss  %xmm0,0x6c(%rax)
  movss  0xc(%rdi),%xmm0
  movss  %xmm0,0x70(%rax)
  movss  0xc(%rsi),%xmm0
  movss  %xmm0,0x74(%rax)
  movss  0xc(%rcx),%xmm0
  movss  %xmm0,0x78(%rax)
  movss  0xc(%rdx),%xmm0
  movss  %xmm0,0x7c(%rax)
  movss  0x10(%r11),%xmm0
  movss  %xmm0,0x80(%rax)
  movss  0x10(%r10),%xmm0
  movss  %xmm0,0x84(%rax)
  movss  0x10(%r9),%xmm0
  movss  %xmm0,0x88(%rax)
  movss  0x10(%r8),%xmm0
  movss  %xmm0,0x8c(%rax)
  movss  0x10(%rdi),%xmm0
  movss  %xmm0,0x90(%rax)
  movss  0x10(%rsi),%xmm0
  movss  %xmm0,0x94(%rax)
  movss  0x10(%rcx),%xmm0
  movss  %xmm0,0x98(%rax)
  movss  0x10(%rdx),%xmm0
  movss  %xmm0,0x9c(%rax)
  movss  0x14(%r11),%xmm0
  movss  %xmm0,0xa0(%rax)
  movss  0x14(%r10),%xmm0
  movss  %xmm0,0xa4(%rax)
  movss  0x14(%r9),%xmm0
  movss  %xmm0,0xa8(%rax)
  movss  0x14(%r8),%xmm0
  movss  %xmm0,0xac(%rax)
  movss  0x14(%rdi),%xmm0
  movss  %xmm0,0xb0(%rax)
  movss  0x14(%rsi),%xmm0
  movss  %xmm0,0xb4(%rax)
  movss  0x14(%rcx),%xmm0
  movss  %xmm0,0xb8(%rax)
  movss  0x14(%rdx),%xmm0
  movss  %xmm0,0xbc(%rax)
  movss  0x18(%r11),%xmm0
  movss  %xmm0,0xc0(%rax)
  movss  0x18(%r10),%xmm0
  movss  %xmm0,0xc4(%rax)
  movss  0x18(%r9),%xmm0
  movss  %xmm0,0xc8(%rax)
  movss  0x18(%r8),%xmm0
  movss  %xmm0,0xcc(%rax)
  movss  0x18(%rdi),%xmm0
  movss  %xmm0,0xd0(%rax)
  movss  0x18(%rsi),%xmm0
  movss  %xmm0,0xd4(%rax)
  movss  0x18(%rcx),%xmm0
  movss  %xmm0,0xd8(%rax)
  movss  0x18(%rdx),%xmm0
  movss  %xmm0,0xdc(%rax)
  movss  0x1c(%r11),%xmm0
  movss  %xmm0,0xe0(%rax)
  movss  0x1c(%r10),%xmm0
  movss  %xmm0,0xe4(%rax)
  movss  0x1c(%r9),%xmm0
  movss  %xmm0,0xe8(%rax)
  movss  0x1c(%r8),%xmm0
  movss  %xmm0,0xec(%rax)
  movss  0x1c(%rdi),%xmm0
  movss  %xmm0,0xf0(%rax)
  movss  0x1c(%rsi),%xmm0
  movss  %xmm0,0xf4(%rax)
  movss  0x1c(%rcx),%xmm0
  movss  %xmm0,0xf8(%rax)
  movss  0x1c(%rdx),%xmm0
  movss  %xmm0,0xfc(%rax)
  add    $0x20,%r11
  add    $0x100,%rax
  add    $0x20,%r10
  add    $0x20,%r9
  add    $0x20,%r8
  add    $0x20,%rdi
  add    $0x20,%rsi
  add    $0x20,%rcx
  add    $0x20,%rdx
  cmp    %r15,%rax
  jne    L67
  mov    -0x1c(%rsp),%edx
L53:
  cmp    %edx,%ebx
  jle    L25
  movslq %edx,%rax
  shl    $0x3,%edx
  movslq %edx,%rdx
  movslq -0x44(%rsp),%rcx
  add    %rcx,%rdx
  mov    0x38(%rsp),%rdi
  lea    (%rdi,%rdx,4),%rdx
  movslq -0x48(%rsp),%rcx
  lea    0x0(%rbp,%rcx,4),%r15
  movslq -0x40(%rsp),%rcx
  lea    0x0(%rbp,%rcx,4),%r11
  movslq %r13d,%rcx
  lea    0x0(%rbp,%rcx,4),%r10
  movslq -0x3c(%rsp),%rcx
  lea    0x0(%rbp,%rcx,4),%r9
  movslq %r12d,%rcx
  lea    0x0(%rbp,%rcx,4),%r8
  movslq %r14d,%rcx
  lea    0x0(%rbp,%rcx,4),%rdi
  movslq -0x38(%rsp),%rcx
  lea    0x0(%rbp,%rcx,4),%rsi
  movslq -0x34(%rsp),%rcx
  lea    0x0(%rbp,%rcx,4),%rcx
L55:
  movss  (%r15,%rax,4),%xmm0
  movss  %xmm0,(%rdx)
  movss  (%r11,%rax,4),%xmm0
  movss  %xmm0,0x4(%rdx)
  movss  (%r10,%rax,4),%xmm0
  movss  %xmm0,0x8(%rdx)
  movss  (%r9,%rax,4),%xmm0
  movss  %xmm0,0xc(%rdx)
  movss  (%r8,%rax,4),%xmm0
  movss  %xmm0,0x10(%rdx)
  movss  (%rdi,%rax,4),%xmm0
  movss  %xmm0,0x14(%rdx)
  movss  (%rsi,%rax,4),%xmm0
  movss  %xmm0,0x18(%rdx)
  movss  (%rcx,%rax,4),%xmm0
  movss  %xmm0,0x1c(%rdx)
  add    $0x1,%rax
  add    $0x20,%rdx
  cmp    %eax,%ebx
  jg     L55
  jmp    L25
L178:
  mov    -0x8(%rsp),%eax
  sub    $0x8,%eax
  shr    $0x3,%eax
  lea    0x8(,%rax,8),%eax
L175:
  mov    -0x8(%rsp),%edi
  cmp    %eax,%edi
  jle    L76
  mov    %edi,%r8d
  sub    %eax,%r8d
  mov    $0x8,%edi
  cmp    %edi,%r8d
  cmovle %r8d,%edi
  test   %ebx,%ebx
  jle    L76
  mov    %eax,%r11d
  imul   0x40(%rsp),%r11d
  mov    -0x4(%rsp),%esi
  imul   %esi,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%r10
  movslq %esi,%rcx
  shl    $0x2,%rcx
  mov    $0x0,%r9d
  movslq %r11d,%r11
  mov    0x38(%rsp),%rbp
  jmp    L94
L186:
  mov    $0x0,%eax
  jmp    L175
L140:
  lea    0x0(,%r9,8),%eax
  cltq
  add    %r11,%rax
  lea    0x0(%rbp,%rax,4),%rsi
  mov    %r10,%rdx
  mov    $0x0,%eax
L119:
  movss  (%rdx),%xmm0
  movss  %xmm0,(%rsi,%rax,4)
  add    $0x1,%rax
  add    %rcx,%rdx
  cmp    %eax,%edi
  jg     L119
L97:
  add    $0x1,%r9d
  add    $0x4,%r10
  cmp    %r9d,%ebx
  je     L76
L94:
  test   %r8d,%r8d
  jg     L140
  jmp    L97
L76:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void s_cvt_tran_mat2pmat(int row, int col, int offset, int bs_dummy, float *A, int lda, float *pA, int sda) {
  const int bs = 8;
  int i, ii, j, row0, row1, row2;
  row0 = (bs - offset % bs) % bs;
  if (row0 > col)
    row0 = col;
  row1 = col - row0;
  ii = 0;
  if (row0 > 0) {
    for (j = 0; j < row; j++) {
      for (i = 0; i < row0; i++) {
        pA[i + j * bs + ii * sda] = A[j + (i + ii) * lda];
      }
    }
    A += row0 * lda;
    pA += row0 + bs * (sda - 1);
  }
  ii = 0;
  for (; ii < row1 - 7; ii += bs) {
    j = 0;
    for (; j < row - 7; j += 8) {
      pA[0 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 0) * lda];
      pA[1 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 1) * lda];
      pA[2 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 2) * lda];
      pA[3 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 3) * lda];
      pA[4 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 4) * lda];
      pA[5 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 5) * lda];
      pA[6 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 6) * lda];
      pA[7 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 7) * lda];
      pA[0 + (j + 1) * bs + ii * sda] = A[j + 1 + (ii + 0) * lda];
      pA[1 + (j + 1) * bs + ii * sda] = A[j + 1 + (ii + 1) * lda];
      pA[2 + (j + 1) * bs + ii * sda] = A[j + 1 + (ii + 2) * lda];
      pA[3 + (j + 1) * bs + ii * sda] = A[j + 1 + (ii + 3) * lda];
      pA[4 + (j + 1) * bs + ii * sda] = A[j + 1 + (ii + 4) * lda];
      pA[5 + (j + 1) * bs + ii * sda] = A[j + 1 + (ii + 5) * lda];
      pA[6 + (j + 1) * bs + ii * sda] = A[j + 1 + (ii + 6) * lda];
      pA[7 + (j + 1) * bs + ii * sda] = A[j + 1 + (ii + 7) * lda];
      pA[0 + (j + 2) * bs + ii * sda] = A[j + 2 + (ii + 0) * lda];
      pA[1 + (j + 2) * bs + ii * sda] = A[j + 2 + (ii + 1) * lda];
      pA[2 + (j + 2) * bs + ii * sda] = A[j + 2 + (ii + 2) * lda];
      pA[3 + (j + 2) * bs + ii * sda] = A[j + 2 + (ii + 3) * lda];
      pA[4 + (j + 2) * bs + ii * sda] = A[j + 2 + (ii + 4) * lda];
      pA[5 + (j + 2) * bs + ii * sda] = A[j + 2 + (ii + 5) * lda];
      pA[6 + (j + 2) * bs + ii * sda] = A[j + 2 + (ii + 6) * lda];
      pA[7 + (j + 2) * bs + ii * sda] = A[j + 2 + (ii + 7) * lda];
      pA[0 + (j + 3) * bs + ii * sda] = A[j + 3 + (ii + 0) * lda];
      pA[1 + (j + 3) * bs + ii * sda] = A[j + 3 + (ii + 1) * lda];
      pA[2 + (j + 3) * bs + ii * sda] = A[j + 3 + (ii + 2) * lda];
      pA[3 + (j + 3) * bs + ii * sda] = A[j + 3 + (ii + 3) * lda];
      pA[4 + (j + 3) * bs + ii * sda] = A[j + 3 + (ii + 4) * lda];
      pA[5 + (j + 3) * bs + ii * sda] = A[j + 3 + (ii + 5) * lda];
      pA[6 + (j + 3) * bs + ii * sda] = A[j + 3 + (ii + 6) * lda];
      pA[7 + (j + 3) * bs + ii * sda] = A[j + 3 + (ii + 7) * lda];
      pA[0 + (j + 4) * bs + ii * sda] = A[j + 4 + (ii + 0) * lda];
      pA[1 + (j + 4) * bs + ii * sda] = A[j + 4 + (ii + 1) * lda];
      pA[2 + (j + 4) * bs + ii * sda] = A[j + 4 + (ii + 2) * lda];
      pA[3 + (j + 4) * bs + ii * sda] = A[j + 4 + (ii + 3) * lda];
      pA[4 + (j + 4) * bs + ii * sda] = A[j + 4 + (ii + 4) * lda];
      pA[5 + (j + 4) * bs + ii * sda] = A[j + 4 + (ii + 5) * lda];
      pA[6 + (j + 4) * bs + ii * sda] = A[j + 4 + (ii + 6) * lda];
      pA[7 + (j + 4) * bs + ii * sda] = A[j + 4 + (ii + 7) * lda];
      pA[0 + (j + 5) * bs + ii * sda] = A[j + 5 + (ii + 0) * lda];
      pA[1 + (j + 5) * bs + ii * sda] = A[j + 5 + (ii + 1) * lda];
      pA[2 + (j + 5) * bs + ii * sda] = A[j + 5 + (ii + 2) * lda];
      pA[3 + (j + 5) * bs + ii * sda] = A[j + 5 + (ii + 3) * lda];
      pA[4 + (j + 5) * bs + ii * sda] = A[j + 5 + (ii + 4) * lda];
      pA[5 + (j + 5) * bs + ii * sda] = A[j + 5 + (ii + 5) * lda];
      pA[6 + (j + 5) * bs + ii * sda] = A[j + 5 + (ii + 6) * lda];
      pA[7 + (j + 5) * bs + ii * sda] = A[j + 5 + (ii + 7) * lda];
      pA[0 + (j + 6) * bs + ii * sda] = A[j + 6 + (ii + 0) * lda];
      pA[1 + (j + 6) * bs + ii * sda] = A[j + 6 + (ii + 1) * lda];
      pA[2 + (j + 6) * bs + ii * sda] = A[j + 6 + (ii + 2) * lda];
      pA[3 + (j + 6) * bs + ii * sda] = A[j + 6 + (ii + 3) * lda];
      pA[4 + (j + 6) * bs + ii * sda] = A[j + 6 + (ii + 4) * lda];
      pA[5 + (j + 6) * bs + ii * sda] = A[j + 6 + (ii + 5) * lda];
      pA[6 + (j + 6) * bs + ii * sda] = A[j + 6 + (ii + 6) * lda];
      pA[7 + (j + 6) * bs + ii * sda] = A[j + 6 + (ii + 7) * lda];
      pA[0 + (j + 7) * bs + ii * sda] = A[j + 7 + (ii + 0) * lda];
      pA[1 + (j + 7) * bs + ii * sda] = A[j + 7 + (ii + 1) * lda];
      pA[2 + (j + 7) * bs + ii * sda] = A[j + 7 + (ii + 2) * lda];
      pA[3 + (j + 7) * bs + ii * sda] = A[j + 7 + (ii + 3) * lda];
      pA[4 + (j + 7) * bs + ii * sda] = A[j + 7 + (ii + 4) * lda];
      pA[5 + (j + 7) * bs + ii * sda] = A[j + 7 + (ii + 5) * lda];
      pA[6 + (j + 7) * bs + ii * sda] = A[j + 7 + (ii + 6) * lda];
      pA[7 + (j + 7) * bs + ii * sda] = A[j + 7 + (ii + 7) * lda];
    }
    for (; j < row; j++) {
      pA[0 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 0) * lda];
      pA[1 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 1) * lda];
      pA[2 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 2) * lda];
      pA[3 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 3) * lda];
      pA[4 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 4) * lda];
      pA[5 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 5) * lda];
      pA[6 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 6) * lda];
      pA[7 + (j + 0) * bs + ii * sda] = A[j + 0 + (ii + 7) * lda];
    }
  }
  if (ii < row1) {
    row2 = row1 - ii;
    if (bs < row2)
      row2 = bs;
    for (j = 0; j < row; j++) {
      for (i = 0; i < row2; i++) {
        pA[i + j * bs + ii * sda] = A[j + (i + ii) * lda];
      }
    }
  }
}
```