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

```asm
<s_cvt_d2s_pmat>:
  endbr64
  push   %r15
  mov    %r9d,%eax
  mov    %edx,%r11d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%r13
  mov    %edx,-0x58(%rsp)
  cltd
  idiv   %r11d
  mov    %edi,-0xc(%rsp)
  mov    %esi,-0x3c(%rsp)
  mov    %r9d,-0x54(%rsp)
  mov    %eax,-0x2c(%rsp)
  test   %edi,%edi
  jle    L70
  test   %eax,%eax
  jle    L70
  test   %esi,%esi
  jle    L70
  mov    %r9d,%eax
  mov    %rcx,%r14
  mov    %r8d,%ecx
  mov    %r9d,%ebx
  imul   %r8d,%eax
  mov    %edi,-0x1c(%rsp)
  xor    %r15d,%r15d
  imul   0x40(%rsp),%ebx
  movl   $0x0,-0x18(%rsp)
  imul   %r11d,%ecx
  movl   $0x0,-0x20(%rsp)
  mov    %eax,-0x10(%rsp)
  movslq %r11d,%rax
  shl    $0x3,%rax
  mov    %ebx,-0x14(%rsp)
  mov    %rax,-0x50(%rsp)
  movslq %r9d,%rax
  shl    $0x2,%rax
  mov    %ecx,-0x30(%rsp)
  mov    %rax,-0x48(%rsp)
L77:
  mov    -0x1c(%rsp),%eax
  mov    -0x58(%rsp),%ebx
  cmp    %ebx,%eax
  cmovle %eax,%ebx
  test   %ebx,%ebx
  jle    L114
  lea    -0x1(%rbx),%eax
  movl   $0x0,-0x34(%rsp)
  mov    -0x18(%rsp),%r12d
  xor    %ebp,%ebp
  mov    %eax,-0x40(%rsp)
  mov    %ebx,%eax
  shr    $0x2,%eax
  lea    -0x1(%rax),%r8d
  mov    %ebx,%eax
  and    $0xfffffffc,%eax
  add    $0x1,%r8
  mov    %eax,-0x38(%rsp)
  movslq %r15d,%rax
  shl    $0x4,%r8
  mov    %rax,-0x28(%rsp)
  nopl   0x0(%rax,%rax,1)
L26:
  movslq %r12d,%rax
  movslq %ebp,%rdx
  add    -0x28(%rsp),%rdx
  xor    %r10d,%r10d
  lea    (%r14,%rax,8),%rax
  lea    0x0(%r13,%rdx,4),%rcx
  xor    %r9d,%r9d
  xor    %r11d,%r11d
  nopl   (%rax)
L61:
  xor    %edx,%edx
  cmpl   $0x2,-0x40(%rsp)
  jbe    L115
  nopl   (%rax)
L85:
  movupd (%rax,%rdx,2),%xmm2
  movupd 0x10(%rax,%rdx,2),%xmm3
  cvtpd2ps %xmm2,%xmm0
  cvtpd2ps %xmm3,%xmm1
  movlhps %xmm1,%xmm0
  movups %xmm0,(%rcx,%rdx,1)
  add    $0x10,%rdx
  cmp    %r8,%rdx
  jne    L85
  mov    -0x38(%rsp),%edi
  mov    %edi,%edx
  cmp    %ebx,%edi
  je     L3
L6:
  lea    0x0(%rbp,%rdx,1),%esi
  lea    (%r9,%rdx,1),%edi
  pxor   %xmm0,%xmm0
  add    %r10d,%esi
  add    %r12d,%edi
  add    %r15d,%esi
  movslq %edi,%rdi
  movslq %esi,%rsi
  cvtsd2ss (%r14,%rdi,8),%xmm0
  movss  %xmm0,0x0(%r13,%rsi,4)
  lea    0x1(%rdx),%esi
  cmp    %esi,%ebx
  jle    L3
  lea    0x0(%rbp,%rsi,1),%edi
  add    %r9d,%esi
  pxor   %xmm0,%xmm0
  add    $0x2,%edx
  add    %r10d,%edi
  add    %r12d,%esi
  add    %r15d,%edi
  movslq %esi,%rsi
  movslq %edi,%rdi
  cvtsd2ss (%r14,%rsi,8),%xmm0
  movss  %xmm0,0x0(%r13,%rdi,4)
  cmp    %edx,%ebx
  jle    L3
  lea    0x0(%rbp,%rdx,1),%esi
  add    %r9d,%edx
  pxor   %xmm0,%xmm0
  add    %r10d,%esi
  add    %r12d,%edx
  add    %r15d,%esi
  movslq %edx,%rdx
  movslq %esi,%rsi
  cvtsd2ss (%r14,%rdx,8),%xmm0
  movss  %xmm0,0x0(%r13,%rsi,4)
L3:
  add    $0x1,%r11d
  add    -0x58(%rsp),%r9d
  add    -0x54(%rsp),%r10d
  add    -0x50(%rsp),%rax
  add    -0x48(%rsp),%rcx
  cmp    %r11d,-0x3c(%rsp)
  jne    L61
  addl   $0x1,-0x34(%rsp)
  add    -0x30(%rsp),%r12d
  mov    -0x34(%rsp),%eax
  add    -0x58(%rsp),%ebp
  cmp    %eax,-0x2c(%rsp)
  jne    L26
L114:
  mov    -0x54(%rsp),%ebx
  mov    -0x10(%rsp),%ecx
  add    %ebx,-0x20(%rsp)
  add    -0x14(%rsp),%r15d
  sub    %ebx,-0x1c(%rsp)
  mov    -0x20(%rsp),%eax
  add    %ecx,-0x18(%rsp)
  cmp    %eax,-0xc(%rsp)
  jg     L77
L70:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L115:
  xor    %edx,%edx
  jmp    L6
```

assistant: ```c
void s_cvt_d2s_pmat(int row, int col, int dbs, double *A, int sda, int sbs, float *B, int sdb) {
  int i, ii, j, row2, ll;
  int bs_ratio = sbs / dbs;
  for (ii = 0; ii < row; ii += sbs) {
    for (ll = 0; ll < bs_ratio; ll++) {
      row2 = row - ii;
      if (dbs < row2)
        row2 = dbs;
      for (j = 0; j < col; j++) {
        for (i = 0; i < row2; i++) {
          B[i + ll * dbs + j * sbs + ii * sdb] = (float)A[i + j * dbs + (ii + ll * dbs) * sda];
        }
      }
    }
  }
}
```