user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<pc_partition>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x20(%rsp),%eax
  cmp    %eax,%r9d
  jge    L41
  mov    %rsi,%r10
  mov    %rdx,%rsi
  movslq %r9d,%rbx
  lea    0x0(,%rbx,8),%rdx
  lea    -0x8(%rdi,%rdx,1),%r11
  movsd  (%r11),%xmm2
  movsd  -0x8(%r10,%rdx,1),%xmm5
  movsd  -0x8(%rsi,%rdx,1),%xmm4
  movsd  -0x8(%rcx,%rdx,1),%xmm3
  mov    -0x4(%r8,%rbx,4),%ebx
  movsd  %xmm0,(%r11)
  jmp    L69
L0:
  cmp    %r9d,%eax
  je     L106
  movslq %eax,%r12
  lea    0x0(,%r12,8),%r11
  movslq %r9d,%rbp
  lea    0x0(,%rbp,8),%rdx
  movsd  -0x8(%rdi,%r11,1),%xmm1
  movsd  %xmm1,-0x8(%rdi,%rdx,1)
  movsd  -0x8(%r10,%r11,1),%xmm1
  movsd  %xmm1,-0x8(%r10,%rdx,1)
  movsd  -0x8(%rsi,%r11,1),%xmm1
  movsd  %xmm1,-0x8(%rsi,%rdx,1)
  movsd  -0x8(%rcx,%r11,1),%xmm1
  movsd  %xmm1,-0x8(%rcx,%rdx,1)
  mov    -0x4(%r8,%r12,4),%edx
  mov    %edx,-0x4(%r8,%rbp,4)
  jle    L53
  lea    (%rdi,%rbp,8),%rdx
L13:
  comisd -0x8(%rdx),%xmm0
  jb     L106
  add    $0x1,%r9d
  add    $0x8,%rdx
  cmp    %eax,%r9d
  jl     L13
L106:
  cmp    %r9d,%eax
  je     L33
L53:
  movslq %r9d,%r12
  lea    0x0(,%r12,8),%r11
  movslq %eax,%rbp
  lea    0x0(,%rbp,8),%rdx
  movsd  -0x8(%rdi,%r11,1),%xmm1
  movsd  %xmm1,-0x8(%rdi,%rdx,1)
  movsd  -0x8(%r10,%r11,1),%xmm1
  movsd  %xmm1,-0x8(%r10,%rdx,1)
  movsd  -0x8(%rsi,%r11,1),%xmm1
  movsd  %xmm1,-0x8(%rsi,%rdx,1)
  movsd  -0x8(%rcx,%r11,1),%xmm1
  movsd  %xmm1,-0x8(%rcx,%rdx,1)
  mov    -0x4(%r8,%r12,4),%edx
  mov    %edx,-0x4(%r8,%rbp,4)
L69:
  cmp    %r9d,%eax
  jle    L0
  movslq %eax,%rdx
  lea    (%rdi,%rdx,8),%rdx
L83:
  movsd  -0x8(%rdx),%xmm1
  comisd %xmm0,%xmm1
  jbe    L0
  sub    $0x1,%eax
  sub    $0x8,%rdx
  cmp    %r9d,%eax
  jne    L83
  mov    %r9d,%eax
  jmp    L0
L41:
  je     L94
  sub    $0x1,%r9d
  mov    0x28(%rsp),%rax
  mov    %r9d,(%rax)
  jmp    L107
L94:
  movslq %r9d,%rax
  comisd -0x8(%rdi,%rax,8),%xmm0
  jbe    L125
  mov    0x28(%rsp),%rax
  mov    %r9d,(%rax)
  jmp    L107
L125:
  sub    $0x1,%r9d
  mov    0x28(%rsp),%rax
  mov    %r9d,(%rax)
  jmp    L107
L33:
  lea    -0x1(%r9),%eax
  ucomisd %xmm0,%xmm2
  cmovbe %r9d,%eax
  mov    0x28(%rsp),%rdx
  mov    %eax,(%rdx)
  movslq %r9d,%r9
  lea    0x0(,%r9,8),%rax
  movsd  %xmm2,-0x8(%rdi,%rax,1)
  movsd  %xmm5,-0x8(%r10,%rax,1)
  movsd  %xmm4,-0x8(%rsi,%rax,1)
  movsd  %xmm3,-0x8(%rcx,%rax,1)
  mov    %ebx,-0x4(%r8,%r9,4)
L107:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
```

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