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

```asm
<fromroot_transtable>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,%r10
  mov    %edx,%esi
  mov    %ecx,0xc(%rsp)
  mov    %r8d,0x18(%rsp)
  mov    %r9,(%rsp)
  mov    0x60(%rsp),%r13
  mov    0x68(%rsp),%r12
  mov    %r12,%rax
  lea    0x120(%r12),%rdx
L6:
  movq   $0x0,(%rax)
  movq   $0x0,0x8(%rax)
  movq   $0x0,0x10(%rax)
  movq   $0x0,0x18(%rax)
  movq   $0x0,0x20(%rax)
  movq   $0x0,0x28(%rax)
  add    $0x30,%rax
  cmp    %rdx,%rax
  jne    L6
  test   %esi,%esi
  jle    L13
  movslq 0x18(%rsp),%rax
  lea    (%rdi,%rax,8),%r15
  movslq 0xc(%rsp),%rax
  lea    (%rdi,%rax,8),%r14
  mov    %r10,%rbp
  lea    -0x1(%rsi),%eax
  lea    0x4(%r10,%rax,4),%rax
  mov    %rax,0x10(%rsp)
  mov    $0x0,%ebx
  jmp    L107
L90:
  jle    L9
  pxor   %xmm0,%xmm0
  cvtss2sd 0x0(%rbp),%xmm0
  addsd  0x20(%r12),%xmm0
  movsd  %xmm0,0x20(%r12)
  mov    (%rsp),%rax
  mov    (%rax,%rbx,1),%eax
  mov    %eax,0x1c(%rsp)
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  0x0(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  0xe0(%r12),%xmm0
  movsd  %xmm0,0xe0(%r12)
  cmpl   $0x0,0x0(%r13,%rbx,1)
  jle    L17
  pxor   %xmm0,%xmm0
  cvtss2sd 0x0(%rbp),%xmm0
  addsd  0xe8(%r12),%xmm0
  movsd  %xmm0,0xe8(%r12)
  mov    0x0(%r13,%rbx,1),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  0x0(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  0x118(%r12),%xmm0
  movsd  %xmm0,0x118(%r12)
  movslq %edx,%rax
  pxor   %xmm0,%xmm0
  cvtss2sd 0x0(%rbp),%xmm0
  addsd  0xf0(%r12,%rax,8),%xmm0
  movsd  %xmm0,0xf0(%r12,%rax,8)
L73:
  add    $0x4,%rbx
  add    $0x4,%rbp
  cmp    %rbp,0x10(%rsp)
  je     L13
L107:
  mov    (%r15),%rax
  mov    (%rax,%rbx,1),%ecx
  mov    (%r14),%rax
  mov    (%rax,%rbx,1),%edx
  mov    0x18(%rsp),%esi
  mov    0xc(%rsp),%edi
  call   <assign_cell@plt>
  mov    %eax,%edx
  mov    (%rsp),%rax
  mov    (%rax,%rbx,1),%eax
  test   %eax,%eax
  jne    L90
  cmpl   $0x0,0x0(%r13,%rbx,1)
  jne    L9
  movslq %edx,%rax
  pxor   %xmm0,%xmm0
  cvtss2sd 0x0(%rbp),%xmm0
  addsd  (%r12,%rax,8),%xmm0
  movsd  %xmm0,(%r12,%rax,8)
  jmp    L73
L17:
  movslq %edx,%rax
  pxor   %xmm0,%xmm0
  cvtss2sd 0x0(%rbp),%xmm0
  addsd  0xc0(%r12,%rax,8),%xmm0
  movsd  %xmm0,0xc0(%r12,%rax,8)
  jmp    L73
L9:
  cmpl   $0x0,0x0(%r13,%rbx,1)
  jle    L73
  pxor   %xmm0,%xmm0
  cvtss2sd 0x0(%rbp),%xmm0
  addsd  0x28(%r12),%xmm0
  movsd  %xmm0,0x28(%r12)
  mov    0x0(%r13,%rbx,1),%eax
  sub    $0x1,%eax
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mulss  0x0(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  addsd  0x118(%r12),%xmm0
  movsd  %xmm0,0x118(%r12)
  movslq %edx,%rax
  pxor   %xmm0,%xmm0
  cvtss2sd 0x0(%rbp),%xmm0
  addsd  0xf0(%r12,%rax,8),%xmm0
  movsd  %xmm0,0xf0(%r12,%rax,8)
  jmp    L73
L13:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void fromroot_transtable(int **aseqsT, float *weights, int nseq, int i2, int j2, int *accum_insl, int *accum_insr, double trans[6][6]) {
  int fy, ty;
  int idx;
  for (fy = 0; fy < 6; fy++)
    for (ty = 0; ty < 6; ty++)
      trans[fy][ty] = 0.0;
  for (idx = 0; idx < nseq; idx++) {
    ty = assign_cell(i2, j2, aseqsT[i2][idx], aseqsT[j2][idx]);
    if (accum_insl[idx] == 0 && accum_insr[idx] == 0) {
      trans[0][ty] += weights[idx];
    } else if (accum_insl[idx] > 0) {
      trans[0][4] += weights[idx];
      trans[4][4] += (accum_insl[idx] - 1) * weights[idx];
      if (accum_insr[idx] > 0) {
        trans[4][5] += weights[idx];
        trans[5][5] += (accum_insr[idx] - 1) * weights[idx];
        trans[5][ty] += weights[idx];
      } else {
        trans[4][ty] += weights[idx];
      }
    } else if (accum_insr[idx] > 0) {
      trans[0][5] += weights[idx];
      trans[5][5] += (accum_insr[idx] - 1) * weights[idx];
      trans[5][ty] += weights[idx];
    }
  }
}
```