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

```asm
<spack_trans>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  mov    %edi,-0x6c(%rbp)
  mov    %rsi,-0x78(%rbp)
  mov    %rdx,-0x80(%rbp)
  mov    %rcx,-0x88(%rbp)
  mov    $0x0,%ebx
  jmp    L144
L162:
  mov    %ebx,%eax
  imul   -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x48(%rbp)
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x40(%rbp)
  mov    $0x0,%r12d
  jmp    L60
L201:
  mov    -0x48(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    -0x48(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x40(%rbp),%rdx
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x40(%rbp),%rax
  movsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x6c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x40(%rbp)
  add    $0x1,%r12d
L60:
  cmp    %ebx,%r12d
  jl     L201
  add    $0x1,%ebx
L144:
  cmp    -0x6c(%rbp),%ebx
  jl     L162
  mov    $0x0,%ebx
  jmp    L154
L94:
  lea    0x1(%rbx),%eax
  imul   %ebx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x54(%rbp)
  mov    $0x0,%r12d
  jmp    L172
L196:
  mov    %r12d,%eax
  imul   -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x54(%rbp),%eax
  mov    %eax,-0x58(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    $0x0,%r13d
  jmp    L39
L57:
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x38(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  addl   $0x1,-0x58(%rbp)
  add    $0x1,%r13d
L39:
  cmp    %ebx,%r13d
  jle    L57
  subl   $0x1,-0x58(%rbp)
  lea    0x1(%rbx),%r13d
  jmp    L87
L65:
  add    %r13d,-0x58(%rbp)
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x38(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x38(%rbp)
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  add    $0x1,%r13d
L87:
  cmp    -0x6c(%rbp),%r13d
  jl     L65
  mov    %r12d,%eax
  imul   -0x6c(%rbp),%eax
  movslq %eax,%rdx
  movslq %ebx,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%r12d
L172:
  cmp    -0x6c(%rbp),%r12d
  jl     L196
  add    $0x1,%ebx
L154:
  cmp    -0x6c(%rbp),%ebx
  jl     L94
  mov    $0x0,%ebx
  jmp    L7
L76:
  mov    %ebx,%eax
  imul   -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  lea    0x1(%rbx),%eax
  imul   %ebx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x5c(%rbp)
  mov    $0x0,%r12d
  jmp    L56
L46:
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    %r12d,%eax
  imul   -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    $0x0,%r13d
  jmp    L181
L152:
  mov    -0x30(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movsd  (%rax),%xmm1
  mov    -0x28(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  add    $0x1,%r13d
L181:
  cmp    -0x6c(%rbp),%r13d
  jl     L152
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x5c(%rbp)
  add    $0x1,%r12d
L56:
  cmp    %ebx,%r12d
  jle    L46
  add    $0x1,%ebx
L7:
  cmp    -0x6c(%rbp),%ebx
  jl     L76
  mov    $0x0,%ebx
  jmp    L116
L72:
  mov    %ebx,%eax
  imul   -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x48(%rbp)
  movslq %ebx,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x40(%rbp)
  mov    $0x0,%r12d
  jmp    L101
L216:
  mov    -0x48(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    -0x48(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x40(%rbp),%rdx
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x40(%rbp),%rax
  movsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x6c(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,-0x40(%rbp)
  add    $0x1,%r12d
L101:
  cmp    %ebx,%r12d
  jl     L216
  add    $0x1,%ebx
L116:
  cmp    -0x6c(%rbp),%ebx
  jl     L72
  nop
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  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;
}
```