user: Translate the below assembly code into C programming language:

```asm
<scale4x_buf>:
  endbr64
  push   %r15
  mov    %r8,%r15
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  xor    %edi,%edi
  push   %rbx
  mov    %ecx,%ebx
  sub    $0x88,%rsp
  cmpl   $0x3,0xd0(%rsp)
  mov    %esi,0x20(%rsp)
  seta   %dil
  xor    %eax,%eax
  mov    %r9d,0x18(%rsp)
  call   <assert@plt>
  mov    %ebx,%r10d
  mov    0x18(%rsp),%r9d
  mov    %r15,%rbx
  lea    (%r14,%r10,1),%r12
  mov    0xd8(%rsp),%r8d
  mov    %r14,0x10(%rsp)
  mov    %r15,%rcx
  lea    (%r12,%r10,1),%rax
  mov    %r9,0x48(%rsp)
  add    %r9,%rbx
  lea    (%rax,%r10,1),%rdx
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  mov    %rdx,0x8(%rsp)
  lea    (%rdx,%r10,1),%r13
  mov    %r15,%rdx
  push   %r8
  mov    0xd0(%rsp),%r8d
  lea    0x0(%r13,%r10,1),%r14
  mov    %r13,%rdi
  mov    %r14,%rsi
  push   %r8
  mov    0xd0(%rsp),%r9d
  mov    %rbx,%r8
  mov    %r15,0x70(%rsp)
  call   <stage_scale2x@plt>
  mov    0x28(%rsp),%edi
  mov    %rbx,%rcx
  mov    %r12,%rsi
  mov    0xe8(%rsp),%r9d
  mov    0x70(%rsp),%rax
  lea    (%rdi,%rdi,1),%r8d
  mov    %r8,0x40(%rsp)
  mov    %rax,%r11
  mov    %r8,%r15
  mov    %rax,%rdx
  push   %r9
  mov    0xe0(%rsp),%r9d
  add    %r8,%r11
  mov    %r11,%r8
  push   %r9
  mov    0xe0(%rsp),%r9d
  mov    0x30(%rsp),%rdi
  mov    %rax,0x80(%rsp)
  xor    %eax,%eax
  mov    %r11,0x48(%rsp)
  call   <stage_scale2x@plt>
  mov    0x38(%rsp),%ecx
  mov    %rbx,%rdx
  xor    %eax,%eax
  lea    (%r15,%rcx,1),%r9d
  mov    0x80(%rsp),%r15
  mov    %r9,0x70(%rsp)
  add    $0x20,%rsp
  add    %r9,%r15
  mov    0xd8(%rsp),%r9d
  mov    %r15,%r8
  push   %r9
  mov    0xd0(%rsp),%r10d
  push   %r10
  mov    0x38(%rsp),%r11
  mov    0xd0(%rsp),%r9d
  mov    0x18(%rsp),%rsi
  mov    0x78(%rsp),%rdi
  mov    %r11,%rcx
  mov    %r11,0x68(%rsp)
  call   <stage_scale2x@plt>
  mov    0x30(%rsp),%r8d
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    0xe8(%rsp),%r10d
  lea    (%r8,%r8,1),%r9d
  mov    %r8,0x38(%rsp)
  lea    0x0(%rbp,%r8,1),%rsi
  mov    %r10d,(%rsp)
  mov    0xd8(%rsp),%r10d
  lea    (%r9,%r8,1),%edx
  mov    %r13,%r8
  mov    %rdx,0x48(%rsp)
  lea    0x0(%rbp,%rdx,1),%rcx
  lea    0x0(%rbp,%r9,1),%rdx
  mov    %r9,0x50(%rsp)
  mov    %r13,%r9
  push   %r10
  mov    0xd8(%rsp),%r11d
  push   %r11
  mov    0x30(%rsp),%rbx
  push   %rbx
  push   %r14
  call   <stage_scale4x@plt>
  mov    0x50(%rsp),%esi
  xor    %eax,%eax
  lea    0x0(,%rsi,4),%r10d
  mov    %r10,0x50(%rsp)
  mov    0x68(%rsp),%rdx
  add    %r10,%rbp
  add    $0x28,%rsp
  mov    0x48(%rsp),%r9
  mov    0x30(%rsp),%r8
  mov    %rbp,%rdi
  lea    0x0(%rbp,%rdx,1),%rcx
  lea    0x0(%rbp,%r9,1),%rdx
  mov    0xe0(%rsp),%r9d
  lea    0x0(%rbp,%r8,1),%rsi
  mov    %r14,%r8
  push   %r9
  mov    0xd8(%rsp),%r9d
  push   %r9
  mov    0xd8(%rsp),%r9d
  push   %r9
  mov    %rbx,%r9
  push   0x88(%rsp)
  push   %r12
  call   <stage_scale4x@plt>
  mov    0x50(%rsp),%r10
  mov    0x100(%rsp),%esi
  lea    0x0(%rbp,%r10,1),%rbx
  sub    $0x4,%esi
  mov    %rbx,0xa0(%rsp)
  mov    %esi,0xac(%rsp)
  mov    %esi,0xa8(%rsp)
  add    $0x30,%rsp
  test   %esi,%esi
  mov    0x58(%rsp),%r11
  je     L11
  mov    0x18(%rsp),%ecx
  mov    %rbx,%rdi
  mov    %r11,%rbp
  mov    0x68(%rsp),%r15
  mov    %r14,%r11
  add    0x28(%rsp),%rbx
  mov    %r12,%r14
  mov    %rdi,%r12
  shl    $0x2,%ecx
  mov    %ecx,%eax
  sub    0x30(%rsp),%rax
  mov    %rax,0x58(%rsp)
  jmp    L25
  nopl   (%rax)
L1:
  mov    0x10(%rsp),%r13
  mov    %rax,0x10(%rsp)
  mov    %r14,%rdx
  mov    0x8(%rsp),%r14
  mov    %r11,0x8(%rsp)
  mov    %rdx,%r11
L25:
  mov    0xd8(%rsp),%eax
  mov    %r11,%rsi
  mov    %rbp,%rdx
  mov    %r13,%rdi
  mov    %r10,0x20(%rsp)
  mov    0x50(%rsp),%rcx
  sub    0x30(%rsp),%rcx
  push   %rax
  mov    0xd0(%rsp),%eax
  add    %rbp,%rcx
  push   %rax
  mov    0x68(%rsp),%rax
  mov    0xd0(%rsp),%r9d
  lea    (%rax,%rbp,1),%r8
  xor    %eax,%eax
  mov    %r11,0x28(%rsp)
  call   <stage_scale2x@plt>
  mov    0x38(%rsp),%rax
  mov    %r15,%r9
  mov    %rbx,%rsi
  mov    0x48(%rsp),%rcx
  mov    0x50(%rsp),%rdx
  mov    %r12,%rdi
  mov    %r14,%r8
  sub    %rax,%rcx
  sub    %rax,%rdx
  mov    0xe8(%rsp),%eax
  add    %rbx,%rcx
  add    %rbx,%rdx
  mov    %eax,(%rsp)
  mov    0xd8(%rsp),%eax
  push   %rax
  mov    0xd8(%rsp),%eax
  push   %rax
  xor    %eax,%eax
  push   %r13
  push   0x30(%rsp)
  call   <stage_scale4x@plt>
  mov    0x50(%rsp),%r10
  add    0x78(%rsp),%rbp
  mov    %r15,%rax
  add    $0x30,%rsp
  mov    %r13,%r15
  mov    0x18(%rsp),%r11
  add    %r10,%r12
  add    %r10,%rbx
  subl   $0x1,0x78(%rsp)
  jne    L1
  mov    0x7c(%rsp),%eax
  mov    %r10,%rdx
  mov    0x50(%rsp),%r15
  mov    %r14,%r12
  mov    %r11,%r14
  mov    0x30(%rsp),%r11
  imul   %rax,%rdx
  add    %rdx,0x70(%rsp)
  imul   0x48(%rsp),%rax
  add    0x60(%rsp),%rax
  add    %rax,%r15
  add    %rax,%r11
L39:
  mov    0xd8(%rsp),%eax
  mov    %r11,%rdx
  mov    %r15,%r8
  mov    %r15,%rcx
  mov    %r10,0x18(%rsp)
  mov    %r12,%rsi
  push   %rax
  mov    0xd0(%rsp),%eax
  push   %rax
  mov    0x20(%rsp),%rbx
  xor    %eax,%eax
  mov    0xd0(%rsp),%r9d
  mov    %rbx,%rdi
  call   <stage_scale2x@plt>
  mov    0xe8(%rsp),%edi
  mov    0x48(%rsp),%r15
  mov    %r13,%r9
  mov    0x80(%rsp),%rax
  mov    0x50(%rsp),%rbp
  mov    %edi,(%rsp)
  mov    0xd8(%rsp),%edi
  mov    0x38(%rsp),%rsi
  mov    %rax,%rcx
  mov    %rax,%rdx
  push   %rdi
  mov    0xd8(%rsp),%edi
  add    %r15,%rcx
  add    %rbp,%rdx
  add    %rax,%rsi
  push   %rdi
  mov    %rax,%rdi
  mov    %rbx,0x30(%rsp)
  push   %rbx
  mov    %rax,%rbx
  xor    %eax,%eax
  push   %r14
  mov    0x38(%rsp),%r8
  call   <stage_scale4x@plt>
  mov    0x48(%rsp),%r10
  mov    %rbx,%rdi
  mov    %r15,%rcx
  add    $0x28,%rsp
  mov    0x30(%rsp),%rsi
  mov    %rbp,%rdx
  mov    %r14,%r8
  mov    0xe0(%rsp),%eax
  add    %r10,%rdi
  add    %rdi,%rcx
  add    %rdi,%rdx
  add    %rdi,%rsi
  push   %rax
  mov    0xd8(%rsp),%eax
  push   %rax
  mov    0xd8(%rsp),%eax
  push   %rax
  xor    %eax,%eax
  push   %r12
  push   %r12
  mov    0x40(%rsp),%r9
  call   <stage_scale4x@plt>
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  mov    0x8(%rsp),%rax
  mov    %r13,0x10(%rsp)
  mov    %r12,0x8(%rsp)
  mov    0x68(%rsp),%r13
  mov    %r14,%r12
  mov    %rax,%r14
  jmp    L39
```

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);
}
```