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

```asm
<pc_partition>:
  endbr64
  push   %r15
  movapd %xmm0,%xmm1
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    0x38(%rsp),%esi
  cmp    %esi,%r9d
  jge    L86
  movslq %r9d,%rbx
  mov    %rdx,%r12
  mov    %rcx,%r13
  mov    %r8,%r14
  lea    0x0(,%rbx,8),%rax
  lea    -0x8(%rdi,%rax,1),%rdx
  movsd  -0x8(%rbp,%rax,1),%xmm5
  movsd  -0x8(%r12,%rax,1),%xmm4
  movsd  -0x8(%rcx,%rax,1),%xmm3
  mov    -0x4(%r8,%rbx,4),%eax
  movsd  (%rdx),%xmm2
  movsd  %xmm0,(%rdx)
  mov    %eax,-0x4(%rsp)
L47:
  cmp    %r9d,%esi
  jle    L42
L169:
  movslq %esi,%rax
  lea    -0x8(,%rax,8),%rcx
  jmp    L127
  nopl   (%rax)
L78:
  lea    -0x1(%rax),%esi
  sub    $0x1,%rax
  sub    $0x8,%rcx
  cmp    %eax,%r9d
  jge    L42
L127:
  movsd  (%rdi,%rcx,1),%xmm0
  mov    %eax,%esi
  lea    (%rdi,%rcx,1),%r10
  comisd %xmm1,%xmm0
  ja     L78
  mov    %r10,-0x18(%rsp)
L38:
  lea    0x0(,%rbx,8),%r11
  lea    0x0(%rbp,%rcx,1),%r15
  mov    %rbx,%rdx
  movsd  %xmm0,-0x8(%rdi,%r11,1)
  movsd  (%r15),%xmm0
  lea    (%r12,%rcx,1),%r10
  add    %r13,%rcx
  lea    -0x4(%r14,%rax,4),%rax
  lea    -0x8(%r11),%r8
  mov    %r10,-0x10(%rsp)
  movsd  %xmm0,-0x8(%rbp,%r11,1)
  movsd  (%r10),%xmm0
  movsd  %xmm0,-0x8(%r12,%r11,1)
  movsd  (%rcx),%xmm0
  movsd  %xmm0,-0x8(%r13,%r11,1)
  mov    (%rax),%r11d
  mov    %r11d,-0x4(%r14,%rbx,4)
  cmp    %r9d,%esi
  jle    L123
  mov    -0x18(%rsp),%r10
  jmp    L96
  nopl   0x0(%rax)
L130:
  lea    0x1(%rdx),%r9d
  add    $0x1,%rdx
  add    $0x8,%r8
  cmp    %edx,%esi
  jle    L170
L96:
  movsd  (%rdi,%r8,1),%xmm0
  mov    %edx,%r9d
  comisd %xmm0,%xmm1
  jae    L130
  movsd  %xmm0,(%r10)
  mov    -0x10(%rsp),%rbx
  mov    -0x4(%r14,%rdx,4),%edx
  movsd  0x0(%rbp,%r8,1),%xmm0
  mov    %r10,-0x18(%rsp)
  movsd  %xmm0,(%r15)
  movsd  (%r12,%r8,1),%xmm0
  movsd  %xmm0,(%rbx)
  movsd  0x0(%r13,%r8,1),%xmm0
  movsd  %xmm0,(%rcx)
  mov    %edx,(%rax)
  cmp    %esi,%r9d
  je     L166
  movslq %r9d,%rbx
  cmp    %r9d,%esi
  jg     L169
  nop
L42:
  cmp    %r9d,%esi
  jne    L82
L50:
  ucomisd %xmm1,%xmm2
  lea    -0x1(%r9),%eax
  mov    0x40(%rsp),%rsi
  cmovbe %r9d,%eax
  mov    %eax,(%rsi)
  lea    0x0(,%rbx,8),%rax
  movsd  %xmm2,-0x8(%rdi,%rax,1)
  movsd  %xmm5,-0x8(%rbp,%rax,1)
  movsd  %xmm4,-0x8(%r12,%rax,1)
  movsd  %xmm3,-0x8(%r13,%rax,1)
  mov    -0x4(%rsp),%eax
  mov    %eax,-0x4(%r14,%rbx,4)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L170:
  movslq %r9d,%rbx
L123:
  cmp    %esi,%r9d
  je     L50
  lea    0x0(,%rbx,8),%rdx
  movslq %esi,%rcx
  movsd  -0x8(%rdi,%rdx,1),%xmm0
  lea    0x0(,%rcx,8),%rax
  movsd  %xmm0,-0x8(%rdi,%rax,1)
  movsd  -0x8(%rbp,%rdx,1),%xmm0
  movsd  %xmm0,-0x8(%rbp,%rax,1)
  movsd  -0x8(%r12,%rdx,1),%xmm0
  movsd  %xmm0,-0x8(%r12,%rax,1)
  movsd  -0x8(%r13,%rdx,1),%xmm0
  movsd  %xmm0,-0x8(%r13,%rax,1)
  mov    -0x4(%r14,%rbx,4),%eax
  mov    %eax,-0x4(%r14,%rcx,4)
  jmp    L47
  cs nopw 0x0(%rax,%rax,1)
L82:
  movslq %esi,%rax
  lea    -0x8(,%rax,8),%rcx
  lea    (%rdi,%rcx,1),%rdx
  mov    %rdx,-0x18(%rsp)
  movsd  (%rdx),%xmm0
  jmp    L38
  nopl   (%rax)
L86:
  je     L153
L147:
  sub    $0x1,%r9d
L73:
  mov    0x40(%rsp),%rax
  mov    %r9d,(%rax)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L153:
  movslq %r9d,%rax
  comisd -0x8(%rdi,%rax,8),%xmm0
  jbe    L147
  jmp    L73
L166:
  movslq %esi,%rbx
  jmp    L50
```

assistant: ```c
void pc_partition(double *a, double *b, double *c, double *d, int *indarr, int ibeg, int iend, double val, int *midind) {
  double ta, tb, tc, td;
  int lower, upper, tind;
  if (ibeg < iend) {
    ta = a[ibeg - 1];
    tb = b[ibeg - 1];
    tc = c[ibeg - 1];
    td = d[ibeg - 1];
    tind = indarr[ibeg - 1];
    a[ibeg - 1] = val;
    upper = ibeg;
    lower = iend;
    while (upper != lower) {
      while ((upper < lower) && (val < a[lower - 1])) {
        lower--;
      }
      if (upper != lower) {
        a[upper - 1] = a[lower - 1];
        b[upper - 1] = b[lower - 1];
        c[upper - 1] = c[lower - 1];
        d[upper - 1] = d[lower - 1];
        indarr[upper - 1] = indarr[lower - 1];
      }
      while ((upper < lower) && (val >= a[upper - 1])) {
        upper++;
      }
      if (upper != lower) {
        a[lower - 1] = a[upper - 1];
        b[lower - 1] = b[upper - 1];
        c[lower - 1] = c[upper - 1];
        d[lower - 1] = d[upper - 1];
        indarr[lower - 1] = indarr[upper - 1];
      }
    }
    *midind = upper;
    if (ta > val)
      *midind = upper - 1;
    a[upper - 1] = ta;
    b[upper - 1] = tb;
    c[upper - 1] = tc;
    d[upper - 1] = td;
    indarr[upper - 1] = tind;
  } else if (ibeg == iend) {
    if (a[ibeg - 1] < val)
      *midind = ibeg;
    else
      *midind = ibeg - 1;
  } else {
    *midind = ibeg - 1;
  }
  return;
}
```