user: 请将以下的汇编代码转换成C语言代码：

```asm
<ptr_move>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x48,%rsp
  mov    %rsi,%rbp
  mov    %rdx,%r12
  mov    %rcx,%r14
  mov    %rdi,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x2038(%rsp)
  xor    %eax,%eax
  add    %rbp,%r12
  call   <assert@plt>
  cmp    %rbp,%r14
  jae    L115
  lea    (%r14,%r12,1),%rdx
  lea    0x0(%rbp,%rbp,1),%rax
  cmp    %rax,%rdx
  jae    L114
L468:
  lea    0x30(%rsp),%rdi
  mov    %rdi,0x28(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L434:
  mov    %rbp,%rbx
  mov    %r14,%r13
  sub    %r14,%rbx
  cmp    $0x400,%rbx
  ja     L160
L483:
  lea    0x0(,%r13,8),%r9
  lea    -0x1(%rbx),%rdx
  cmp    $0x2,%rdx
  lea    0x8(%r15,%r9,1),%rdx
  lea    (%r15,%r9,1),%rax
  seta   %r8b
  cmp    %rdx,%rdi
  je     L222
  test   %r8b,%r8b
  je     L222
  mov    %rbx,%rsi
  xor    %edx,%edx
  xor    %ecx,%ecx
  shr    %rsi
  nop
L371:
  movdqu (%rax,%rdx,1),%xmm0
  add    $0x1,%rcx
  movups %xmm0,(%rdi,%rdx,1)
  add    $0x10,%rdx
  cmp    %rcx,%rsi
  jne    L371
  mov    %rbx,%rsi
  and    $0xfffffffffffffffe,%rsi
  lea    0x0(,%rsi,8),%rcx
  lea    (%rax,%rcx,1),%rdx
  add    %rdi,%rcx
  cmp    %rsi,%rbx
  je     L383
  mov    (%rdx),%rdx
  mov    %rdx,(%rcx)
L383:
  mov    %r12,%r10
  lea    (%rax,%rbx,8),%rsi
  sub    %rbp,%r10
  je     L233
  lea    0x1(%rbx,%r13,1),%rdx
  lea    -0x1(%r10),%rcx
  shl    $0x3,%rdx
  cmp    $0x2,%rcx
  jbe    L531
  cmp    %rdx,%r9
  je     L531
  mov    %r10,%r11
  lea    -0x8(%r15,%rdx,1),%r9
  xor    %ecx,%ecx
  xor    %edx,%edx
  shr    %r11
  nopw   0x0(%rax,%rax,1)
L53:
  movdqu (%r9,%rdx,1),%xmm4
  add    $0x1,%rcx
  movups %xmm4,(%rax,%rdx,1)
  add    $0x10,%rdx
  cmp    %rcx,%r11
  jne    L53
  mov    %r10,%rdx
  and    $0xfffffffffffffffe,%rdx
  lea    0x0(,%rdx,8),%rcx
  add    %rcx,%rsi
  add    %rax,%rcx
  cmp    %rdx,%r10
  je     L259
  mov    (%rsi),%rdx
  mov    %rdx,(%rcx)
L259:
  lea    (%rax,%r10,8),%rax
L233:
  lea    0x8(%rdi),%rdx
  cmp    %rdx,%rax
  je     L45
  test   %r8b,%r8b
  je     L45
  mov    %rbx,%rsi
  xor    %edx,%edx
  xor    %ecx,%ecx
  shr    %rsi
  nopl   0x0(%rax,%rax,1)
L367:
  movdqu (%rdi,%rdx,1),%xmm1
  add    $0x1,%rcx
  movups %xmm1,(%rax,%rdx,1)
  add    $0x10,%rdx
  cmp    %rcx,%rsi
  jne    L367
  mov    %rbx,%rsi
  and    $0xfffffffffffffffe,%rsi
  lea    0x0(,%rsi,8),%rdx
  lea    (%rdi,%rdx,1),%rcx
  add    %rax,%rdx
  cmp    %rsi,%rbx
  je     L175
  mov    (%rcx),%rax
  mov    %rax,(%rdx)
L175:
  sub    %rbx,%r12
  cmp    %r13,%r14
  jae    L343
  mov    %r13,%rbp
  jmp    L434
  nopl   0x0(%rax,%rax,1)
L115:
  cmp    %r12,%r14
  jb     L101
  lea    0x1(%r14),%rax
  lea    (%r12,%r12,1),%rdx
  mov    %rax,(%rsp)
  add    %rbp,%rax
  cmp    %rax,%rdx
  ja     L490
  mov    %rbp,%r14
L47:
  mov    (%rsp),%rbx
  lea    0x30(%rsp),%rdi
  mov    %rdi,0x28(%rsp)
  lea    0x0(,%rbx,8),%rax
  mov    %rax,0x18(%rsp)
  lea    -0x10(%r15,%rax,1),%rax
  mov    %rax,0x20(%rsp)
  cmp    %rbx,%r12
  jae    L101
  mov    %r15,0x10(%rsp)
  mov    %r14,%r15
  nopw   0x0(%rax,%rax,1)
L173:
  mov    (%rsp),%rbx
  sub    %r12,%rbx
  lea    0x0(,%rbx,8),%r13
  cmp    $0x400,%rbx
  ja     L214
L46:
  mov    0x18(%rsp),%rsi
  mov    0x10(%rsp),%rax
  lea    -0x1(%rbx),%rcx
  lea    (%rdi,%r13,1),%r8
  mov    0x20(%rsp),%r14
  add    %rsi,%rax
  cmp    $0x2,%rcx
  mov    %rsi,%rdx
  seta   %cl
  lea    -0x8(%rdi,%r13,1),%rsi
  mov    %r14,%r9
  mov    %cl,0xf(%rsp)
  cmp    %rsi,%r14
  je     L482
  test   %cl,%cl
  je     L482
  mov    (%rsp),%r14
L204:
  mov    %rbx,%rbp
  lea    -0x10(%r13),%rcx
  xor    %esi,%esi
  xor    %r10d,%r10d
  shr    %rbp
  lea    (%rdi,%rcx,1),%r11
  nopl   0x0(%rax)
L424:
  movdqu (%r9,%rsi,1),%xmm2
  add    $0x1,%r10
  movups %xmm2,(%r11,%rsi,1)
  sub    $0x10,%rsi
  cmp    %rbp,%r10
  jne    L424
  mov    %rbx,%r10
  and    $0xfffffffffffffffe,%r10
  mov    %r10,%rsi
  neg    %rsi
  shl    $0x3,%rsi
  cmp    %r10,%rbx
  je     L314
  mov    -0x8(%rax,%rsi,1),%r10
  mov    %r10,-0x8(%r8,%rsi,1)
L314:
  movb   $0x1,0xf(%rsp)
L394:
  mov    %rbx,%r11
  neg    %r11
  shl    $0x3,%r11
  lea    (%rax,%r11,1),%r10
  sub    %r15,%r12
  je     L391
  lea    -0x1(%r12),%rsi
  add    %r11,%rdx
  cmp    $0x2,%rsi
  jbe    L433
  cmp    $0x8,%r11
  je     L433
  mov    0x10(%rsp),%rsi
  mov    %r12,%r13
  shr    %r13
  lea    -0x10(%rsi,%rdx,1),%rbp
  xor    %edx,%edx
  xor    %esi,%esi
L120:
  movdqu 0x0(%rbp,%rdx,1),%xmm5
  add    $0x1,%rsi
  movups %xmm5,(%r9,%rdx,1)
  sub    $0x10,%rdx
  cmp    %rsi,%r13
  jne    L120
  mov    %r12,%rsi
  and    $0xfffffffffffffffe,%rsi
  mov    %rsi,%rdx
  neg    %rdx
  shl    $0x3,%rdx
  cmp    %rsi,%r12
  je     L41
  mov    -0x8(%r10,%rdx,1),%rsi
  mov    %rsi,-0x8(%rax,%rdx,1)
L41:
  neg    %r12
  lea    (%rax,%r12,8),%rax
L391:
  add    %rdi,%rcx
  lea    -0x8(%rax),%rdx
  cmp    %rdx,%rcx
  je     L287
  cmpb   $0x0,0xf(%rsp)
  je     L287
  mov    %rbx,%r9
  xor    %edx,%edx
  xor    %esi,%esi
  shr    %r9
  nopl   0x0(%rax)
L10:
  movdqu (%rcx,%rdx,1),%xmm3
  add    $0x1,%rsi
  movups %xmm3,-0x10(%rax,%rdx,1)
  sub    $0x10,%rdx
  cmp    %r9,%rsi
  jne    L10
  mov    %rbx,%rcx
  and    $0xfffffffffffffffe,%rcx
  mov    %rcx,%rdx
  neg    %rdx
  shl    $0x3,%rdx
  cmp    %rcx,%rbx
  je     L206
  mov    -0x8(%r8,%rdx,1),%rcx
  mov    %rcx,-0x8(%rax,%rdx,1)
L206:
  add    %rbx,%r15
  cmp    %r14,(%rsp)
  jbe    L343
  mov    %r14,%r12
  jmp    L173
L343:
  cmp    0x28(%rsp),%rdi
  je     L101
  call   <free@plt>
L101:
  mov    0x2038(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L465
  add    $0x2048,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L114:
  mov    %r12,(%rsp)
  mov    %rbp,%r12
  jmp    L47
  nopl   0x0(%rax)
L160:
  lea    0x0(,%rbx,8),%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  jne    L483
  mov    0x28(%rsp),%rdi
  lea    -0x400(%rbp),%r13
  mov    $0x400,%ebx
  jmp    L483
  nopw   0x0(%rax,%rax,1)
L214:
  mov    %r13,%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  jne    L46
  mov    0x10(%rsp),%rdi
  lea    0x400(%r12),%r14
  mov    $0x2000,%r13d
  lea    0x2030(%rsp),%r8
  lea    0x0(,%r14,8),%rdx
  mov    $0x400,%ebx
  lea    (%rdi,%rdx,1),%rax
  lea    -0x10(%rdi,%rdx,1),%r9
  mov    0x28(%rsp),%rdi
  jmp    L204
  nop
L482:
  mov    %rbx,%rcx
  neg    %rcx
  lea    (%rax,%rcx,8),%rsi
  mov    %rbx,%rcx
  nopl   (%rax)
L448:
  mov    -0x8(%rsi,%rcx,8),%r10
  mov    %r10,-0x8(%rdi,%rcx,8)
  sub    $0x1,%rcx
  jne    L448
  mov    (%rsp),%r14
  lea    -0x10(%r13),%rcx
  jmp    L394
  nopl   (%rax)
L287:
  add    %r11,%r8
  add    %r11,%rax
  mov    %rbx,%rdx
  nopl   0x0(%rax)
L248:
  mov    -0x8(%r8,%rdx,8),%rcx
  mov    %rcx,-0x8(%rax,%rdx,8)
  sub    $0x1,%rdx
  jne    L248
  jmp    L206
  nopl   (%rax)
L222:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L278:
  mov    (%rax,%rdx,8),%rcx
  mov    %rcx,(%rdi,%rdx,8)
  add    $0x1,%rdx
  cmp    %rdx,%rbx
  jne    L278
  jmp    L383
  cs nopw 0x0(%rax,%rax,1)
L45:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L179:
  mov    (%rdi,%rdx,8),%rcx
  mov    %rcx,(%rax,%rdx,8)
  add    $0x1,%rdx
  cmp    %rdx,%rbx
  jne    L179
  jmp    L175
  xchg   %ax,%ax
L531:
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L501:
  mov    (%rsi,%rdx,8),%rcx
  mov    %rcx,(%rax,%rdx,8)
  add    $0x1,%rdx
  cmp    %rdx,%r10
  jne    L501
  jmp    L259
  xchg   %ax,%ax
L433:
  mov    %r12,%rsi
  mov    %r12,%rdx
  neg    %rsi
  shl    $0x3,%rsi
  add    %rsi,%r10
  add    %rax,%rsi
  nopl   0x0(%rax,%rax,1)
L529:
  mov    -0x8(%r10,%rdx,8),%r9
  mov    %r9,-0x8(%rsi,%rdx,8)
  sub    $0x1,%rdx
  jne    L529
  jmp    L41
L490:
  cmp    %r12,%rbp
  jae    L101
  mov    %rbp,%r14
  mov    %r12,%rbp
  mov    (%rsp),%r12
  jmp    L468
L465:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void ptr_move(void *array, size_t off, size_t n, size_t pos) {
  size_t i, end;
  void **src, **dst;
  void *fxd[1024], **buf;
  assert(array);
  if ((pos >= off) && (pos < off + n))
    return;
  if (pos < off) {
    end = off + n;
    off = pos;
    pos = end - n;
  } else {
    end = pos + 1;
    pos = off + n;
  }
  buf = fxd;
  if (pos + pos > end + off) {
    while (pos > off) {
      n = pos - off;
      if (n > 1024) {
        buf = (void **)malloc(n * sizeof(void *));
        if (!buf) {
          buf = fxd;
          n = 1024;
        }
      }
      src = (void **)array + pos - n;
      dst = buf;
      for (i = n; i > 0; i--)
        *dst++ = *src++;
      dst = (void **)array + pos - n;
      for (i = end - pos; i > 0; i--)
        *dst++ = *src++;
      src = buf;
      for (i = n; i > 0; i--)
        *dst++ = *src++;
      pos -= n;
      end -= n;
    }
  } else {
    while (end > pos) {
      n = end - pos;
      if (n > 1024) {
        buf = (void **)malloc(n * sizeof(void *));
        if (!buf) {
          buf = fxd;
          n = 1024;
        }
      }
      src = (void **)array + pos + n;
      dst = buf + n;
      for (i = n; i > 0; i--)
        *--dst = *--src;
      dst = (void **)array + pos + n;
      for (i = pos - off; i > 0; i--)
        *--dst = *--src;
      src = buf + n;
      for (i = n; i > 0; i--)
        *--dst = *--src;
      pos += n;
      off += n;
    }
  }
  if (buf != fxd)
    free(buf);
}
```