user: 请从给定的汇编指令推导出C源代码：

```asm
<BalBak>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8d,-0x30(%rbp)
  mov    %r9,-0x40(%rbp)
  cmpl   $0x0,-0x30(%rbp)
  je     L145
  mov    -0x2c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  je     L71
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L142
L20:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L132
L0:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mulsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L132:
  mov    -0x14(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L0
  addl   $0x1,-0x18(%rbp)
L142:
  mov    -0x18(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jle    L20
L71:
  movl   $0x0,-0x10(%rbp)
  jmp    L90
L143:
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L159
  mov    -0x18(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jle    L74
L159:
  mov    -0x18(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jge    L167
  mov    -0x28(%rbp),%eax
  sub    -0x10(%rbp),%eax
  mov    %eax,-0x18(%rbp)
L167:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  js     L129
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jge    L129
  mov    -0xc(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  je     L74
  movl   $0x0,-0x14(%rbp)
  jmp    L149
L120:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x40(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rcx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L149:
  mov    -0x14(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L120
L74:
  addl   $0x1,-0x10(%rbp)
L90:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L143
  jmp    L145
L129:
  nop
L145:
  pop    %rbp
  ret
```

assistant: ```c
void BalBak(n, low, high, scale, m, z) int n, low, high;
double *scale;
int m;
double **z;
{
  int i, j, k, ii;
  double s;
  if (m != 0) {
    if (high != low) {
      for (i = low; i <= high; i++) {
        s = scale[i];
        for (j = 0; j < m; j++)
          z[i][j] *= s;
      }
    }
    for (ii = 0; ii < n; ii++) {
      i = ii;
      if ((i < low) || (i > high)) {
        if (i < low)
          i = low - ii;
        k = (int)scale[i];
        if (k < 0 || k >= n) {
          return;
        }
        if (k != i) {
          for (j = 0; j < m; j++) {
            s = z[i][j];
            z[i][j] = z[k][j];
            z[k][j] = s;
          }
        }
      }
    }
  }
}
```