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

```asm
<scale2x>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8d,-0x3c(%rbp)
  mov    %r9d,-0x40(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  cmpl   $0x1,0x10(%rbp)
  seta   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    0x10(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x30(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%r10
  mov    -0x2c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x3c(%rbp),%r8d
  mov    -0x8(%rbp),%rcx
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  sub    $0x8,%rsp
  mov    -0x40(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <stage_scale2x@plt>
  add    $0x10,%rsp
  mov    -0x2c(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%eax
  add    %rax,-0x10(%rbp)
  subl   $0x2,-0x14(%rbp)
  jmp    L10
L0:
  mov    -0x30(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%r10
  mov    -0x30(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x2c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x3c(%rbp),%r8d
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  sub    $0x8,%rsp
  mov    -0x40(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <stage_scale2x@plt>
  add    $0x10,%rsp
  mov    -0x2c(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%eax
  add    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%eax
  add    %rax,-0x8(%rbp)
  subl   $0x1,-0x14(%rbp)
L10:
  cmpl   $0x0,-0x14(%rbp)
  jne    L0
  mov    -0x30(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%r10
  mov    -0x30(%rbp),%edx
  mov    -0x8(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x2c(%rbp),%edx
  mov    -0x10(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x3c(%rbp),%r8d
  mov    -0x8(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  sub    $0x8,%rsp
  mov    -0x40(%rbp),%edi
  push   %rdi
  mov    %r8d,%r9d
  mov    %r10,%r8
  mov    %rax,%rdi
  call   <stage_scale2x@plt>
  add    $0x10,%rsp
  nop
  leave
  ret
```

assistant: ```c
void scale2x(void *void_dst, unsigned dst_slice, const void *void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height) {
  unsigned char *dst = (unsigned char *)void_dst;
  const unsigned char *src = (const unsigned char *)void_src;
  unsigned count;
  assert(height >= 2);
  count = height;
  stage_scale2x((dst + (0) * dst_slice), (dst + (1) * dst_slice), (src + (0) * src_slice), (src + (0) * src_slice), (src + (1) * src_slice), pixel, width);
  dst = (dst + (2) * dst_slice);
  count -= 2;
  while (count) {
    stage_scale2x((dst + (0) * dst_slice), (dst + (1) * dst_slice), (src + (0) * src_slice), (src + (1) * src_slice), (src + (2) * src_slice), pixel, width);
    dst = (dst + (2) * dst_slice);
    src = (src + (1) * src_slice);
    --count;
  }
  stage_scale2x((dst + (0) * dst_slice), (dst + (1) * dst_slice), (src + (0) * src_slice), (src + (1) * src_slice), (src + (1) * src_slice), pixel, width);
}
```