user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<spack_trans>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,-0x8(%rsp)
  mov    %rcx,-0x10(%rsp)
  test   %edi,%edi
  jle    L214
  mov    %edi,%r10d
  mov    %rsi,%r8
  movslq %edi,%rax
  lea    0x0(,%rax,8),%r14
  lea    (%rdx,%r14,1),%r11
  lea    0x8(%rdx),%r9
  lea    0x8(%r14),%rbx
  lea    (%rdx,%rbx,1),%rcx
  mov    $0x0,%edi
  jmp    L38
L211:
  mov    %r11,%rax
  mov    %r9,%rdx
  test   %esi,%esi
  jle    L5
L89:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  movsd  (%rdx),%xmm1
  movsd  %xmm1,-0x8(%rax)
  movsd  %xmm0,(%rdx)
  add    %r14,%rdx
  cmp    %rcx,%rax
  jne    L89
L5:
  add    %r14,%r11
  add    $0x8,%r9
  add    %rbx,%rcx
  mov    %esi,%edi
L38:
  lea    0x1(%rdi),%esi
  cmp    %esi,%r10d
  jne    L211
  mov    $0x8,%r9d
  movq   $0x0,-0x28(%rsp)
  mov    $0x0,%r13d
  mov    $0x0,%r15d
  mov    %r14,-0x38(%rsp)
  jmp    L107
L50:
  mov    %eax,%ebp
L57:
  mov    %r11,%rax
  test   %r13d,%r13d
  js     L132
  mov    $0x0,%edx
  pxor   %xmm0,%xmm0
L127:
  movsd  (%r10,%rdx,1),%xmm1
  mulsd  (%rax,%rdx,1),%xmm1
  addsd  %xmm1,%xmm0
  add    $0x8,%rdx
  cmp    %r9,%rdx
  jne    L127
  mov    -0x30(%rsp),%rax
  add    %r11,%rax
  mov    %r14d,%ecx
L35:
  sub    $0x1,%ecx
  cmp    %r12d,%edi
  jle    L96
  mov    %r15d,%edx
L205:
  add    %edx,%ecx
  add    $0x8,%rax
  movslq %ecx,%rsi
  movsd  (%r8,%rsi,8),%xmm1
  mulsd  -0x8(%rax),%xmm1
  addsd  %xmm1,%xmm0
  mov    %edx,%esi
  add    $0x1,%edx
  cmp    %esi,%edi
  jne    L205
L96:
  movsd  %xmm0,(%rbx)
  lea    0x1(%rbp),%eax
  mov    -0x38(%rsp),%rcx
  add    %rcx,%rbx
  add    %rcx,%r11
  cmp    %ebp,%edi
  jne    L50
  add    $0x1,%r13
  addq   $0x8,-0x28(%rsp)
  add    $0x8,%r9
  cmp    %r12d,%edi
  je     L20
L107:
  mov    %r15d,%r12d
  add    $0x1,%r15d
  mov    %r15d,%edx
  imul   %r12d,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  mov    %eax,%ecx
  sar    %ecx
  mov    %ecx,-0x1c(%rsp)
  mov    -0x28(%rsp),%rsi
  mov    %rsi,%rbx
  add    -0x10(%rsp),%rbx
  mov    -0x8(%rsp),%r11
  mov    %r11,-0x18(%rsp)
  movslq %ecx,%rax
  lea    (%r8,%rax,8),%r10
  mov    $0x0,%ebp
  lea    0x8(%rsi),%rax
  mov    %rax,-0x30(%rsp)
  lea    0x1(%r12,%rcx,1),%r14d
  jmp    L57
L132:
  mov    -0x1c(%rsp),%ecx
  pxor   %xmm0,%xmm0
  jmp    L35
L20:
  mov    %rcx,%r14
  mov    %edi,%esi
  mov    -0x18(%rsp),%r12
  mov    $0x0,%ebp
  lea    0x8(%r8),%r13
  mov    -0x10(%rsp),%rbx
  jmp    L166
L51:
  mov    %rax,%rbp
L166:
  mov    %r12,%r9
  lea    0x1(%rbp),%edx
  imul   %ebp,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  test   %ebp,%ebp
  js     L199
  cltq
  lea    (%r8,%rax,8),%r10
  add    %rbp,%rax
  lea    0x0(%r13,%rax,8),%r15
  mov    %rbx,%r11
L59:
  mov    %r11,%rcx
  mov    $0x0,%eax
  pxor   %xmm1,%xmm1
L189:
  movsd  (%r9,%rax,8),%xmm0
  mulsd  (%rcx,%rax,8),%xmm0
  addsd  %xmm0,%xmm1
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rdx,%rsi
  jne    L189
  movsd  %xmm1,(%r10)
  add    $0x8,%r10
  add    %r14,%r11
  cmp    %r10,%r15
  jne    L59
L199:
  lea    0x1(%rbp),%rax
  add    %r14,%r12
  cmp    %rsi,%rbp
  jne    L51
  mov    -0x18(%rsp),%r9
  mov    %r9,%r8
  mov    $0x0,%esi
  jmp    L78
L114:
  mov    %eax,%esi
L78:
  mov    %r9,%rax
  mov    %r8,%rdx
  test   %esi,%esi
  jle    L23
  mov    %esi,%ecx
  lea    (%r9,%rcx,8),%rcx
L113:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  movsd  (%rdx),%xmm1
  movsd  %xmm1,-0x8(%rax)
  movsd  %xmm0,(%rdx)
  add    %r14,%rdx
  cmp    %rcx,%rax
  jne    L113
L23:
  lea    0x1(%rsi),%eax
  add    %r14,%r9
  add    $0x8,%r8
  cmp    %esi,%edi
  jne    L114
L214:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
void spack_trans(int n, double *a, double *z, double *tmp) {
  register int i, j, k;
  int ij, ik, ii;
  double s, *zij, *zji, *zjk, *zik, *zi, *tjk;
  for (i = 0; i < n; i++) {
    zij = z + i * n;
    zji = z + i;
    for (j = 0; j < i; j++) {
      s = (*(zij));
      (*zij++) = (*zji);
      (*zji) = s;
      zji += n;
    }
  }
  for (i = 0; i < n; i++) {
    ii = i * (i + 1) / 2;
    for (j = 0; j < n; j++) {
      zjk = z + j * n;
      ik = ii;
      s = 0.0;
      for (k = 0; k <= i; ik++, k++) {
        s += a[ik] * (*zjk++);
      }
      --ik;
      for (k = (i + 1); k < n; k++) {
        ik = ik + k;
        s += a[ik] * (*zjk++);
      }
      (*(tmp + j * n + i)) = s;
    }
  }
  for (i = 0; i < n; i++) {
    zi = z + i * n;
    ij = i * (i + 1) / 2;
    for (j = 0; j <= i; ij++, j++) {
      zik = zi;
      tjk = tmp + j * n;
      s = 0.0;
      for (k = 0; k < n; k++) {
        s += (*zik++) * (*tjk++);
      }
      a[ij] = s;
    }
  }
  for (i = 0; i < n; i++) {
    zij = z + i * n;
    zji = z + i;
    for (j = 0; j < i; j++) {
      s = (*(zij));
      (*zij++) = (*zji);
      (*zji) = s;
      zji += n;
    }
  }
  return;
}
```