user: Translate the below assembly code into C programming language:

```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    L155
  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)
L171:
  cmp    %r9d,%esi
  jle    L30
L9:
  movslq %esi,%rax
  lea    -0x8(,%rax,8),%rcx
  jmp    L94
  nopl   (%rax)
L4:
  lea    -0x1(%rax),%esi
  sub    $0x1,%rax
  sub    $0x8,%rcx
  cmp    %eax,%r9d
  jge    L30
L94:
  movsd  (%rdi,%rcx,1),%xmm0
  mov    %eax,%esi
  lea    (%rdi,%rcx,1),%r10
  comisd %xmm1,%xmm0
  ja     L4
  mov    %r10,-0x18(%rsp)
L169:
  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    L23
  mov    -0x18(%rsp),%r10
  jmp    L126
  nopl   0x0(%rax)
L152:
  lea    0x1(%rdx),%r9d
  add    $0x1,%rdx
  add    $0x8,%r8
  cmp    %edx,%esi
  jle    L12
L126:
  movsd  (%rdi,%r8,1),%xmm0
  mov    %edx,%r9d
  comisd %xmm0,%xmm1
  jae    L152
  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     L184
  movslq %r9d,%rbx
  cmp    %r9d,%esi
  jg     L9
  nop
L30:
  cmp    %r9d,%esi
  jne    L83
L121:
  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)
L12:
  movslq %r9d,%rbx
L23:
  cmp    %esi,%r9d
  je     L121
  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    L171
  cs nopw 0x0(%rax,%rax,1)
L83:
  movslq %esi,%rax
  lea    -0x8(,%rax,8),%rcx
  lea    (%rdi,%rcx,1),%rdx
  mov    %rdx,-0x18(%rsp)
  movsd  (%rdx),%xmm0
  jmp    L169
  nopl   (%rax)
L155:
  je     L147
L135:
  sub    $0x1,%r9d
L51:
  mov    0x40(%rsp),%rax
  mov    %r9d,(%rax)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L147:
  movslq %r9d,%rax
  comisd -0x8(%rdi,%rax,8),%xmm0
  jbe    L135
  jmp    L51
L184:
  movslq %esi,%rbx
  jmp    L121
```

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