user: Converte this assembly snippet into its equivalent C code:

```asm
<matprod_trans12_sub>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %ecx,-0x9c(%rbp)
  mov    %r8d,-0xa0(%rbp)
  mov    %r9d,-0xa4(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  mov    $0x1,%edi
  call   <assert@plt>
  cmpl   $0x1,-0xa4(%rbp)
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x1,-0xa0(%rbp)
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x1,-0x9c(%rbp)
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x1,0x10(%rbp)
  setg   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  cmpl   $0x2,-0xa4(%rbp)
  jne    L215
  cmpl   $0x2,0x10(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0xa0(%rbp),%edi
  mov    -0x9c(%rbp),%ecx
  mov    -0x98(%rbp),%rdx
  mov    -0x90(%rbp),%rsi
  mov    -0x88(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <matprod_trans12_m2@plt>
  mov    %rbx,%rsp
  jmp    L24
L215:
  movl   $0x80,-0x7c(%rbp)
  mov    -0x7c(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jle    L163
  mov    0x10(%rbp),%eax
  mov    %eax,-0x7c(%rbp)
L163:
  mov    $0x800,%eax
  cltd
  idivl  -0x7c(%rbp)
  and    $0xfffffffc,%eax
  mov    %eax,-0x80(%rbp)
  mov    -0x80(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jle    L166
  mov    -0x9c(%rbp),%eax
  mov    %eax,-0x80(%rbp)
L166:
  mov    -0x80(%rbp),%eax
  imul   -0x7c(%rbp),%eax
  add    $0x3,%eax
  movslq %eax,%rdx
  sub    $0x1,%rdx
  mov    %rdx,-0x50(%rbp)
  movslq %eax,%rdx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  movslq %eax,%rdx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L40:
  cmp    %rdx,%rsp
  je     L103
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L40
L103:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L185
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L185:
  mov    %rsp,%rax
  add    $0x7,%rax
  shr    $0x3,%rax
  shl    $0x3,%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  nop
  movl   $0x0,-0x78(%rbp)
  jmp    L69
L145:
  mov    0x10(%rbp),%eax
  sub    -0x78(%rbp),%eax
  mov    %eax,-0x68(%rbp)
  mov    -0x68(%rbp),%eax
  cmp    -0x7c(%rbp),%eax
  jle    L224
  mov    -0x68(%rbp),%eax
  sub    -0x7c(%rbp),%eax
  cmp    $0x2,%eax
  jg     L180
  mov    -0x68(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  and    $0xfffffffc,%eax
  jmp    L218
L180:
  mov    -0x7c(%rbp),%eax
  jmp    L218
L224:
  mov    -0x68(%rbp),%eax
L218:
  mov    %eax,-0x64(%rbp)
  mov    -0x88(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  movl   $0x0,-0x74(%rbp)
  jmp    L195
L120:
  mov    -0x9c(%rbp),%eax
  sub    -0x74(%rbp),%eax
  mov    %eax,-0x60(%rbp)
  mov    -0x60(%rbp),%eax
  cmp    -0x80(%rbp),%eax
  jle    L138
  mov    -0x60(%rbp),%eax
  sub    -0x80(%rbp),%eax
  cmp    $0x2,%eax
  jg     L92
  mov    -0x60(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  jmp    L119
L92:
  mov    -0x80(%rbp),%eax
  jmp    L119
L138:
  mov    -0x60(%rbp),%eax
L119:
  mov    %eax,-0x5c(%rbp)
  mov    -0x5c(%rbp),%r9d
  mov    -0xa0(%rbp),%r8d
  mov    -0xa4(%rbp),%ecx
  mov    -0x40(%rbp),%rdx
  mov    -0x58(%rbp),%rsi
  mov    -0x90(%rbp),%rax
  mov    -0x64(%rbp),%edi
  push   %rdi
  mov    -0x64(%rbp),%edi
  push   %rdi
  mov    %rax,%rdi
  call   <matprod_mat_mat_sub_xrows@plt>
  add    $0x10,%rsp
  movl   $0x0,-0x70(%rbp)
  jmp    L165
L74:
  movl   $0x0,-0x6c(%rbp)
  jmp    L22
L59:
  mov    -0x70(%rbp),%eax
  imul   -0x64(%rbp),%eax
  mov    %eax,%edx
  mov    -0x6c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rax,%rdx
  mov    -0x74(%rbp),%ecx
  mov    -0x70(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rsi
  mov    -0x6c(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x9c(%rbp),%eax
  cltq
  imul   %rcx,%rax
  add    %rsi,%rax
  lea    0x0(,%rax,8),%rcx
  mov    -0x98(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x6c(%rbp)
L22:
  mov    -0x6c(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L59
  addl   $0x1,-0x70(%rbp)
L165:
  mov    -0x70(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L74
  mov    -0x5c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0xa0(%rbp),%eax
  cltq
  imul   %rdx,%rax
  shl    $0x3,%rax
  add    %rax,-0x58(%rbp)
  mov    -0x5c(%rbp),%eax
  add    %eax,-0x74(%rbp)
L195:
  mov    -0x74(%rbp),%eax
  cmp    -0x9c(%rbp),%eax
  jl     L120
  mov    -0x64(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x90(%rbp)
  mov    -0x64(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x9c(%rbp),%eax
  cltq
  imul   %rdx,%rax
  shl    $0x3,%rax
  add    %rax,-0x98(%rbp)
  mov    -0x64(%rbp),%eax
  add    %eax,-0x78(%rbp)
L69:
  mov    -0x78(%rbp),%eax
  cmp    0x10(%rbp),%eax
  jl     L145
  mov    %rbx,%rsp
L24:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L130
  call   <__stack_chk_fail@plt>
L130:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

assistant: ```c
void matprod_trans12_sub(double *restrict x, double *restrict y, double *restrict z, int n, int k, int m, int zcols) {
  assert(((uintptr_t)(x) & (1 - 1)) == 0);
  assert(((uintptr_t)(y) & (1 - 1)) == 0);
  assert(((uintptr_t)(z) & (1 - 1)) == 0);
  x = (x);
  y = (y);
  z = (z);
  assert(m >= 2);
  assert(k >= 2);
  assert(n >= 2);
  assert(zcols >= 2);
  if (m == 2) {
    assert(zcols == 2);
    matprod_trans12_m2(x, y, z, n, k);
    return;
  }
  int zr, zc;
  zc = 128;
  if (zc > zcols) {
    zc = zcols;
  }
  zr = (2048 / zc) & ~3;
  if (zr > n) {
    zr = n;
  }
  double zelem[zr * zc + 3];
  double *ztmp = zelem;
  while ((((uintptr_t)ztmp) & (1 - 1)) != 0) {
    ztmp += 1;
  }
  int j = 0;
  while (j < zcols) {
    int remaining_cols = zcols - j;
    int zzc = remaining_cols <= zc ? remaining_cols : remaining_cols - zc < 3 ? (remaining_cols / 2) & ~3 : zc;
    double *xx = x;
    int i = 0;
    while (i < n) {
      int remaining_rows = n - i;
      int zzr = remaining_rows <= zr ? remaining_rows : remaining_rows - zr < 3 ? remaining_rows / 2 : zr;
      matprod_mat_mat_sub_xrows(y, xx, ztmp, m, k, zzr, zzc, zzc);
      int ii, jj;
      for (ii = 0; ii < zzr; ii++) {
        for (jj = 0; jj < zzc; jj++) {
          z[i + ii + (size_t)jj * n] = ztmp[jj + ii * zzc];
        }
      }
      xx += (size_t)zzr * k;
      i += zzr;
    }
    y += zzc;
    z += (size_t)zzc * n;
    j += zzc;
  }
}
```