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

```asm
<IMAGE_STRETCH2XPLUS>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %esi,0x14(%rsp)
  mov    %ecx,0xc(%rsp)
  test   %edx,%edx
  je     L128
  mov    %rdi,%rbx
  mov    %edx,%r15d
  mov    %r9,%r14
  imul   %esi,%r8d
  mov    %r8d,%r12d
  mov    %edx,%edi
  sar    %edi
  mov    %edi,0x18(%rsp)
  mov    0x88(%rsp),%edx
  add    %edx,%edx
  mov    %edx,0x8(%rsp)
  lea    (%r15,%r15,1),%eax
  sub    %edi,%eax
  mov    %edx,%edi
  cltd
  idiv   %edi
  mov    %eax,%r13d
  mov    %eax,0x10(%rsp)
  mov    0x80(%rsp),%ecx
  mov    %r9,%rdx
  mov    %rbx,%rdi
  call   *0xa0(%rsp)
  mov    %r15d,%ebp
  sub    %r13d,%ebp
  je     L60
  movslq 0x90(%rsp),%rdx
  mov    %rdx,0x28(%rsp)
  add    %rdx,%r14
  mov    %r14,0x20(%rsp)
  movslq 0xc(%rsp),%rax
  mov    %rax,0x30(%rsp)
  mov    %r15d,0x1c(%rsp)
  mov    %rax,%r15
L61:
  sub    $0x1,%ebp
  je     L40
  mov    0x18(%rsp),%r13d
  sub    0x8(%rsp),%r13d
  js     L35
L42:
  mov    %rbx,%rsi
  add    %r15,%rbx
  mov    %r12d,%edx
  mov    %rbx,%rdi
  call   <memcpy@plt>
  sub    $0x1,%ebp
  je     L40
  sub    0x8(%rsp),%r13d
  jns    L42
L35:
  mov    0x1c(%rsp),%eax
  add    %r13d,%eax
  mov    %rbx,%r13
L5:
  add    %r15,%r13
  sub    $0x1,%ebp
  je     L74
  sub    0x8(%rsp),%eax
  jns    L5
  add    0x1c(%rsp),%eax
  mov    %eax,0x18(%rsp)
  lea    0x0(%r13,%r15,1),%rdx
  mov    %rdx,0x38(%rsp)
  lea    (%rbx,%r15,1),%r14
  mov    0x80(%rsp),%r9d
  mov    0x20(%rsp),%r8
  mov    0x14(%rsp),%ecx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   *0xa8(%rsp)
  mov    0x28(%rsp),%rcx
  add    %rcx,0x20(%rsp)
  cmp    %r13,%r14
  je     L115
L85:
  mov    %r14,%rsi
  add    %r15,%r14
  mov    %r12d,%edx
  mov    %r14,%rdi
  call   <memcpy@plt>
  cmp    %r13,%r14
  jne    L85
L115:
  mov    0x38(%rsp),%rbx
  jmp    L61
L60:
  lea    -0x1(%r13),%eax
  mov    %eax,0x10(%rsp)
L40:
  mov    0x10(%rsp),%eax
  mov    %eax,%ebp
  movslq 0xc(%rsp),%r13
  test   %eax,%eax
  je     L128
L79:
  mov    %rbx,%rsi
  add    %r13,%rbx
  mov    %r12d,%edx
  mov    %rbx,%rdi
  call   <memcpy@plt>
  sub    $0x1,%ebp
  jne    L79
L128:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L74:
  mov    0x30(%rsp),%rbp
  cmp    %rbx,%r13
  je     L40
L120:
  mov    %rbx,%rsi
  add    %rbp,%rbx
  mov    %r12d,%edx
  mov    %rbx,%rdi
  call   <memcpy@plt>
  cmp    %r13,%rbx
  jne    L120
  mov    %r13,%rbx
  jmp    L40
```

assistant: ```c
void IMAGE_STRETCH2XPLUS(unsigned char *dest_ptr, int dest_dx, int dest_dy, int dest_pitch, int dest_bpp, unsigned char *src_ptr, int src_dx, int src_dy, int src_pitch, int src_bpp, void (*row_func)(unsigned char *, int, unsigned char *, int), void (*row2x_func)(unsigned char *, unsigned char *, unsigned char *, int, unsigned char *, int)) {
  register unsigned char *d = dest_ptr, *d1;
  register unsigned char *s = src_ptr;
  register int dest_dx_bytes = dest_dx * dest_bpp;
  register int count = dest_dy;
  register int limit = dest_dy >> 1;
  register int step = src_dy << 1;
  register int remainder = (2 * dest_dy - limit) / step;
  if (count) {
    (*row_func)(d, dest_dx, s, src_dx);
    s += src_pitch;
    if (!(count -= remainder)) {
      remainder--;
      goto end;
    }
    while (1) {
      goto start;
      do {
        memcpy(d + dest_pitch, d, dest_dx_bytes);
        d += dest_pitch;
      start:
        if (!(--count))
          goto end;
      } while ((limit -= step) >= 0);
      limit += dest_dy;
      d1 = d;
      do {
        d += dest_pitch;
        if (!(--count))
          goto end_2;
      } while ((limit -= step) >= 0);
      limit += dest_dy;
      (*row2x_func)(d1, d1 + dest_pitch, d + dest_pitch, dest_dx, s, src_dx);
      d1 += dest_pitch;
      s += src_pitch;
      while (d1 != d) {
        memcpy(d1 + dest_pitch, d1, dest_dx_bytes);
        d1 += dest_pitch;
      }
      d += dest_pitch;
    }
  end_2:
    while (d1 != d) {
      memcpy(d1 + dest_pitch, d1, dest_dx_bytes);
      d1 += dest_pitch;
    }
  end:
    while (remainder--) {
      memcpy(d + dest_pitch, d, dest_dx_bytes);
      d += dest_pitch;
    }
  }
}
```