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

```asm
<scale4x_buf>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %esi,-0x6c(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %ecx,-0x70(%rbp)
  mov    %r8,-0x80(%rbp)
  mov    %r9d,-0x84(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x80(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  cmpl   $0x3,0x20(%rbp)
  seta   %al
  movzbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    0x20(%rbp),%eax
  mov    %eax,-0x5c(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x40(%rbp),%rdx
  mov    -0x70(%rbp),%eax
  add    %rdx,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x38(%rbp),%rdx
  mov    -0x70(%rbp),%eax
  add    %rdx,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x30(%rbp),%rdx
  mov    -0x70(%rbp),%eax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rdx
  mov    -0x70(%rbp),%eax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x70(%rbp),%eax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x84(%rbp),%edx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%r8
  mov    -0x18(%rbp),%rsi
  mov    -0x20(%rbp),%rax
  mov    -0x50(%rbp),%rcx
  mov    -0x50(%rbp),%rdx
  mov    0x28(%rbp),%edi
  push   %rdi
  mov    0x18(%rbp),%edi
  push   %rdi
  mov    0x10(%rbp),%r9d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale2x@plt>
  add    $0x10,%rsp
  mov    -0x84(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%r8
  mov    -0x84(%rbp),%edx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x38(%rbp),%rsi
  mov    -0x40(%rbp),%rax
  mov    -0x50(%rbp),%rdx
  mov    0x28(%rbp),%edi
  push   %rdi
  mov    0x18(%rbp),%edi
  push   %rdi
  mov    0x10(%rbp),%r9d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale2x@plt>
  add    $0x10,%rsp
  mov    -0x84(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%r8
  mov    -0x84(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x84(%rbp),%edx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  mov    -0x28(%rbp),%rsi
  mov    -0x30(%rbp),%rax
  mov    0x28(%rbp),%edi
  push   %rdi
  mov    0x18(%rbp),%edi
  push   %rdi
  mov    0x10(%rbp),%r9d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale2x@plt>
  add    $0x10,%rsp
  mov    -0x40(%rbp),%r8
  mov    -0x18(%rbp),%rdi
  mov    -0x20(%rbp),%r11
  mov    -0x20(%rbp),%r10
  mov    -0x6c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x6c(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x6c(%rbp),%esi
  mov    -0x58(%rbp),%rax
  add    %rax,%rsi
  mov    -0x58(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x28(%rbp),%r9d
  push   %r9
  mov    0x18(%rbp),%r9d
  push   %r9
  mov    0x10(%rbp),%r9d
  push   %r9
  push   %r8
  push   %rdi
  mov    %r11,%r9
  mov    %r10,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale4x@plt>
  add    $0x30,%rsp
  mov    -0x6c(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%eax
  add    %rax,-0x58(%rbp)
  mov    -0x30(%rbp),%r8
  mov    -0x38(%rbp),%rdi
  mov    -0x40(%rbp),%r11
  mov    -0x18(%rbp),%r10
  mov    -0x6c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x6c(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x6c(%rbp),%esi
  mov    -0x58(%rbp),%rax
  add    %rax,%rsi
  mov    -0x58(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x28(%rbp),%r9d
  push   %r9
  mov    0x18(%rbp),%r9d
  push   %r9
  mov    0x10(%rbp),%r9d
  push   %r9
  push   %r8
  push   %rdi
  mov    %r11,%r9
  mov    %r10,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale4x@plt>
  add    $0x30,%rsp
  mov    -0x6c(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%eax
  add    %rax,-0x58(%rbp)
  subl   $0x4,-0x5c(%rbp)
  jmp    L17
L14:
  mov    -0x84(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%r8
  mov    -0x84(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x84(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rsi
  mov    -0x20(%rbp),%rax
  mov    0x28(%rbp),%edi
  push   %rdi
  mov    0x18(%rbp),%edi
  push   %rdi
  mov    0x10(%rbp),%r9d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale2x@plt>
  add    $0x10,%rsp
  mov    -0x20(%rbp),%r8
  mov    -0x28(%rbp),%rdi
  mov    -0x30(%rbp),%r11
  mov    -0x38(%rbp),%r10
  mov    -0x6c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x6c(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x6c(%rbp),%esi
  mov    -0x58(%rbp),%rax
  add    %rax,%rsi
  mov    -0x58(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x28(%rbp),%r9d
  push   %r9
  mov    0x18(%rbp),%r9d
  push   %r9
  mov    0x10(%rbp),%r9d
  push   %r9
  push   %r8
  push   %rdi
  mov    %r11,%r9
  mov    %r10,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale4x@plt>
  add    $0x30,%rsp
  mov    -0x6c(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%eax
  add    %rax,-0x58(%rbp)
  mov    -0x84(%rbp),%eax
  add    %rax,-0x50(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  subl   $0x1,-0x5c(%rbp)
L17:
  cmpl   $0x0,-0x5c(%rbp)
  jne    L14
  mov    -0x84(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%r8
  mov    -0x84(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x84(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rsi
  mov    -0x20(%rbp),%rax
  mov    0x28(%rbp),%edi
  push   %rdi
  mov    0x18(%rbp),%edi
  push   %rdi
  mov    0x10(%rbp),%r9d
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale2x@plt>
  add    $0x10,%rsp
  mov    -0x20(%rbp),%r8
  mov    -0x28(%rbp),%rdi
  mov    -0x30(%rbp),%r11
  mov    -0x38(%rbp),%r10
  mov    -0x6c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x6c(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x6c(%rbp),%esi
  mov    -0x58(%rbp),%rax
  add    %rax,%rsi
  mov    -0x58(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x28(%rbp),%r9d
  push   %r9
  mov    0x18(%rbp),%r9d
  push   %r9
  mov    0x10(%rbp),%r9d
  push   %r9
  push   %r8
  push   %rdi
  mov    %r11,%r9
  mov    %r10,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale4x@plt>
  add    $0x30,%rsp
  mov    -0x6c(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,%eax
  add    %rax,-0x58(%rbp)
  mov    -0x18(%rbp),%r8
  mov    -0x18(%rbp),%rdi
  mov    -0x20(%rbp),%r11
  mov    -0x28(%rbp),%r10
  mov    -0x6c(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x6c(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x6c(%rbp),%esi
  mov    -0x58(%rbp),%rax
  add    %rax,%rsi
  mov    -0x58(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x28(%rbp),%r9d
  push   %r9
  mov    0x18(%rbp),%r9d
  push   %r9
  mov    0x10(%rbp),%r9d
  push   %r9
  push   %r8
  push   %rdi
  mov    %r11,%r9
  mov    %r10,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stage_scale4x@plt>
  add    $0x30,%rsp
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L8
  call   <__stack_chk_fail@plt>
L8:
  leave
  ret
```

