user: Demonstrate the C code that generates the assembly output below:

```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    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbx
  mov    %rdx,%r15
  mov    %rcx,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x2008(%rsp)
  xor    %eax,%eax
  call   <assert@plt>
  cmp    %rbx,%r14
  jb     L35
  add    %rbx,%r15
  cmp    %r14,%r15
  ja     L190
  lea    0x1(%r14),%r12
  lea    (%r15,%r15,1),%rdx
  lea    (%rbx,%r12,1),%rax
  cmp    %rax,%rdx
  ja     L289
L203:
  lea    0x0(%r13,%r12,8),%r14
  mov    %rsp,%rdi
  cmp    %r12,%r15
  jb     L9
  jmp    L190
L35:
  lea    (%rbx,%r15,1),%r12
  lea    (%rbx,%rbx,1),%rdx
  lea    (%r14,%r12,1),%rax
  cmp    %rax,%rdx
  jbe    L136
L363:
  lea    0x0(%r13,%r14,8),%r15
  mov    %rsp,%rdi
  jmp    L177
L136:
  mov    %rbx,%r15
  mov    %r14,%rbx
  jmp    L203
L289:
  cmp    %rbx,%r15
  jbe    L190
  mov    %rbx,%r14
  mov    %r15,%rbx
  jmp    L363
L173:
  lea    0x0(,%rbp,8),%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L140
L274:
  mov    %rbx,%r9
  sub    %rbp,%r9
  lea    0x0(%r13,%r9,8),%rdx
L222:
  mov    $0x0,%eax
L106:
  mov    (%rdx,%rax,8),%rcx
  mov    %rcx,(%rdi,%rax,8)
  add    $0x1,%rax
  cmp    %rbp,%rax
  jne    L106
  lea    (%rdx,%rbp,8),%r8
  mov    %r12,%rsi
  sub    %rbx,%rsi
  mov    %r9,%rbx
  je     L165
L157:
  mov    $0x0,%eax
L251:
  mov    (%r8,%rax,8),%rcx
  mov    %rcx,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L251
  lea    (%rdx,%rsi,8),%rdx
  test   %rbp,%rbp
  je     L268
  mov    %r9,%rbx
L165:
  mov    $0x0,%eax
L266:
  mov    (%rdi,%rax,8),%rcx
  mov    %rcx,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rbp
  jne    L266
L158:
  sub    %rbp,%r12
  cmp    %rbx,%r14
  jae    L78
L177:
  mov    %rbx,%rbp
  sub    %r14,%rbp
  cmp    $0x400,%rbp
  ja     L173
  test   %rbp,%rbp
  je     L245
  mov    %r14,%r9
  mov    %r15,%rdx
  jmp    L222
L268:
  mov    %r9,%rbx
  jmp    L158
L294:
  lea    0x0(,%rbp,8),%rdi
  call   <malloc@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L383
L60:
  lea    0x0(%rbp,%r15,1),%r9
  lea    0x0(%r13,%r9,8),%rsi
  lea    (%rdi,%rbp,8),%r8
L87:
  mov    %rbp,%r10
  neg    %r10
  shl    $0x3,%r10
  lea    (%rsi,%r10,1),%rdx
  add    %r8,%r10
  mov    %rbp,%rax
L324:
  mov    -0x8(%rdx,%rax,8),%rcx
  mov    %rcx,-0x8(%r10,%rax,8)
  sub    $0x1,%rax
  jne    L324
  mov    %r15,%rax
  sub    %rbx,%rax
  mov    %r9,%r15
  je     L276
L255:
  mov    %rax,%rcx
  neg    %rcx
  shl    $0x3,%rcx
  add    %rcx,%rdx
  add    %rcx,%rsi
L127:
  mov    -0x8(%rdx,%rax,8),%rcx
  mov    %rcx,-0x8(%rsi,%rax,8)
  sub    $0x1,%rax
  jne    L127
  test   %rbp,%rbp
  je     L25
  mov    %r9,%r15
L276:
  mov    %rbp,%rcx
  neg    %rcx
  shl    $0x3,%rcx
  add    %rcx,%r8
  add    %rsi,%rcx
  mov    %rbp,%rax
L375:
  mov    -0x8(%r8,%rax,8),%rdx
  mov    %rdx,-0x8(%rcx,%rax,8)
  sub    $0x1,%rax
  jne    L375
L394:
  add    %rbp,%rbx
  cmp    %r15,%r12
  jbe    L78
L9:
  mov    %r12,%rbp
  sub    %r15,%rbp
  cmp    $0x400,%rbp
  ja     L294
  lea    (%rdi,%rbp,8),%r8
  test   %rbp,%rbp
  je     L325
  mov    %r12,%r9
  mov    %r14,%rsi
  jmp    L87
L25:
  mov    %r9,%r15
  jmp    L394
L78:
  mov    %rsp,%rax
  cmp    %rax,%rdi
  je     L190
  call   <free@plt>
L190:
  mov    0x2008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L103
  add    $0x2018,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L245:
  mov    %r12,%rsi
  sub    %rbx,%rsi
  je     L78
  mov    %r15,%r8
  mov    %r15,%rdx
  mov    %r14,%r9
  jmp    L157
L140:
  mov    %rsp,%rdi
  mov    $0x400,%ebp
  jmp    L274
L325:
  mov    %r15,%rax
  sub    %rbx,%rax
  je     L78
  mov    %r14,%rdx
  mov    %r14,%rsi
  mov    %r12,%r9
  jmp    L255
L383:
  mov    %rsp,%rdi
  mov    $0x400,%ebp
  jmp    L60
L103:
  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);
}
```