assistant: ```c
void scale4x_buf(void *void_dst, unsigned dst_slice, void *void_mid, unsigned mid_slice, const void *void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height, unsigned opt) {
  unsigned char *dst = (unsigned char *)void_dst;
  const unsigned char *src = (const unsigned char *)void_src;
  unsigned count;
  unsigned char *mid[6];
  assert(height >= 4);
  count = height;
  mid[0] = (unsigned char *)void_mid;
  mid[1] = mid[0] + mid_slice;
  mid[2] = mid[1] + mid_slice;
  mid[3] = mid[2] + mid_slice;
  mid[4] = mid[3] + mid_slice;
  mid[5] = mid[4] + mid_slice;
  stage_scale2x((mid[(-2 + 6)]), (mid[(-1 + 6)]), (src + (0) * src_slice), (src + (0) * src_slice), (src + (1) * src_slice), pixel, width, opt);
  stage_scale2x((mid[(0)]), (mid[(1)]), (src + (0) * src_slice), (src + (1) * src_slice), (src + (2) * src_slice), pixel, width, opt);
  stage_scale2x((mid[(2)]), (mid[(3)]), (src + (1) * src_slice), (src + (2) * src_slice), (src + (3) * src_slice), pixel, width, opt);
  stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice), (dst + (2) * dst_slice), (dst + (3) * dst_slice), (mid[(-2 + 6)]), (mid[(-2 + 6)]), (mid[(-1 + 6)]), (mid[(0)]), pixel, width, opt);
  dst = (dst + (4) * dst_slice);
  stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice), (dst + (2) * dst_slice), (dst + (3) * dst_slice), (mid[(-1 + 6)]), (mid[(0)]), (mid[(1)]), (mid[(2)]), pixel, width, opt);
  dst = (dst + (4) * dst_slice);
  count -= 4;
  while (count) {
    unsigned char *tmp;
    stage_scale2x((mid[(4)]), (mid[(5)]), (src + (2) * src_slice), (src + (3) * src_slice), (src + (4) * src_slice), pixel, width, opt);
    stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice), (dst + (2) * dst_slice), (dst + (3) * dst_slice), (mid[(1)]), (mid[(2)]), (mid[(3)]), (mid[(4)]), pixel, width, opt);
    dst = (dst + (4) * dst_slice);
    src = (src + (1) * src_slice);
    tmp = (mid[(0)]);
    (mid[(0)]) = (mid[(2)]);
    (mid[(2)]) = (mid[(4)]);
    (mid[(4)]) = tmp;
    tmp = (mid[(1)]);
    (mid[(1)]) = (mid[(3)]);
    (mid[(3)]) = (mid[(5)]);
    (mid[(5)]) = tmp;
    --count;
  }
  stage_scale2x((mid[(4)]), (mid[(5)]), (src + (2) * src_slice), (src + (3) * src_slice), (src + (3) * src_slice), pixel, width, opt);
  stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice), (dst + (2) * dst_slice), (dst + (3) * dst_slice), (mid[(1)]), (mid[(2)]), (mid[(3)]), (mid[(4)]), pixel, width, opt);
  dst = (dst + (4) * dst_slice);
  stage_scale4x((dst + (0) * dst_slice), (dst + (1) * dst_slice), (dst + (2) * dst_slice), (dst + (3) * dst_slice), (mid[(3)]), (mid[(4)]), (mid[(5)]), (mid[(5)]), pixel, width, opt);
}
```